Skip to content

Commit

Permalink
Merge branch 'main' into fix/remote-mods-display
Browse files Browse the repository at this point in the history
  • Loading branch information
Alystrasz authored Jul 17, 2024
2 parents b448bf1 + 26d649f commit 4e82596
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ void function SetupPlayerMenuChallenges( entity player )

void function SetupChallenges_Threaded( entity player )
{
player.EndSignal( "OnDestroy" )

WaitFrame()

Remote_CallFunction_UI( player, "SCB_SetCompleteMeritState", 0 )
Expand Down
27 changes: 18 additions & 9 deletions Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
Original file line number Diff line number Diff line change
Expand Up @@ -493,23 +493,32 @@ void function HandleKillStats( entity victim, entity attacker, var damageInfo )
// get the player and it's pet titan
entity player
entity playerPetTitan
if ( attacker.IsPlayer() )
entity inflictor = DamageInfo_GetInflictor( damageInfo )

if ( IsValid( inflictor ) )
{
// the player is just the attacker
player = attacker
playerPetTitan = player.GetPetTitan()
if ( inflictor.IsProjectile() && IsValid( inflictor.GetOwner() ) ) // Attackers are always the final entity in the owning hierarchy, projectile owners though migh be a player's NPC minion (i.e Auto-Titans)
attacker = inflictor.GetOwner()

else if ( inflictor.IsNPC() ) // NPCs are bypassed as Attackers if they are owned by players, instead they become just inflictors
attacker = inflictor
}
else if ( attacker.IsTitan() && IsPetTitan( attacker ) )

if ( attacker.IsNPC() )
{
// the attacker is the player's auto titan
if ( !attacker.IsTitan() ) // Normal NPCs case
return

if ( !IsPetTitan( attacker ) ) // NPC Titans case
return

player = attacker.GetTitanSoul().GetBossPlayer()
playerPetTitan = attacker
}
else if ( attacker.IsPlayer() ) // Still checks this because worldspawn might be the attacker
player = attacker
else
{
// attacker could be something like an NPC, or worldspawn
return
}

// check things once, for performance
int damageSource = DamageInfo_GetDamageSourceIdentifier( damageInfo )
Expand Down

0 comments on commit 4e82596

Please sign in to comment.