From bac8974ce375bc464c6374cfeb4d74e4dc98a20a Mon Sep 17 00:00:00 2001 From: Tustin2121 Date: Sat, 17 Aug 2019 11:16:54 -0400 Subject: Added note about addvar The contest scripts actually use addvar to add a -1 to a variable instead of using subvar to subtract a positive number. This is fine in vanilla, where addvar script command does NOT support adding the value of a variable to another variable (like subvar supports), but should anyone want to change it, contests will be inexplicably broken. --- src/scrcmd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index aa03181e6..e31be848a 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -466,6 +466,9 @@ bool8 ScrCmd_addvar(struct ScriptContext *ctx) { u16 *ptr = GetVarPointer(ScriptReadHalfword(ctx)); *ptr += ScriptReadHalfword(ctx); + // Note: addvar doesn't support adding from a variable in vanilla. If you were to + // add a VarGet() to the above, make sure you change the `addvar VAR_0x8006, 65535` + // in the contest scripts to `subvar VAR_0x8006, 1`, else contests will break. return FALSE; } -- cgit v1.2.3