diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index f1168f64..dfc71892 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -1500,6 +1500,7 @@ void geo_process_node_and_siblings(struct GraphNode *firstNode) { do { if (curGraphNode == NULL) { + LOG_ERROR("Graph Node null!"); break; } @@ -1509,10 +1510,16 @@ void geo_process_node_and_siblings(struct GraphNode *firstNode) { } // Sanity check our stack index, If we above or equal to our stack size. Return to prevent OOB\. - if ((gMatStackIndex + 1) >= MATRIX_STACK_SIZE) { break; } + if ((gMatStackIndex + 1) >= MATRIX_STACK_SIZE) { + LOG_ERROR("Graph Node matrix stack overflow!"); + break; + } // Break out of endless loops - if (++depthSanity > 5000) { break; } + if (++depthSanity > 5000) { + LOG_ERROR("Graph Node too deep!"); + break; + } if (curGraphNode->flags & GRAPH_RENDER_ACTIVE) { if (curGraphNode->flags & GRAPH_RENDER_CHILDREN_FIRST) { diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c index 732848f4..27324e07 100644 --- a/src/pc/gfx/gfx_pc.c +++ b/src/pc/gfx/gfx_pc.c @@ -998,7 +998,9 @@ static void OPTIMIZE_O3 gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t break; case G_CULL_BOTH: // Why is this even an option? - return; + // HACK: Instead of culling both sides and displaying nothing, cull nothing and display everything + // this is needed because of the mirror room... some custom models will set/clear cull values resulting in cull both + break; } }