Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing comma after reading strParseIntWithKey #259

Merged
merged 2 commits into from
May 23, 2023

Conversation

roginvs
Copy link
Contributor

@roginvs roginvs commented Apr 13, 2023

Original game in function 0x004AFF7C adds 1 to the final result so it automatically skips last comma.

...
      if ( !strcmp_(v10, v5) )
      {
         *v4 += v15 + 1; // <- Here it is
         v18 = 1;
         *v15 = atoi_(v14);
      }
...

This works perfectly fine if there is a trailing comma, but if this part was last part then it is a problem.
This PR moves string pointer only if there is a comma.

This solved issues with Fallout: Nevada random encounters, for example this line

enc_33=Chance:30%,Counter:1,Enc:(1-1) ENC_VgsManiak AMBUSH Player

is now parsed correctly

@alexbatalov alexbatalov merged commit 53a4437 into alexbatalov:main May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants