From 358b243fe65cd319fb871c331fb359437ad1d395 Mon Sep 17 00:00:00 2001 From: Will Castro <39478251+VITALISED@users.noreply.github.com> Date: Fri, 14 Jan 2022 15:00:47 +1100 Subject: Fixes --- .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 10 +++++----- Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp') 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 809c8886..d3fc4c95 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -281,14 +281,14 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga entity attacker = DamageInfo_GetAttacker( damageInfo ) int methodOfDeath = DamageInfo_GetDamageSourceIdentifier( damageInfo ) - var existingAttackers = [] - foreach(DamageHistoryStruct attackerInfo in player.e.recentDamageHistory) + table alreadyAssisted + foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory ) { - if( attackerInfo.attacker != attacker && !(attackerInfo.attacker in existingAttackers) ) + if( attackerInfo.attacker != attacker && !alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] ) { - AddPlayerScore(attackerInfo.attacker, "PilotAssist" ) - existingAttackers.append(attackerInfo.attacker) + alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), player.GetEncodedEHandle(), attackerInfo.time ) + AddPlayerScore(attackerInfo.attacker, "PilotAssist" ) } } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut index 19d58a17..40300b11 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut @@ -191,13 +191,13 @@ void function ScoreEvent_TitanKilled( entity victim, entity attacker, var damage else AddPlayerScore( attacker, "KillTitan", victim.GetTitanSoul().GetOwner() ) - var existingAttackers = [] - foreach(DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory) + table 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 AddPlayerScore(attackerInfo.attacker, "TitanAssist" ) - existingAttackers.append(attackerInfo.attacker) Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), victim.GetEncodedEHandle(), attackerInfo.time ) } } -- cgit v1.2.3