From 1714d2d329bef4f970715b12133d1d676b7046ac Mon Sep 17 00:00:00 2001 From: DBmaoha <56738369+DBmaoha@users.noreply.github.com> Date: Sat, 22 Oct 2022 02:51:48 +0800 Subject: Fixed EarnMeter OverDrive not reset after player died (#486) --- .../mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut index dda84976..b4e77375 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut @@ -315,12 +315,12 @@ void function PlayerEarnMeter_Empty( entity player ) PlayerEarnMeter_SetRewardFrac( player, 0.0 ) } - void function EarnMeterDecayThink( entity player ) { player.EndSignal( "OnDeath" ) player.Signal( "EarnMeterDecayThink" ) player.EndSignal( "EarnMeterDecayThink" ) + thread OverDriveClearOnDeath( player ) if ( EarnMeter_DecayHold() < 0 ) return @@ -348,6 +348,12 @@ void function EarnMeterDecayThink( entity player ) } } +void function OverDriveClearOnDeath( entity player ) +{ + player.EndSignal( "OnDestroy" ) + player.WaitSignal( "OnDeath" ) + PlayerEarnMeter_SetEarnedFrac( player, PlayerEarnMeter_GetOwnedFrac( player ) ) +} bool function PlayerEarnMeter_TryMakeGoalAvailable( entity player ) { -- cgit v1.2.3