-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LUA Error: empty queue/time issue #1439
Comments
This seems to be affecting the save from point of load, and the autosave from maybe a minute in. There's no way to continue playing it. |
Is it the original save game from 0.60 with the issue, or did it happen later while playing with 0.62? |
I think the original save is from 2014 so probably yes. Is that an issue? :) |
My question was, did that save have the issue before you ran it in v0.62, or only after playing awhile after? |
Patient is queued for decontamination shower. Health as in the dump is 0 so they were to die. They are using bench, have a walk action to the decontamination room, and a meander and die action in the queue. Upon entering the room the queue changes to only; walk to shower, idle and use object. Whilst on the bench the patient already has self.going_home = true and therefore repeats the issue in #1431 of an empty action queue. This is loading the 0.60 save into master. Note clicking the patient doesn't bring up the UI, whereas other patients it does because CorsixTH/CorsixTH/Lua/entities/patient.lua Lines 69 to 73 in 47b9ed6
I'm not sure on a few other things, like the patient is infected, and diagnosed but hasn't met diagnosis policy, and not all diagnosis rooms yet visited, epidemic counter has counted down, and the announcement is about to come through of epidemic discovery. Not sure if any of these items contributed. |
I'm not sure how to answer that question. I played this specific level about 8 times now with no problems, it's only been this specific time that the issue has happened. If I click to restart the level I don't see it happen. Is that what you wanted to know? :D |
I believe I can replicate circumstances around this. Place bench in front of door ( immediately in front, ie closest that you can place it, facing the door) For now I don't understand the when and how exactly a use object, queue, walk (which is must_happen = true, this could be a 0.60 thing, could be something else that affects it but haven't so far replicated the must_happen in master from a new game) circumstance arises but thats what is needed. Wait til a patient is queued and seated. I just set attributes["health"] to just above the threshold and let it count down, and if needed tweak must_happen, can also call Patient:die as attributes only count down on endDay. Patient receives meander and die actions. Health is at 0. Place doctor in room, patient will leave bench and enter room, meander and die actions are dropped from action queue. Patient then continues to be processed as normal, but comfort stats will not as the die method set going_home to true and tickDay no longer processes. The difference here is that the decontamination shower hits the error as they are supposed to be dying (going_home). Picking up the bench in this case and having the patient move to another bench, you can set going_home to false and call Patient:die and they will die (even with must_happen == true). It's only if the patient is using the bench in front of the door, that causes them to not move on (with the must_happen walk). I was able to replicate in the same save with different rooms/patients on master just not new. |
Think I worked out the circumstances that leads to the must_happen. When the patient is say walking to the room and a check of patient thirst results in the heading to drinks machine, the original walk action is interrupted. That results in the truncation of the current walk, walk to drinks machine, use drinks machine and requeue of the current walk action. The original walk action to the room will have action_walk_start run with action.saved_must_happen = action.must_happen
action.must_happen = true So the must_happen was false to start with (from Room:createEnterAction), but once started will be true. When the drinks machine tasks interrupts the walk its not referring to the saved_must_happen, but must_happen which is now true and the requeue of the walk action to the room copies that. When the QueueAction and the walk to enter room is requeued the walk action specifically uses saved_must_happen, hence if not interrupted by the drinks machine, the queuing gets must_happen = false. Once in the incorrect state and the proximity of the door in the process, the original issue just requeues the patient, even though the patient is 'dead' and should wander off and die. If a patient is one more tile away, logic somewhere allows them to wander off and die instead when they reach the next tile. |
Just making note here that in the PR it was noted there was some code in need of a refactor. I believe I have another issue that could be addressed at the same time with that refactor and documenting it here for the future. Any interrupted walk, like those original ones here will also unexpect the humanoid from the target room. CorsixTH/CorsixTH/Lua/humanoid_actions/walk.lua Lines 90 to 97 in 9de46b7
We probably need to alter the current actions is_entering after requeuing the original entering walk and modifying that if next room check to include an is_entering check. That probably includes some other cases, like already handled with SeekToilets elsewhere. |
Refactor was included in #1565 |
So I have a game where staff are getting stuck in rooms and it's been causing patients to die...like the staff are frozen and they are in the room just waiting. I reloaded and it didn't help so I removed the doctors and placed them back down, didn't change things they acted like they couldn't get to their desk (this one was a GP). So I removed the doc from the room and sent the patient in question to be treated, then reloaded the game just in case. Later on my game stopped responding (everything except UI frozen) and I minimised to see an error in the console window which I will put here, it's probably not related? But I thought I should also mention the issue prior in the off chance it is related...
My gamelog.txt
I have a possible autosave?
https://drive.google.com/file/d/1A5SDkMoXRrvVs6UXSbm4cCziWys3yON9/view?usp=sharing
Save immediately after event (while no one was moving but UI would let me save)
https://drive.google.com/file/d/1DmTIF_p82brNERwveBBslPzBC02_ieiB/view?usp=sharing
The text was updated successfully, but these errors were encountered: