aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut27
1 files changed, 18 insertions, 9 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
index 674923e71..74a9088b8 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
@@ -493,23 +493,32 @@ void function HandleKillStats( entity victim, entity attacker, var damageInfo )
// get the player and it's pet titan
entity player
entity playerPetTitan
- if ( attacker.IsPlayer() )
+ entity inflictor = DamageInfo_GetInflictor( damageInfo )
+
+ if ( IsValid( inflictor ) )
{
- // the player is just the attacker
- player = attacker
- playerPetTitan = player.GetPetTitan()
+ if ( inflictor.IsProjectile() && IsValid( inflictor.GetOwner() ) ) // Attackers are always the final entity in the owning hierarchy, projectile owners though migh be a player's NPC minion (i.e Auto-Titans)
+ attacker = inflictor.GetOwner()
+
+ else if ( inflictor.IsNPC() ) // NPCs are bypassed as Attackers if they are owned by players, instead they become just inflictors
+ attacker = inflictor
}
- else if ( attacker.IsTitan() && IsPetTitan( attacker ) )
+
+ if ( attacker.IsNPC() )
{
- // the attacker is the player's auto titan
+ if ( !attacker.IsTitan() ) // Normal NPCs case
+ return
+
+ if ( !IsPetTitan( attacker ) ) // NPC Titans case
+ return
+
player = attacker.GetTitanSoul().GetBossPlayer()
playerPetTitan = attacker
}
+ else if ( attacker.IsPlayer() ) // Still checks this because worldspawn might be the attacker
+ player = attacker
else
- {
- // attacker could be something like an NPC, or worldspawn
return
- }
// check things once, for performance
int damageSource = DamageInfo_GetDamageSourceIdentifier( damageInfo )