maybegreat48 / GTA-V-Script-Decompiler

A program that can decompile script resource (ysc) files for the PC version of Grand Theft Auto V and Red Dead Redemption 2
72 stars 21 forks source link

Some conditions seems wrongly decompiled #9

Closed Apokalypt closed 1 year ago

Apokalypt commented 1 year ago

I may be wrong, but in many cases I find a comparison that seems illogical, especially when compared with the behavior of the game...

We can see in several files, conditions with this format : \(![\w\d]* == [-2-9][\d]*\) ( e.g. (!iParam0 == 3) ) But if we try to understand the code, we can easily understand that the condition cannot be evaluated to "true":

I'm pretty sure that instead of being (!iParam0 == 3) it should be (!(iParam0 == 3)) OR (iParam0 != 3)... Do you know if it's normal and I'm missing something or is it really a decompilation error ?

N.B. : You can see these kind of conditions in several files like "michael3.c" ( example : line 106597 !iParam8 == -1), "base_carmod.c", "wizard_arcade.c", ...

Decompiler version : the last one (built with your last modifications) Decompiler options : Default

maybegreat48 commented 1 year ago

By the way, are you from the GTA glitching scene?

Apokalypt commented 1 year ago

Yes, I was very active some time ago. Now I'm working a little bit more in the shadow since I'm trying to make tools for glitchers but it takes time...

Why do you ask? Do you need information about something?

maybegreat48 commented 1 year ago

I think I've found a workaround for SP2MP, but I don't have a non-jailbroken PS4 anymore to test stuff You can contact me on Matrix: @qwlfjdekngh:matrix.org