From 080f68ee8779ade26492b3f7b1be872528dcad8a Mon Sep 17 00:00:00 2001 From: ASpoonPlaysGames <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Tue, 3 May 2022 22:30:30 +0100 Subject: Fixed dice roll only giving one tick (again) (#313) * added second parameter to BurnMeter_GetLimitedRewardCount * fixed some weird shit happening --- .../mod/scripts/vscripts/burnmeter/_burnmeter.gnut | 12 +++++++++--- .../mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut index e2ca9917..056f0313 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut @@ -82,10 +82,16 @@ void function BurnMeter_SetBoostRewardCount( string burnRef, int rewardCount ) file.boostRewardCount[burnRef] <- rewardCount } -int function BurnMeter_GetLimitedRewardCount( entity player ) +int function BurnMeter_GetLimitedRewardCount( entity player, string burnRef = "" ) { - EarnObject earnObject = PlayerEarnMeter_GetReward( player ) - string burnRef = earnObject.ref + // added burnRef as a parameter, used for dice roll + // means we dont call two lots of BurnReward_GetRandom() whilst also being able to give multiple items per dice roll (ticks) + if (burnRef == "") + { + EarnObject earnObject = PlayerEarnMeter_GetReward( player ) + burnRef = earnObject.ref + } + int limit = -1 int rewardCount = 1 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 935dc4d0..a20e7aa0 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 @@ -182,7 +182,7 @@ void function EarnMeterMP_BoostEarned( entity player ) while ( burncard.ref == "burnmeter_random_foil" ) burncard = BurnReward_GetRandom() - for ( int i = 0; i < BurnMeter_GetLimitedRewardCount( player ); i++ ) + for ( int i = 0; i < BurnMeter_GetLimitedRewardCount( player, burncard.ref ); i++ ) BurnMeter_GiveRewardDirect( player, burncard.ref ) PlayerEarnMeter_DisableReward( player ) -- cgit v1.2.3