aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Miller <william-millennium@hotmail.com>2023-10-17 21:41:01 -0300
committerGitHub <noreply@github.com>2023-10-18 02:41:01 +0200
commitaa79ad4b924d838904169b4e251c27c5f09557db (patch)
treebf740da29a7c03ebef17979c0791cade30ba84c3
parentbc4e4263e714f9b1eff58f2c39bb714a3564b2e6 (diff)
downloadNorthstarMods-aa79ad4b924d838904169b4e251c27c5f09557db.tar.gz
NorthstarMods-aa79ad4b924d838904169b4e251c27c5f09557db.zip
Fix Titan Assist not tracking properly (#744)
Titan Assist medals aren't given to players who assisted damage when someone kills a titan, that is due the fact that Titans stores damage history in their Soul component, not the NPC itself.
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut25
1 files changed, 15 insertions, 10 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
index 0b55e9ff..df7577aa 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
@@ -202,18 +202,23 @@ void function ScoreEvent_TitanKilled( entity victim, entity attacker, var damage
AddPlayerScore( attacker, "KillTitan" )
}
- table<int, bool> alreadyAssisted
- foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
+ entity soul = victim.GetTitanSoul()
+ if ( IsValid( soul ) )
{
- if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim )
- continue
-
- bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
- if( attackerInfo.attacker != attacker && !exists )
+ table<int, bool> alreadyAssisted
+
+ foreach( DamageHistoryStruct attackerInfo in soul.e.recentDamageHistory )
{
- alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
- AddPlayerScore(attackerInfo.attacker, "TitanAssist" )
- Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), victim.GetEncodedEHandle(), attackerInfo.time )
+ if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == soul )
+ continue
+
+ bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
+ if( attackerInfo.attacker != attacker && !exists )
+ {
+ alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
+ AddPlayerScore(attackerInfo.attacker, "TitanAssist" )
+ Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), soul.GetEncodedEHandle(), attackerInfo.time )
+ }
}
}