From ccaffae234fc93ea16d8ad6277fcf57ffc86ce46 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Sat, 18 Nov 2023 20:19:19 -0800 Subject: [PATCH] SHScientist: Fix the check a little to discard invalid negative values --- src/server/monster_scientist.qc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/server/monster_scientist.qc b/src/server/monster_scientist.qc index 58db340..b84ff01 100644 --- a/src/server/monster_scientist.qc +++ b/src/server/monster_scientist.qc @@ -418,23 +418,26 @@ SHScientist::Respawn(void) m_iFlags |= MONSTER_FEAR; } - if ((cvar("sh_scirand") == 1) || (m_iBody == 0)) { + if (m_iBody <= 0i) + m_iBody = 0i; + + if ((cvar("sh_scirand") == 1) || (m_iBody == 0i)) { m_iBody = floor(random(1,5)); SetSkin(0); switch (m_iBody) { - case 1: + case 1i: m_flPitch = 105; netname = "Walter"; SetBodyInGroup(1, 1); break; - case 2: + case 2i: m_flPitch = 100; netname = "Einstein"; SetBodyInGroup(1, 2); break; - case 3: + case 3i: m_flPitch = 95; netname = "Luther"; SetBodyInGroup(1, 3);