aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/gamemodes
diff options
context:
space:
mode:
authorWill Castro <39478251+VITALISED@users.noreply.github.com>2022-01-16 15:00:52 +1100
committerWill Castro <39478251+VITALISED@users.noreply.github.com>2022-01-16 15:00:52 +1100
commit1f6c2ce8e7a5a5ba47e773bd6173f228b507e8fd (patch)
tree74a71adbe72e98561fb74ff1ea7c76c167c3be57 /Northstar.CustomServers/mod/scripts/vscripts/gamemodes
parent358b243fe65cd319fb871c331fb359437ad1d395 (diff)
downloadNorthstarMods-1f6c2ce8e7a5a5ba47e773bd6173f228b507e8fd.tar.gz
NorthstarMods-1f6c2ce8e7a5a5ba47e773bd6173f228b507e8fd.zip
Swag fix
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut6
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut14
2 files changed, 16 insertions, 4 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
index 9551e1cd..64a78d35 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut
@@ -34,14 +34,16 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage
AddTeamScore( attacker.GetTeam(), 1 )
table<int, bool> alreadyAssisted
- foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory )
+ foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
{
- if( attackerInfo.attacker != attacker && !alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] )
+ bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
+ if( attackerInfo.attacker != attacker && !exists )
{
alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 )
}
}
+
}
int function CheckScoreForDraw()
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
index 5aab3bf3..8699375a 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
@@ -14,14 +14,24 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage
AddTeamScore( attacker.GetTeam(), 1 )
table<int, bool> alreadyAssisted
- foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory )
+ foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
{
- if( attackerInfo.attacker != attacker && !alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] )
+ bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
+ if( attackerInfo.attacker != attacker && !exists )
{
alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 )
}
}
+ // try
+ // {
+ // if( attackerInfo.attacker != attacker && !alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] )
+ // {
+ // alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
+ // attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 )
+ // }
+ // } catch ( ex )
+ // print( "Exception found in assist, ignoring: " + ex)
}
void function RateSpawnpoints_Directional( int checkclass, array<entity> spawnpoints, int team, entity player )