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
Operating theatre with exhausted but not leaving surgeon errors when patient enters - Not enough staff in operating theatre #1012
Describe the issue
Woman enters operating theatre unless exhausted surgeon is manually moved
Steps to Reproduce
Exhausted surgeon leaves
This savegame was started, and this error happened on, unedited code but in between some changes in other areas have been experimented with.
changed the title from
Operating theatre with exhausted but not leaving surgeon crashes when patient enters, error - Not enough staff in operating theatre
Operating theatre with exhausted but not leaving surgeon errors when patient enters - Not enough staff in operating theatre
Mar 27, 2016
From what I can gather there is a race for the door with the arriving and leaving surgeon. Arriving gets there first and enters the room, never gowns up. The leaving surgeon has enqueued an immediate walk action in the room, circles back to the door and leaves. The state just so happens to allow a patient to enter.
For demonstration purposes as it's not the right way to go about it, replace humanoid:isLeaving() with humanoid:hasLeaveAction() will have the surgeon gown up, but no patients arrive. This is because hasLeaveAction() picks up the, walk/use_screen action for when the surgeon does actually leave and blocks further tests of Room:staffFitsInRoom(staff) from being effective.
As hasLeaveAction() isn't an option, I though maybe adding in a check for just going_to_staffroom instead would be sufficient
This appears to work around this issue, but again, I don't quite know enough to ascertain if that is the case or best option.