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

Functions with many loop variables have invalid variable names #18

Closed xchgrbprsp closed 9 months ago

xchgrbprsp commented 10 months ago

I noticed loop variables are named as i, j, k, ..., etc. This is problematic when decompiling functions with many loop variables and you run out of letters to name them. For example, this particular function in fmmc_launcher.ysc has so many loop variables that it starts using special symbols and even other nondisplayable characaters as variable names. I had to modify LoopIndexAutoName to use number suffix in order to produce somewhat more reasonable code.

image