fix(native): read mission variable values at the correct offset

cta_logic_action walks the variable array with r15 = entry+8, compares the name
at [r15-8] and takes the value at r15+8 (0x11bd1a6), so the int value is at
entry+0x10; the nuclear win wrote the wrong field and the tickets stayed.
This commit is contained in:
N0VAN0M4LY committed 2026-11-28 18:31:43 +08:00
1 parent 5edc7adac8
commit e023ae5c58
1 file changed
+3 -2
+3 -2
View File
@@ -274,7 +274,8 @@
* shell explosion 0xbe7c00: 8th argument = the launch record's instant-win flag (passed from
* record+0x70 at 0x2fd778 / 0x2fd7c3);
* cta_logic_action 0x11bc400: its context holds the mission variables at +0x40 (data) and
* +0x50 (count), 0x20 bytes each, name pointer at +0 and int value at +8 (0x11bd150).
* +0x50 (count), 0x20 bytes each, name pointer at +0 and int value at +0x10 (0x11bd164 walks
* r15 = entry+8, compares [r15-8] and takes the value at r15+8, 0x11bd1a6).
*
* @anchor "isInstantWinOnExplode"
* @anchor "onBombMiss"
@@ -287,7 +288,7 @@
#define LMP_MISSION_VARS_OFF_COUNT 0x0050u
#define LMP_MISSION_VAR_STRIDE 0x0020u
#define LMP_MISSION_VAR_OFF_NAME 0x0000u
#define LMP_MISSION_VAR_OFF_VALUE 0x0008u
#define LMP_MISSION_VAR_OFF_VALUE 0x0010u
#define LMP_SIG_SHELL_LAUNCH "41 57 41 56 41 54 56 57 55 53 48 81 ec 30 02 00 00 44 0f 29 bc 24 20 02 00 00"
#define LMP_SIG_SHELL_EXPLODE "41 57 41 56 41 55 41 54 56 57 55 53 48 81 ec a8 02 00 00 44 0f 29 bc 24 90 02 00 00 44 0f 29 b4 24 80 02 00 00 44 0f 29 ac 24 70 02 00 00 44 0f 29 a4 24 60 02 00 00 44 0f 29 9c 24 50 02 00 00 44 0f 29 94 24 40 02 00 00 44 0f 29 8c 24 30 02 00 00 44 0f 29 84 24 20 02 00 00 0f 29 bc 24 10 02 00 00 0f 29 b4 24 00 02 00 00 41 89 d3"
#define LMP_SIG_CTA_LOGIC_ACTION "41 57 41 56 41 55 41 54 56 57 55 53 48 81 ec a8 02 00 00 44 0f 29 bc 24 90 02 00 00 44 0f 29 b4 24 80 02 00 00 44 0f 29 ac 24 70 02 00 00 44 0f 29 a4 24 60 02 00 00 44 0f 29 9c 24 50 02 00 00 44 0f 29 94 24 40 02 00 00 44 0f 29 8c 24 30 02 00 00 44 0f 29 84 24 20 02 00 00 0f 29 bc 24 10 02 00 00 0f 29 b4 24 00 02 00 00 48 89 cf"