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

Naive parsing of macros causes crash when loading a recording #43

Open
sente-descin opened this issue Dec 31, 2023 · 0 comments
Open

Naive parsing of macros causes crash when loading a recording #43

sente-descin opened this issue Dec 31, 2023 · 0 comments

Comments

@sente-descin
Copy link

sente-descin commented Dec 31, 2023

If a macro (call this macro1) contains a substring previously defined as a macro (call this macro2) earlier in the json config, then loading a recording with macro1 in it will cause a crash. For example, if you have the macro "SBA" defined before "SSBA" in the config json, any recordings containing "SSBA" will crash. Reversing the order of the macros in the config will prevent the crash.

Here is a minimum working example:

In config\mwe_crash.json:
{
"FPS": 60,

"Symbols": {
"L": "BtnX",
"start": "BtnStart"
},

"P1_directions": {
"2": { "Dpad": "down" }
},

"P2_directions": {
"2": { "Dpad": "down" }
},

"Macros": {
"SBA": "L",
"SSBA": "start"
}
}

In recordings\mwe_crash.txt:
config\mwe_crash.json
SSBA

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

No branches or pull requests

1 participant