aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
diff options
context:
space:
mode:
authorWill Castro <39478251+VITALISED@users.noreply.github.com>2022-01-14 15:00:47 +1100
committerWill Castro <39478251+VITALISED@users.noreply.github.com>2022-01-14 15:00:47 +1100
commit358b243fe65cd319fb871c331fb359437ad1d395 (patch)
tree46366554d271a1852db18200c922c33f8926c0bc /Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
parent8411bb9079593827b532461d205676c35fefb394 (diff)
downloadNorthstarMods-358b243fe65cd319fb871c331fb359437ad1d395.tar.gz
NorthstarMods-358b243fe65cd319fb871c331fb359437ad1d395.zip
Fixes
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut9
1 files changed, 6 insertions, 3 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
index ae5cb5e6..5aab3bf3 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
@@ -13,11 +13,14 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage
if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() || GetGameState() != eGameState.Playing )
AddTeamScore( attacker.GetTeam(), 1 )
- var existingAttackers = []
- foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
+ table<int, bool> alreadyAssisted
+ foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory )
{
- if( attackerInfo.attacker != attacker && !( attackerInfo.attacker in existingAttackers ) )
+ if( attackerInfo.attacker != attacker && !alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] )
+ {
+ alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 )
+ }
}
}