Bug - Fixed After a free rest in Chateau Mantegna, Mafia assumes you have no more free rests

Jeparo

New member
Repro:
1. Have Chateau Mantegna
2. Have some free rests left (install ceiling fan, maybe)
3. Run "rest" in the GCLI
4. Observe 'timesRested' counter tick from 0 to 1, and 1 to your max # of free rests

Code:
[61] Rest in your bed in the Chateau
You gain 202 hit points
You gain 119 Mana Points
You gain 96 Fortitude
You gain a Muscle point!
Preference timesRested changed from 0 to 1
Preference timesRested changed from 1 to 10

I suspect this recent change to chateau logic - https://github.com/kolmafia/kolmafi...788d64468183b9e44d789954232042a5c3062c9b3L116 - perhaps if the action is "chateau_rest" not "chateau_restlabelfree", we update the free-rests counter as though we didn't just take a free rest?
 

katyarn

Member
Had a similar issue today on r26823, however I was able to rest til max rests. I was trying to repeatedly rest until I had reached max rests via:

JavaScript:
while (get("timesRested") < totalFreeRests()) {
    visitUrl("place.php?whichplace=chateau&action=chateau_restlabelfree");
}

Code:
[61] Rest in your bed in the Chateau
You gain 286 hit points
You gain 144 Mana Points
You gain 225 Wizardliness
You gain a Mysticality point!
Preference timesRested changed from 0 to 1

[61] Rest in your bed in the Chateau
You gain 297 hit points
You gain 123 Mana Points
You gain 207 Magicalness
You gain some Mysticality points!
Preference timesRested changed from 1 to 2

...

[61] Rest in your bed in the Chateau
You gain 134 Mana Points
You gain 225 Magicalness
You gain some Mysticality points!
You gain a Level!
Preference timesRested changed from 17 to 18
Preference timesRested changed from 18 to 17

[61] Rest in your bed in the Chateau
Preference timesRested changed from 17 to 18
Preference timesRested changed from 18 to 17

[61] Rest in your bed in the Chateau
Preference timesRested changed from 17 to 18
Preference timesRested changed from 18 to 17

...
 
Last edited:

Veracity

Developer
Staff member
OK. I fixed a bug in 26818 that could have caused the OP’s issue.

I expect I’ll free the king today (after rollover) from my sixth and final Dincore run, so my Chateau will be available again.

I will look into your issue, which is puzzling.

Note that we don’t even look at the specific variant of “action” to determine if the rest was free. You are doing something unexpected. I’d expect “rest free” rather than forcing a particular action.

In any case, after you run out of free rests, attempting to force one via the label fails - exactly as expected .
 

Jeparo

New member
Sorry for not including the version: I've observed this bug[1] on 26814, 26819, and 26823.

[1] specifically this snippet is present in my last three day logs, which were on those respective revisions:
Code:
Preference timesRested changed from 0 to 1
Preference timesRested changed from 1 to 10
 
Last edited:

Jeparo

New member
1665286525001.png

^ I suspect the above change, which I linked to earlier in this thread.

The parameter to updateFreeRests is whether there are free rests remaining, not whether you just took a free rest. Whether you rest with action=chateau_restlabelfree or action=chateau_restbox, I think you still have to check the response text to know if you have free rests remaining, right?

Someone else on Github has pointed to the same PR with the same complaint: https://github.com/kolmafia/kolmafia/pull/1137#issuecomment-1272276889
 

Veracity

Developer
Staff member
Why is that bizarre?

chateau_restbox is what you get if you click on the bed.
It will be either free or not, depending on whether you have free rests.

If you click on the "label" of the image - either "Rest in Bed" or "Rest in Bed (1)" - it is either chateau_restlabelfree or chateau_restlabel.

I would not be surprised if "action=chateau_rest" worked.

Edit: simple enough to test.

Code:
> ashq visit_url("place.php?whichplace=chateau&action=chateau_rest")

[912] Rest in your bed in the Chateau

> ashq visit_url("place.php?whichplace=chateau&action=chateau_restbox")

[912] Rest in your bed in the Chateau
You gain 103 Mojo Points
You gain 111 Roguishness

It does not work.
 
Top