UndertaleModTool
UndertaleModTool copied to clipboard
fixed disappearing returns
Description
This fixes issue #1456 caused by pr #1191. This issue occurred because the pr would remove any exit
instruction that wasn't followed by an operation starting with push int
, which removed simple return;
s that didn't meet that req because they compile to exit
(while return value;
compiles to ret
). Thanks to @Jacky720 for a better way than my initial solution in #1680
Caveats
Haven't done proper testing
Notes
N/A
This also resolves #1223 (and maybe some more, we have a big issues backlog).
Can someone test this please?
Can someone test this please?
Scuffed test
Before PR: https://github.com/krzys-h/UndertaleModTool/commit/4cb37e67c8b9f5428958dadb332efdff7b540317 After PR: https://github.com/Dobby233Liu/UndertaleModTool/commit/fc119135b58e6c7a72d2e4c093c7a0c5f4a31d4a
In DR Ch 1&2 v1.10 (2022.1),
- Open
gml_GlobalScript_scr_create_hitbox_solid
, insert right after start of bodyif global.darkzone != 1 return;
- Before PR: compiles to
f ((global.darkzone != true)) { }
- After PR: compiles to
if ((global.darkzone != true)) return;
- Before PR: compiles to
- Open
gml_Object_o_boxingflame_Create_0
, insert before line 1if (instance_exists(o_boxingqueen) == 0) return;
- Before PR: compiles to
f ((instance_exists(o_boxingqueen) == 0)) return;
- After PR: compiles to
f ((instance_exists(o_boxingqueen) == 0)) return;
- Before PR: compiles to
With ULCA Deltarune skit program which is 2023.1 ,
- Open
gml_Object_obj_event_anxietyrealized_Create_0
, and insert before line 1if global.chapter != 3 { exit; }
- Before PR: compiles to
if ((global.chapter != 3)) return;
- After PR: compiles to
if ((global.chapter != 3)) return;
- Before PR: compiles to
- Open
gml_GlobalScript_scr_mercyadd
, insert right after start of bodyif !global.darkzone exit;
- Before PR: compiles to
if (!global.darkzone) return;
- After PR: compiles to
if (!global.darkzone) return;
- Before PR: compiles to
ty, probably is good then