aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/earn_meter
diff options
context:
space:
mode:
authorDinorush <62536724+Dinorush@users.noreply.github.com>2022-01-26 02:51:05 -0500
committerBarichello <artur@barichello.me>2022-01-26 20:56:34 -0300
commit0da60a2aab64cf83f08b38c1a6ab9b20d0283fa5 (patch)
tree4f83e85c7afecdda68c5eb01e271a8067f6a2413 /Northstar.CustomServers/mod/scripts/vscripts/earn_meter
parent644b4756281eaa29d7c9c35471f25fc3283e1288 (diff)
downloadNorthstarMods-0da60a2aab64cf83f08b38c1a6ab9b20d0283fa5.tar.gz
NorthstarMods-0da60a2aab64cf83f08b38c1a6ab9b20d0283fa5.zip
Fix to invalid earnObject id on titan death
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/earn_meter')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut6
1 files changed, 4 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut
index 91f17a66..33e380d5 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut
@@ -74,6 +74,8 @@ void function OnPlayerRespawned( entity player )
void function EarnMeterMP_ReplaceReward( entity player, EarnObject reward, float rewardFrac )
{
PlayerEarnMeter_Reset( player )
+ if ( reward.id < 0 ) // Don't set the reward if it is nonexistent
+ return
PlayerEarnMeter_SetReward( player, reward )
PlayerEarnMeter_SetRewardFrac( player, rewardFrac )
@@ -86,8 +88,8 @@ void function EarnMeterMP_PlayerLifeThink( entity player )
player.EndSignal( "OnDeath" )
player.EndSignal( "OnDestroy" )
- EarnObject pilotReward
- float pilotRewardFrac
+ EarnObject pilotReward = PlayerEarnMeter_GetReward( player )
+ float pilotRewardFrac = PlayerEarnMeter_GetRewardFrac( player )
int lastEarnMeterMode = PlayerEarnMeter_GetMode( player )
float lastPassiveGainTime = Time()