@@ -4358,6 +4358,44 @@ void CASW_Marine::Event_Killed( const CTakeDamageInfo &info )
43584358 if ( ASWDeathmatchMode () )
43594359 ASWDeathmatchMode ()->OnMarineKilled ( info, this );
43604360
4361+ m_bSlowHeal = false ; // no healing if we're dead!
4362+
4363+ PrintDeathMessage ( info );
4364+ }
4365+
4366+ void CASW_Marine::PrintDeathMessage ( const CTakeDamageInfo &info )
4367+ {
4368+ CASW_Marine_Resource *pMR = GetMarineResource ();
4369+
4370+ // print a custom death message if we have one
4371+ CAlienSwarm *pAlienSwarm = ASWGameRules ();
4372+ if ( pAlienSwarm )
4373+ {
4374+ ScriptVariant_t args[7 ];
4375+ ScriptVariant_t retvalue;
4376+
4377+ args[0 ] = ToHScript ( this );
4378+ args[1 ] = ToHScript ( info.GetInflictor () );
4379+ args[2 ] = ToHScript ( info.GetAttacker () );
4380+ args[3 ] = ToHScript ( info.GetWeapon () );
4381+ args[4 ] = info.GetDamage ();
4382+ args[5 ] = info.GetDamageType ();
4383+ args[6 ] = info.GetAmmoName ();
4384+
4385+ pAlienSwarm->RunScriptFunctionInListenerScopes ( " AlterDeathMessage" , &retvalue, NELEMS ( args ), args );
4386+
4387+ if ( retvalue.m_type == FIELD_CSTRING )
4388+ {
4389+ char szName[256 ];
4390+ pMR->GetDisplayName ( szName, sizeof ( szName ) );
4391+
4392+ UTIL_ClientPrintAll ( ASW_HUD_PRINTTALKANDCONSOLE, retvalue.m_pszString , szName );
4393+
4394+ return ;
4395+ }
4396+ }
4397+
4398+ CBaseEntity *pAttacker = info.GetAttacker ();
43614399 // print a message if marine was killed by another marine
43624400 if ( pAttacker && pAttacker->Classify () == CLASS_ASW_MARINE )
43634401 {
@@ -4411,8 +4449,6 @@ void CASW_Marine::Event_Killed( const CTakeDamageInfo &info )
44114449 UTIL_ClientPrintAll ( ASW_HUD_PRINTTALKANDCONSOLE, " #asw_chat_died" , szName );
44124450 }
44134451 }
4414-
4415- m_bSlowHeal = false ; // no healing if we're dead!
44164452}
44174453
44184454void CASW_Marine::AimGun ()
0 commit comments