From c1e96c6c2e5e93875aa6cdce934081f8c0d74e98 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Thu, 19 Oct 2017 00:20:09 +0500 Subject: [PATCH] Add monster_zombie_barney, monster_zombie_soldier, monster_zombie_grunt implementations. --- dlls/zombie.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/dlls/zombie.cpp b/dlls/zombie.cpp index 2d830025..27ff0ff7 100644 --- a/dlls/zombie.cpp +++ b/dlls/zombie.cpp @@ -35,6 +35,9 @@ #define ZOMBIE_FLINCH_DELAY 2 // at most one flinch every n secs LINK_ENTITY_TO_CLASS( monster_zombie, CZombie ) +LINK_ENTITY_TO_CLASS( monster_zombie_barney, CZombie ) +LINK_ENTITY_TO_CLASS( monster_zombie_soldier, CZombie ) +LINK_ENTITY_TO_CLASS( monster_zombie_grunt, CZombie ) const char *CZombie::pAttackHitSounds[] = { @@ -237,7 +240,14 @@ void CZombie::Spawn() { Precache(); - SET_MODEL( ENT( pev ), "models/zombie.mdl" ); + if( FClassnameIs( pev, "monster_zombie_barney" ) ) + SET_MODEL( ENT( pev ), "models/zombie_barney.mdl" ); + else if( FClassnameIs( pev, "monster_zombie_soldier" ) ) + SET_MODEL( ENT( pev ), "models/zombie_soldier.mdl" ); + else if( FClassnameIs( pev, "monster_zombie_grunt" ) ) + SET_MODEL( ENT( pev ), "models/zgrunt.mdl" ); + else + SET_MODEL( ENT( pev ), "models/zombie.mdl" ); UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX ); pev->solid = SOLID_SLIDEBOX; @@ -259,7 +269,14 @@ void CZombie::Precache() { size_t i; - PRECACHE_MODEL( "models/zombie.mdl" ); + if( FClassnameIs( pev, "monster_zombie_barney" ) ) + PRECACHE_MODEL( "models/zombie_barney.mdl" ); + else if( FClassnameIs( pev, "monster_zombie_soldier" ) ) + PRECACHE_MODEL( "models/zombie_soldier.mdl" ); + else if( FClassnameIs( pev, "monster_zombie_grunt" ) ) + PRECACHE_MODEL( "models/zgrunt.mdl" ); + else + PRECACHE_MODEL( "models/zombie.mdl" ); for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ ) PRECACHE_SOUND( pAttackHitSounds[i] );