From f2cfa19da7912b4bbaf15aaace3caf678d3b3703 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 1 May 2023 01:34:26 -0700 Subject: [PATCH] Fixed crash in bhv_wiggler_body_part_update() --- src/game/behaviors/wiggler.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/behaviors/wiggler.inc.c b/src/game/behaviors/wiggler.inc.c index b25ceb022..7b3d809db 100644 --- a/src/game/behaviors/wiggler.inc.c +++ b/src/game/behaviors/wiggler.inc.c @@ -71,7 +71,7 @@ void bhv_wiggler_body_part_update(void) { // Sanity check the array size of our segments, // This should never be higher then 3 // in normal circumstances. - if (o->oBehParams2ndByte > 3) { return; } + if (o->oBehParams2ndByte > 3 || o->oBehParams2ndByte < 0) { return; } struct ChainSegment *segment = &parent->oWigglerSegments[o->oBehParams2ndByte];