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') 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 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 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 d3fc4c95..b169de63 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 40300b11..887e97cc 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