aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorx3Karma <juliuslimck@gmail.com>2022-06-01 07:23:15 +0800
committerGitHub <noreply@github.com>2022-06-01 01:23:15 +0200
commit1cd2f6c991fdf3586b12feb58ff9204731b8da5a (patch)
treebc38839856ed33fc1f097494354cebb5eba5cab7
parentd3aeacd7fc3efda1c0d6d960e83f10b1de57591e (diff)
downloadNorthstarMods-1cd2f6c991fdf3586b12feb58ff9204731b8da5a.tar.gz
NorthstarMods-1cd2f6c991fdf3586b12feb58ff9204731b8da5a.zip
Fixed Auto-Titan deaths not showing up in Obituary (#371)
* fixed not showing Auto-Titans death in killfeed
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut20
1 files changed, 20 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
index 5d5742c3..64245977 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
@@ -35,6 +35,8 @@ void function BaseGametype_Init_MPSP()
AddPostDamageCallback( "player", AddToTitanDamageStat )
AddPostDamageCallback( "npc_titan", AddToTitanDamageStat )
+ AddCallback_OnNPCKilled( CheckForAutoTitanDeath )
+ AddCallback_OnPlayerKilled( CheckForAutoTitanDeath )
RegisterSignal( "PlayerRespawnStarted" )
RegisterSignal( "KillCamOver" )
}
@@ -532,6 +534,24 @@ void function AddToTitanDamageStat( entity victim, var damageInfo )
attacker.AddToPlayerGameStat( file.titanDamageGameStat, amount ) // titan damage on
}
+void function CheckForAutoTitanDeath( entity victim, entity attacker, var damageInfo )
+{
+ if( !IsValid(victim) || !victim.IsTitan() )
+ return
+
+ if( !victim.IsPlayer() )
+ {
+ if (GetPetTitanOwner(victim) && GetPetTitanOwner(victim) != attacker)
+ foreach(player in GetPlayerArray())
+ Remote_CallFunction_NonReplay( player, "ServerCallback_OnTitanKilled", attacker.GetEncodedEHandle(), victim.GetEncodedEHandle(), DamageInfo_GetCustomDamageType( damageInfo ), DamageInfo_GetDamageSourceIdentifier( damageInfo ) )
+ }
+ else
+ {
+ if (victim != attacker)
+ foreach(player in GetPlayerArray())
+ Remote_CallFunction_NonReplay( player, "ServerCallback_OnTitanKilled", attacker.GetEncodedEHandle(), victim.GetEncodedEHandle(), DamageInfo_GetCustomDamageType( damageInfo ), DamageInfo_GetDamageSourceIdentifier( damageInfo ) )
+ }
+}
// stuff to change later