Skip to content

Commit

Permalink
Prevent unrestricted items camera crash (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
briaguya-ai authored Jul 21, 2022
1 parent d08b1d2 commit eb49053
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions soh/src/code/z_room.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {

camera = GET_ACTIVE_CAM(globalCtx);
camId = camera->camDataIdx;
if (camId == -1 && CVar_GetS32("gNoRestrictItems", 0)) {
// This prevents a crash when using items that change the
// camera (such as din's fire) on scenes with prerendered backgrounds
return NULL;
}

// jfifid
camId2 = func_80041C10(&globalCtx->colCtx, camId, BGCHECK_SCENE)[2].y;
if (camId2 >= 0) {
Expand Down

0 comments on commit eb49053

Please sign in to comment.