diff --git a/src/game/bg.c b/src/game/bg.c index 1ee68c305..20219795a 100644 --- a/src/game/bg.c +++ b/src/game/bg.c @@ -4378,7 +4378,11 @@ bool bgTestHitInVtxBatch(struct coord *arg0, struct coord *arg1, struct coord *a texturenum = *(s16 *) PHYS_TO_K0(tmp); } +#ifdef AVOID_UB + if (batch->type == VTXBATCHTYPE_XLU && texturenum >= 0 && g_Textures[texturenum].surfacetype == SURFACETYPE_DEFAULT) { +#else if (batch->type == VTXBATCHTYPE_XLU && g_Textures[texturenum].surfacetype == SURFACETYPE_DEFAULT) { +#endif hit = false; }