From 71c003dcdbe5253ca79881adea3d0ce3c3597541 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 26 Mar 2020 21:30:58 -0400 Subject: through LoadSaveblockMapHeader --- src/script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script.c') diff --git a/src/script.c b/src/script.c index ff74b40bc..5d691247f 100644 --- a/src/script.c +++ b/src/script.c @@ -358,7 +358,7 @@ void ScriptContext2_RunNewScript(const u8 *ptr) u8 *mapheader_get_tagged_pointer(u8 tag) { - u8 *mapScripts = gMapHeader.mapScripts; + const u8 *mapScripts = gMapHeader.mapScripts; if (mapScripts == NULL) return NULL; @@ -370,7 +370,7 @@ u8 *mapheader_get_tagged_pointer(u8 tag) if (*mapScripts == tag) { mapScripts++; - return (u8 *)(mapScripts[0] + (mapScripts[1] << 8) + (mapScripts[2] << 16) + (mapScripts[3] << 24)); + return T2_READ_PTR(mapScripts); } mapScripts += 5; } -- cgit v1.2.3 From fe9c3d3b58b2cf13f9bd7e61eceb249dfcf398a7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 27 Mar 2020 18:08:28 -0400 Subject: through sub_8055B38 --- src/script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script.c') diff --git a/src/script.c b/src/script.c index 5d691247f..250d98770 100644 --- a/src/script.c +++ b/src/script.c @@ -411,7 +411,7 @@ void RunOnLoadMapScript(void) mapheader_run_script_by_tag(1); } -void mapheader_run_script_with_tag_x3(void) +void RunOnTransitionMapScript(void) { mapheader_run_script_by_tag(3); } @@ -426,7 +426,7 @@ void mapheader_run_script_with_tag_x7(void) mapheader_run_script_by_tag(7); } -void mapheader_run_script_with_tag_x6(void) +void RunOnDiveWarpMapScript(void) { mapheader_run_script_by_tag(6); } -- cgit v1.2.3 From f3a632156b5ccf591677f079fb7a41162d4167f3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 28 Mar 2020 18:00:52 -0400 Subject: through sub_8057854 --- src/script.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/script.c') diff --git a/src/script.c b/src/script.c index 250d98770..8e490811b 100644 --- a/src/script.c +++ b/src/script.c @@ -416,12 +416,12 @@ void RunOnTransitionMapScript(void) mapheader_run_script_by_tag(3); } -void mapheader_run_script_with_tag_x5(void) +void RunOnResumeMapScript(void) { mapheader_run_script_by_tag(5); } -void mapheader_run_script_with_tag_x7(void) +void RunOnReturnToFieldMapScript(void) { mapheader_run_script_by_tag(7); } @@ -447,7 +447,7 @@ bool8 TryRunOnFrameMapScript(void) return 1; } -void mapheader_run_first_tag4_script_list_match(void) +void TryRunOnWarpIntoMapScript(void) { u8 *ptr = mapheader_get_first_match_from_tagged_ptr_list(4); if (ptr) -- cgit v1.2.3 From 9cfc34f2ec26d45085d9c4006b21406f8f968ed6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 29 Mar 2020 08:56:38 -0400 Subject: Address review comments --- src/script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script.c') diff --git a/src/script.c b/src/script.c index 8e490811b..13c571bac 100644 --- a/src/script.c +++ b/src/script.c @@ -379,7 +379,7 @@ u8 *mapheader_get_tagged_pointer(u8 tag) void mapheader_run_script_by_tag(u8 tag) { u8 *ptr = mapheader_get_tagged_pointer(tag); - if (ptr) + if (ptr != NULL) ScriptContext2_RunNewScript(ptr); } @@ -387,7 +387,7 @@ u8 *mapheader_get_first_match_from_tagged_ptr_list(u8 tag) { u8 *ptr = mapheader_get_tagged_pointer(tag); - if (!ptr) + if (ptr == NULL) return NULL; while (1) -- cgit v1.2.3