summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorChristopher Leggett <chris@leggett.dev>2026-03-20 03:40:35 +0000
committerGitHub <noreply@github.com>2026-03-20 03:40:35 +0000
commitf2c34d8c112247d63ddb99702b2caf716ff77516 (patch)
treec9e6327694508da4f6777a80b1b0f426f40a1f63 /soh/src/code
parent38e684fda3c8582f7beae91953cbaaa0563ed6c2 (diff)
Fix Entrance Rando Grotto Voidout Crash when voiding back to an area with a background image (#6379)
Hookify bgimage load cam check and add it to entrance rando
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_room.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c
index 8b4f31eba..317ee0775 100644
--- a/soh/src/code/z_room.c
+++ b/soh/src/code/z_room.c
@@ -413,34 +413,28 @@ BgImage* func_80096A74(PolygonType1* polygon1, PlayState* play) {
camera = GET_ACTIVE_CAM(play);
camId = camera->camDataIdx;
- if (camId == -1 && (CVarGetInteger(CVAR_CHEAT("NoRestrictItems"), 0) ||
- (CVarGetInteger(CVAR_REMOTE_CROWD_CONTROL("Enabled"), 0)))) {
- // This prevents a crash when using items that change the
- // camera (such as din's fire), voiding out or dying on
- // scenes with prerendered backgrounds.
- return NULL;
- }
-
- // jfifid
- camId2 = func_80041C10(&play->colCtx, camId, BGCHECK_SCENE)[2].y;
- if (camId2 >= 0) {
- camId = camId2;
- }
+ if (GameInteractor_Should(VB_SHOULD_LOAD_BG_IMAGE, true, &camId)) {
+ // jfifid
+ camId2 = func_80041C10(&play->colCtx, camId, BGCHECK_SCENE)[2].y;
+ if (camId2 >= 0) {
+ camId = camId2;
+ }
- player = GET_PLAYER(play);
- player->actor.params = (player->actor.params & 0xFF00) | camId;
+ player = GET_PLAYER(play);
+ player->actor.params = (player->actor.params & 0xFF00) | camId;
- bgImage = SEGMENTED_TO_VIRTUAL(polygon1->multi.list);
- for (i = 0; i < polygon1->multi.count; i++) {
- if (bgImage->id == camId) {
- return bgImage;
+ bgImage = SEGMENTED_TO_VIRTUAL(polygon1->multi.list);
+ for (i = 0; i < polygon1->multi.count; i++) {
+ if (bgImage->id == camId) {
+ return bgImage;
+ }
+ bgImage++;
}
- bgImage++;
- }
- // "z_room.c: Data consistent with camera id does not exist camid=%d"
- osSyncPrintf(VT_COL(RED, WHITE) "z_room.c:カメラIDに一致するデータが存在しません camid=%d\n" VT_RST, camId);
- LOG_HUNGUP_THREAD();
+ // "z_room.c: Data consistent with camera id does not exist camid=%d"
+ osSyncPrintf(VT_COL(RED, WHITE) "z_room.c:カメラIDに一致するデータが存在しません camid=%d\n" VT_RST, camId);
+ LOG_HUNGUP_THREAD();
+ }
return NULL;
}