aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-17 21:53:06 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-17 21:53:06 +0000
commit7cac56cb9bcaabed9562a7b46718f5c5de3400b8 (patch)
tree5602ee1282509d028d8e4a76bd035cc2996b9f33 /Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut
parent06924c215dcf8d4dd425cbbf178509bc222c2f7d (diff)
downloadNorthstarMods-7cac56cb9bcaabed9562a7b46718f5c5de3400b8.tar.gz
NorthstarMods-7cac56cb9bcaabed9562a7b46718f5c5de3400b8.zip
wargames intro and many fixes
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut5
1 files changed, 3 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut
index 0be171d1..6db3b9a7 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_xp.gnut
@@ -38,8 +38,9 @@ void function HandleXPGainForScoreEvent( entity player, ScoreEvent event )
xpValue = weaponXp
else if ( xpValue < titanXp )
xpValue = titanXp
-
- if ( ShouldTrackXPForWeapon( player.GetActiveWeapon().GetWeaponClassName() ) )
+
+ entity weapon = player.GetActiveWeapon()
+ if ( IsValid( weapon ) && ShouldTrackXPForWeapon( weapon.GetWeaponClassName() ) )
AddWeaponXP( player, xpValue )
// if we specifically gain titan xp, then give titan xp no matter what, otherwise only give it when we're in a titan