From 8b9716908fa05f509727acc80499ea036728f513 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Fri, 4 Nov 2022 02:29:02 +0500 Subject: [PATCH] Fix civilian scientist's voice pitch selection. --- dlls/tot/civ.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/tot/civ.cpp b/dlls/tot/civ.cpp index a784e0e2..3b154941 100644 --- a/dlls/tot/civ.cpp +++ b/dlls/tot/civ.cpp @@ -42,6 +42,12 @@ LINK_ENTITY_TO_CLASS(monster_civ, CCivScientist); //========================================================= void CCivScientist::Spawn(void) { + // We need to set it before precache so the right voice will be chosen + if( pev->body == -1 ) + {// -1 chooses a random head + pev->body = RANDOM_LONG( 0, NUM_SCIENTIST_HEADS - 1 );// pick a head, any he + } + Precache(); SET_MODEL(ENT(pev), "models/civ_sci.mdl"); @@ -62,11 +68,6 @@ void CCivScientist::Spawn(void) // White hands pev->skin = 0; - if (pev->body == -1) - {// -1 chooses a random head - pev->body = RANDOM_LONG(0, NUM_SCIENTIST_HEADS - 1);// pick a head, any head - } - // Luther is black, make his hands black if (pev->body == HEAD_LUTHER) pev->skin = 1;