xtnded / iw2clientdll

Call of Duty 2 1.4 Client Patch
GNU General Public License v2.0
9 stars 3 forks source link

va bug #8

Closed kungfooman closed 3 years ago

kungfooman commented 3 years ago

Hey @PrawyCoD1

After your PR there is a problem:

image

The va() address will be useless after the next usage, resulting in a string of whatever where merged via va later (could be memory garbage).

You can just copy the code from the marked red rect over it, because that macro is creating a const string

If anyone has the time, please fix it

PrawyCoD1 commented 3 years ago

Pasting code from the marked red rect. Will make version display like this: Apr 0811:28:36

kungfooman commented 3 years ago

Thanks, can you also add comments where you saw it in the game? Console, 'version' command or whereever

kungfooman commented 3 years ago

Thanks to @riicchhaarrd for noting the issue in the first place ❣️ 🌈

PrawyCoD1 commented 3 years ago

image

That's how date and time is displayed when i do - image

PrawyCoD1 commented 3 years ago

So instead of va().

I did image

credits to php for this method.

kungfooman commented 3 years ago

Please don't overcomplicate code when you can just do:

__DATE__ " " __TIME__

Could you fix @riicchhaarrd's macro concatenation too?

PrawyCoD1 commented 3 years ago

Oh didn't know i can do it like that. Thanks then. :P . macro concatenation? What's that

kungfooman commented 3 years ago

The red rect marked in first post is a macro concatenation, you can just add a " " between __DATE__ and __TIME__

kungfooman commented 3 years ago

Fixed by #9 (thanks @PrawyCoD1)