Fixed crash in geo_switch_mario_cap_on_off()

This commit is contained in:
MysterD 2023-04-22 01:53:04 -07:00
parent e212a111dd
commit 619eba7527
1 changed files with 2 additions and 1 deletions

View File

@ -563,6 +563,7 @@ Gfx* geo_switch_mario_cap_effect(s32 callContext, struct GraphNode* node, UNUSED
* Also sets the visibility of the wing cap wings on or off.
*/
Gfx* geo_switch_mario_cap_on_off(s32 callContext, struct GraphNode* node, UNUSED Mat4* c) {
if (!node) { return NULL; }
struct GraphNode* next = node->next;
struct GraphNodeSwitchCase* switchCase = (struct GraphNodeSwitchCase*) node;
struct MarioBodyState* bodyState = geo_get_body_state();
@ -570,7 +571,7 @@ Gfx* geo_switch_mario_cap_on_off(s32 callContext, struct GraphNode* node, UNUSED
if (callContext == GEO_CONTEXT_RENDER) {
if (switchCase == NULL || bodyState == NULL) { return NULL; }
switchCase->selectedCase = bodyState->capState & 1;
while (next != node) {
while (next && (next != node)) {
if (next->type == GRAPH_NODE_TYPE_TRANSLATION_ROTATION) {
if (bodyState->capState & 2) {
next->flags |= GRAPH_RENDER_ACTIVE;