Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Patient getting stuck inside a room #1401
Patients get stuck in any room, this output is from trying to edit a Pharmacy with a stuck patient in it, the lua and the game get broken afterwards since clicking doesn't work anymore:
My guess is the patient might be vomiting inside the room or something like that, because a handyman remains stuck outside the room trying to enter, even if there is no plant or machinery inside the room, but the litter might be removed from other parts of the code causing a bug where the targeted litter is now null, not sure. Of course, the patient can move around in the room, but he can't leave or die, compromising the room.
CorsixTH Version: 0.61
Operating System: Windows 7
Theme Hospital Version: Origin
Same or maybe another bug related to this issue: it seems that in some rare conditions a patient is invited to leave the room and requeue, like when a doctor or nurse is too tired and wants to go to the staff room, but the Room:createLeaveAction seems to be interruptible in some special cases, in walk.lua at line 64!
So a patient tries to leave the room, that action is somehow interrupted, and then the patient ends up trying to requeue while still inside the room, which is not covered by a case, therefore the patient gets stuck waiting for Christmas and getting the whole room stuck with them.
My quick fix for now is to comment out ":truncateOnHighPriority()" on line 89 in function Room:createLeaveAction found in the room.lua file. I don't see a reason why the leave action should be interruptible as it only invites to create hidden bugs, I think someone was overzelous about it.
Just took a look at this one and it appears the same issue as #1081. A despawned patient has the lock on the door. then it would appear that the rest comes from the edit room attempt/leave action, leaving the nurse trying to go to staff room, patient trying to walk to the next nearest pharmacy etc.
And then there is litter somehow in the room at 68,30 which appears to come about due to some sequence of events that has allowed the patient to appear not in a room, ie Room:onHumanoidLeave called for the patient, but then unable to leave, maybe due to the truncate.
The reason the litter removal fails is due to a bug in the call to the remove method. Though I think litter in room (pee/poop too) would not be normal and the code that was changed was probably to support older releases where at the time, you just built over with no removal.