From af2f675a13c1e82fc4900bd61aadc88facd4775a Mon Sep 17 00:00:00 2001 From: Will Castro <39478251+VITALISED@users.noreply.github.com> Date: Mon, 10 Jan 2022 20:38:50 +1100 Subject: Add assist medals and scoring --- .../mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut index ba1807900..3248d72ef 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut @@ -12,6 +12,13 @@ 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) + { + if( attackerInfo.attacker != attacker && !(attackerInfo.attacker in existingAttackers) ) + attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 ) + } } void function RateSpawnpoints_Directional( int checkclass, array spawnpoints, int team, entity player ) -- cgit v1.2.3 From 2bd7c48cf6677559e4f89fe9ccfd0ea04bea8aa4 Mon Sep 17 00:00:00 2001 From: Will Castro <39478251+VITALISED@users.noreply.github.com> Date: Mon, 10 Jan 2022 20:41:01 +1100 Subject: Fix formatting --- .../mod/scripts/vscripts/gamemodes/_gamemode_ps.nut | 8 ++++---- .../mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut index 965557b6f..30dbdd891 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut @@ -34,18 +34,18 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage AddTeamScore( attacker.GetTeam(), 1 ) var existingAttackers = [] - foreach(DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory) + foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory ) { - if( attackerInfo.attacker != attacker && !(attackerInfo.attacker in existingAttackers) ) + if( attackerInfo.attacker != attacker && !( attackerInfo.attacker in existingAttackers ) ) attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 ) } } int function CheckScoreForDraw() { - if (GameRules_GetTeamScore(TEAM_IMC) > GameRules_GetTeamScore(TEAM_MILITIA)) + if (GameRules_GetTeamScore(TEAM_IMC) > GameRules_GetTeamScore( TEAM_MILITIA )) return TEAM_IMC - else if (GameRules_GetTeamScore(TEAM_MILITIA) > GameRules_GetTeamScore(TEAM_IMC)) + else if (GameRules_GetTeamScore(TEAM_MILITIA) > GameRules_GetTeamScore( TEAM_IMC )) return TEAM_MILITIA return TEAM_UNASSIGNED diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut index 3248d72ef..c8643e429 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut @@ -14,9 +14,9 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage AddTeamScore( attacker.GetTeam(), 1 ) var existingAttackers = [] - foreach(DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory) + foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory ) { - if( attackerInfo.attacker != attacker && !(attackerInfo.attacker in existingAttackers) ) + if( attackerInfo.attacker != attacker && !( attackerInfo.attacker in existingAttackers ) ) attackerInfo.attacker.AddToPlayerGameStat( PGS_ASSISTS, 1 ) } } @@ -29,9 +29,9 @@ void function RateSpawnpoints_Directional( int checkclass, array spawnpo int function CheckScoreForDraw() { - if (GameRules_GetTeamScore(TEAM_IMC) > GameRules_GetTeamScore(TEAM_MILITIA)) + if (GameRules_GetTeamScore(TEAM_IMC) > GameRules_GetTeamScore( TEAM_MILITIA )) return TEAM_IMC - else if (GameRules_GetTeamScore(TEAM_MILITIA) > GameRules_GetTeamScore(TEAM_IMC)) + else if (GameRules_GetTeamScore(TEAM_MILITIA) > GameRules_GetTeamScore( TEAM_IMC )) return TEAM_MILITIA return TEAM_UNASSIGNED -- cgit v1.2.3 From 77d15d4981cb48c8260a981e022c23edf2da562a Mon Sep 17 00:00:00 2001 From: Will Castro <39478251+VITALISED@users.noreply.github.com> Date: Mon, 10 Jan 2022 20:41:54 +1100 Subject: Fix more formatting jesus --- .../mod/scripts/vscripts/gamemodes/_gamemode_ps.nut | 4 ++-- .../mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut index 30dbdd891..b0e2c8cd4 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut @@ -43,9 +43,9 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage int function CheckScoreForDraw() { - if (GameRules_GetTeamScore(TEAM_IMC) > GameRules_GetTeamScore( TEAM_MILITIA )) + if (GameRules_GetTeamScore( TEAM_IMC ) > GameRules_GetTeamScore( TEAM_MILITIA )) return TEAM_IMC - else if (GameRules_GetTeamScore(TEAM_MILITIA) > GameRules_GetTeamScore( TEAM_IMC )) + else if (GameRules_GetTeamScore( TEAM_MILITIA ) > GameRules_GetTeamScore( TEAM_IMC )) return TEAM_MILITIA return TEAM_UNASSIGNED diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut index c8643e429..47094b55c 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut @@ -29,9 +29,9 @@ void function RateSpawnpoints_Directional( int checkclass, array spawnpo int function CheckScoreForDraw() { - if (GameRules_GetTeamScore(TEAM_IMC) > GameRules_GetTeamScore( TEAM_MILITIA )) + if (GameRules_GetTeamScore( TEAM_IMC ) > GameRules_GetTeamScore( TEAM_MILITIA )) return TEAM_IMC - else if (GameRules_GetTeamScore(TEAM_MILITIA) > GameRules_GetTeamScore( TEAM_IMC )) + else if (GameRules_GetTeamScore( TEAM_MILITIA ) > GameRules_GetTeamScore( TEAM_IMC )) return TEAM_MILITIA return TEAM_UNASSIGNED -- cgit v1.2.3 From 9cf6550bd687fc67d7e455341ff14d9b2666699c Mon Sep 17 00:00:00 2001 From: Will Castro <39478251+VITALISED@users.noreply.github.com> Date: Mon, 10 Jan 2022 20:42:38 +1100 Subject: I have changed these 4 lines 3 times, sad --- .../mod/scripts/vscripts/gamemodes/_gamemode_ps.nut | 4 ++-- .../mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut index b0e2c8cd4..cb11618a8 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut @@ -43,9 +43,9 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage int function CheckScoreForDraw() { - if (GameRules_GetTeamScore( TEAM_IMC ) > GameRules_GetTeamScore( TEAM_MILITIA )) + if ( GameRules_GetTeamScore( TEAM_IMC ) > GameRules_GetTeamScore( TEAM_MILITIA ) ) return TEAM_IMC - else if (GameRules_GetTeamScore( TEAM_MILITIA ) > GameRules_GetTeamScore( TEAM_IMC )) + else if ( GameRules_GetTeamScore( TEAM_MILITIA ) > GameRules_GetTeamScore( TEAM_IMC ) ) return TEAM_MILITIA return TEAM_UNASSIGNED diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut index 47094b55c..ae5cb5e6c 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut @@ -29,9 +29,9 @@ void function RateSpawnpoints_Directional( int checkclass, array spawnpo int function CheckScoreForDraw() { - if (GameRules_GetTeamScore( TEAM_IMC ) > GameRules_GetTeamScore( TEAM_MILITIA )) + if ( GameRules_GetTeamScore( TEAM_IMC ) > GameRules_GetTeamScore( TEAM_MILITIA ) ) return TEAM_IMC - else if (GameRules_GetTeamScore( TEAM_MILITIA ) > GameRules_GetTeamScore( TEAM_IMC )) + else if ( GameRules_GetTeamScore( TEAM_MILITIA ) > GameRules_GetTeamScore( TEAM_IMC ) ) return TEAM_MILITIA return TEAM_UNASSIGNED -- cgit v1.2.3 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/gamemodes/_gamemode_ps.nut | 9 ++++++--- .../mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut | 9 ++++++--- .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 10 +++++----- Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut | 8 ++++---- 4 files changed, 21 insertions(+), 15 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut index cb11618a8..9551e1cd0 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 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 ae5cb5e6c..5aab3bf38 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 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/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut index 809c8886d..d3fc4c950 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 19d58a173..40300b116 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 From 1f6c2ce8e7a5a5ba47e773bd6173f228b507e8fd Mon Sep 17 00:00:00 2001 From: Will Castro <39478251+VITALISED@users.noreply.github.com> Date: Sun, 16 Jan 2022 15:00:52 +1100 Subject: Swag fix --- .../mod/scripts/vscripts/gamemodes/_gamemode_ps.nut | 6 ++++-- .../mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut | 14 ++++++++++++-- .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 5 ++++- Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut | 5 +++-- 4 files changed, 23 insertions(+), 7 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut index 9551e1cd0..64a78d355 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 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 5aab3bf38..8699375ad 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 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 spawnpoints, int team, entity player ) 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 d3fc4c950..b169de632 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -284,12 +284,15 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga table alreadyAssisted foreach( DamageHistoryStruct attackerInfo in player.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 Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), player.GetEncodedEHandle(), attackerInfo.time ) AddPlayerScore(attackerInfo.attacker, "PilotAssist" ) } + + } player.p.rematchOrigin = player.p.deathOrigin diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut index 40300b116..887e97cc9 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut @@ -192,9 +192,10 @@ void function ScoreEvent_TitanKilled( entity victim, entity attacker, var damage AddPlayerScore( attacker, "KillTitan", victim.GetTitanSoul().GetOwner() ) table 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 AddPlayerScore(attackerInfo.attacker, "TitanAssist" ) -- cgit v1.2.3