aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2024-01-21 00:20:33 +0000
committerGitHub <noreply@github.com>2024-01-21 01:20:33 +0100
commit7edb0f2e726221d99db56c434ab6757f3428651f (patch)
tree361912c234b4bce2886a79dc8aaa33c6e58fd0c9 /Northstar.CustomServers/mod/scripts
parent0e5bf9e64a861a1027d572cc334fc7696d493d65 (diff)
downloadNorthstarMods-7edb0f2e726221d99db56c434ab6757f3428651f.tar.gz
NorthstarMods-7edb0f2e726221d99db56c434ab6757f3428651f.zip
Prevent client side crash in MFD when marked target dies out of bounds. (#705)v1.22.2-rc1v1.22.1-rc4v1.22.1
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut11
1 files changed, 8 insertions, 3 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut
index 659dbb7a..d36045a6 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut
@@ -188,10 +188,15 @@ void function UpdateMarksForKill( entity victim, entity attacker, var damageInfo
{
if ( victim == GetMarked( victim.GetTeam() ) )
{
- MessageToAll( eEventNotifications.MarkedForDeathKill, null, victim, attacker.GetEncodedEHandle() )
+ // handle suicides. Not sure what the actual message is that vanilla shows for this
+ // but this will prevent crashing for now
+ bool isSuicide = IsSuicide( victim, attacker, DamageInfo_GetDamageSourceIdentifier( damageInfo ) )
+ entity actualAttacker = isSuicide ? victim : attacker
+
+ MessageToAll( eEventNotifications.MarkedForDeathKill, null, victim, actualAttacker.GetEncodedEHandle() )
svGlobal.levelEnt.Signal( "MarkKilled", { mark = victim } )
-
- if ( attacker.IsPlayer() )
+
+ if ( !isSuicide && attacker.IsPlayer() )
attacker.SetPlayerGameStat( PGS_ASSAULT_SCORE, attacker.GetPlayerGameStat( PGS_ASSAULT_SCORE ) + 1 )
}
} \ No newline at end of file