Fix lua hourly update script

Use lua setters instead of reassigning the global so it actually does something
Reverted the time conditionals so that it only updates on the opening/closing hours instead of every hour in between. Why was this change necessary to begin with? It also makes it so it resets all the boxing variables every hour instead of daily (not that it even worked before the setter change anyway)

In practice, this fixes a few things so they work as originally intended:
Boxers will actually rest for 1 day after every 3 fights as originally intended
After every rest, boxers will get progressively stronger and harder to beat as originally intended
This commit is contained in:
noooooo4499
2026-02-09 15:57:51 +02:00
committed by Asdow
parent 41ee01edcd
commit e0d58cb9ec
+10 -12
View File
@@ -10,14 +10,14 @@ local p = 0
function HourlyQuestUpdate()
if (cHour >= 4 or cHour < 20) then
if (cHour == 4) then
SetFactFalse( Facts.FACT_BROTHEL_OPEN )
else
elseif (cHour == 20) then
SetFactTrue( Facts.FACT_BROTHEL_OPEN )
end
-- Bar/night club
if ( cHour >= 15 or cHour < 2) then
if ( cHour == 15 ) then
SetFactTrue( Facts.FACT_CLUB_OPEN )
SetFactFalse( Facts.FACT_PAST_CLUB_CLOSING_AND_PLAYER_WARNED )
@@ -34,24 +34,22 @@ function HourlyQuestUpdate()
if ( gfBoxersResting == true ) then
-- Done resting now!
gfBoxersResting = false
gubBoxersRests = gubBoxersRests + 1
SetgfBoxersResting(false)
SetgubBoxersRests(gubBoxersRests + 1)
p = gubBoxingMatchesWon / 3
elseif ( p > gubBoxersRests ) then
elseif ( gubBoxingMatchesWon / 3 > gubBoxersRests ) then
-- Time for the boxers to rest!
gfBoxersResting = true
SetgfBoxersResting(true)
end
else
elseif ( cHour == 2 ) then
SetFactFalse( Facts.FACT_CLUB_OPEN )
end
-- Museum
if ( cHour >= 9 or cHour < 18 ) then
if ( cHour == 9 ) then
SetFactTrue( Facts.FACT_MUSEUM_OPEN )
else
elseif ( cHour == 18 ) then
SetFactFalse( Facts.FACT_MUSEUM_OPEN )
end