From 820a33f2785c7a4ac413d3a1ce9d1ea8e3c31583 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Tue, 3 Apr 2018 00:22:26 +0500 Subject: [PATCH] Fix monsters precache with custom sound folders via monstermaker. --- dlls/monstermaker.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/dlls/monstermaker.cpp b/dlls/monstermaker.cpp index 3b0f1ad1..26b39c2a 100644 --- a/dlls/monstermaker.cpp +++ b/dlls/monstermaker.cpp @@ -151,7 +151,29 @@ void CMonsterMaker::Precache( void ) { CBaseMonster::Precache(); - UTIL_PrecacheOther( STRING( m_iszMonsterClassname ) ); + if( pev->message ) + { + edict_t *pent; + + pent = CREATE_NAMED_ENTITY( m_iszMonsterClassname ); + + if( FNullEnt( pent ) ) + { + ALERT( at_console, "NULL Ent in UTIL_PrecacheOther\n" ); + return; + } + + CBaseEntity *pEntity = CBaseEntity::Instance( VARS( pent ) ); + + pEntity->pev->message = pev->message; + + if( pEntity ) + pEntity->Precache(); + + REMOVE_ENTITY( pent ); + } + else + UTIL_PrecacheOther( STRING( m_iszMonsterClassname ) ); } //=========================================================