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

Maniacs - Player crashes when reading substring of non-existant string variable. #3305

Open
elsemieni opened this issue Nov 25, 2024 · 2 comments

Comments

@elsemieni
Copy link
Member

Tested on Player master.

Continuing reporting bugs from a WIP features, found other sort of issue, product of reading not-yet-defined string variables.
It's quite simple:
When executing a string split from a non-existant string (Let's say T[0127] and T[128]for example) ....

@> Control String Variables: T[0128], Assign, Substring T[0127] from 1 (1 chars)

Or in TPC notation

t[128] .asg  .subs t[127], 1, 1

... , seems it tries to execute anyways. Using an index 0 seems to read zeros, but more bigger index makes player crash.
Sure, I'm guessing here that doing string checking is more complicated rather than variables and switches, but seems that's the origin cause.
Probably there will be more related bugs regarding out of bounds or non existant string variable (or other Maniacs related resource) reading out there.

@Ghabry
Copy link
Member

Ghabry commented Nov 25, 2024

Hm I extended the string var test now with out of bounds values and yeah I get lots of crashes and softlocks 😅

Also noticed that when using a negative index Maniacs seems to index from the back (like Python does).

@Ghabry Ghabry added this to the 0.8.1 milestone Nov 25, 2024
Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Nov 25, 2024
Support left-adjust for PrependMin
Support indexing from the back with negative values

Fix EasyRPG#3305
@Ghabry
Copy link
Member

Ghabry commented Nov 25, 2024

For all further tests please use this PR build: https://ci.easyrpg.org/view/Pull%20Requests/job/player-win32-pr/6555/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants