diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index eaf94c2f9..c9bcab945 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -159,7 +159,7 @@ void func0f01e250(void) value = func0f07e474(prop); } else if (prop->type == PROPTYPE_EXPLOSION) { value = func0f12bbdc(prop); - } else if (prop->type == PROPTYPE_EFFECT) { + } else if (prop->type == PROPTYPE_SMOKE) { value = func0f12e848(prop); } else if (prop->type == PROPTYPE_PLAYER) { value = func0f0c228c(prop); diff --git a/src/game/core.c b/src/game/core.c index 31906faf4..953caca1f 100644 --- a/src/game/core.c +++ b/src/game/core.c @@ -628,7 +628,7 @@ bool coreCheckCmpFollowThreat(struct threat *threat, s32 index) case PROPTYPE_DOOR: case PROPTYPE_EYESPY: case PROPTYPE_EXPLOSION: - case PROPTYPE_EFFECT: + case PROPTYPE_SMOKE: default: return false; } diff --git a/src/game/game_0601b0.c b/src/game/game_0601b0.c index 7887b727f..d72438416 100644 --- a/src/game/game_0601b0.c +++ b/src/game/game_0601b0.c @@ -359,7 +359,7 @@ Gfx *propRender(Gfx *gdl, struct prop *prop, bool withalpha) case PROPTYPE_EXPLOSION: gdl = explosionRender(prop, gdl, withalpha); break; - case PROPTYPE_EFFECT: + case PROPTYPE_SMOKE: gdl = smokeRender(prop, gdl, withalpha); break; } @@ -3033,6 +3033,51 @@ glabel currentPlayerFindPropForInteract /* f062dcc: 27bd0040 */ addiu $sp,$sp,0x40 ); +// Mismatch due to regalloc. +// It's likely a switch was used, and using one comes close but doesn't match +// as well. Another problem is that 8 (PROPTYPE_SMOKE) needs to be loaded into +// a register, but referencing prop an extra time time promotes it to s0. This +// is resolved below by passing *ptr to those functions instead of prop, but +// this seems unlikely. +// If attempting to use a switch, note that the door part needs to be an if +// statement inside the default case. +//struct prop *currentPlayerFindPropForInteract(bool usingeyespy) +//{ +// struct prop **ptr; +// bool result; +// +// var8009cda8 = NULL; +// ptr = g_Vars.unk00034c - 1; +// result = true; +// +// // Iterate tangible list in reverse +// while (ptr >= g_Vars.tangibleprops) { +// struct prop *prop = *ptr; +// +// if (prop) { +// if (prop->type != PROPTYPE_CHR) { +// if (prop->type == PROPTYPE_OBJ || prop->type == PROPTYPE_WEAPON) { +// if (!usingeyespy) { +// result = func0f0869cc(*ptr); +// } +// } else if (prop->type == PROPTYPE_DOOR) { +// result = func0f08fcb8(*ptr); +// +// if (prop->type == PROPTYPE_SMOKE); +// } +// } +// +// if (!result) { +// break; +// } +// } +// +// ptr--; +// } +// +// return var8009cda8; +//} + void func0f062dd0(void) { struct prop **ptr = g_Vars.unk00034c - 1; @@ -3076,7 +3121,7 @@ bool currentPlayerInteract(bool eyespy) case PROPTYPE_EYESPY: case PROPTYPE_PLAYER: case PROPTYPE_EXPLOSION: - case PROPTYPE_EFFECT: + case PROPTYPE_SMOKE: break; } diff --git a/src/game/smoke/smoke.c b/src/game/smoke/smoke.c index 2941cb617..a7962a6dd 100644 --- a/src/game/smoke/smoke.c +++ b/src/game/smoke/smoke.c @@ -1234,7 +1234,7 @@ glabel smokeCreate // struct prop *prop = propAllocate(); // // if (prop) { -// prop->type = PROPTYPE_EFFECT; +// prop->type = PROPTYPE_SMOKE; // prop->smoke = smoke; // prop->pos.x = pos->x; // prop->pos.y = pos->y; diff --git a/src/gvars/gvars.c b/src/gvars/gvars.c index 4a24d4190..5be3803ee 100644 --- a/src/gvars/gvars.c +++ b/src/gvars/gvars.c @@ -14573,7 +14573,7 @@ u8 g_RecentQuipsIndex = 0; u32 var8009cd9c = 0; s16 *var8009cda0 = NULL; struct var8009cda4 *var8009cda4 = NULL; -u32 var8009cda8 = 0; +struct prop *var8009cda8 = NULL; u32 var8009cdac = 0; u32 var8009cdb0 = 0; u32 var8009cdb4 = 0; diff --git a/src/include/constants.h b/src/include/constants.h index b41e7e392..d5c48d9c4 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -2618,7 +2618,7 @@ #define PROPTYPE_EYESPY 5 #define PROPTYPE_PLAYER 6 #define PROPTYPE_EXPLOSION 7 -#define PROPTYPE_EFFECT 8 +#define PROPTYPE_SMOKE 8 #define QUADRANT_BACK 0x01 #define QUADRANT_SIDE1 0x02 diff --git a/src/include/game/propobj.h b/src/include/game/propobj.h index 53f368c2f..d07a0a460 100644 --- a/src/include/game/propobj.h +++ b/src/include/game/propobj.h @@ -333,7 +333,7 @@ void doorDoCalc(struct doorobj *door); u32 func0f08f538(void); u32 func0f08f604(void); u32 func0f08f968(void); -u32 func0f08fcb8(void); +bool func0f08fcb8(struct prop *prop); void doorActivateWrapper(struct prop *prop, bool arg1); u32 func0f08fffc(void); void func0f0900c0(struct prop *prop, struct doorobj *door); diff --git a/src/include/gvars/gvars.h b/src/include/gvars/gvars.h index bfa6adecc..638bbbfab 100644 --- a/src/include/gvars/gvars.h +++ b/src/include/gvars/gvars.h @@ -531,6 +531,7 @@ extern s32 g_RecentQuipsPlayed[5]; extern u8 g_RecentQuipsIndex; extern s16 *var8009cda0; extern struct var8009cda4 *var8009cda4; +extern struct prop *var8009cda8; extern u32 var8009cdac; extern u32 var8009cdb0; extern struct weaponobj *g_ProxyMines[30];