Tearing down a building with workers inside, and clicking demolish twice
Demolishing sounds like deleting an object, but there are people inside, a refund to pay and an impatient player who clicks twice. This entry gives the order in which things must happen so nobody is lost and nothing is paid twice.
Why this works
Removing something that has people and money attached is a short process with steps, not a single deletion. Each consequence, like sending the people away and paying the refund, must happen exactly once, and only when its moment really arrives.
When not to use it
Skip the waiting time when tearing down should be instant, such as clearing a decoration or a fence with nobody inside. Remove it right away, and keep the careful steps for buildings that hold workers or give back money.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 26 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Tearing down a building with workers inside, and clicking demolish twice" (read_entry demolish-with-workers-and-single-refund) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP