diff options
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut | 9 | ||||
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut index cb11618a..9551e1cd 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut @@ -33,11 +33,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 )
+ }
}
}
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 )
+ }
}
}
|