Comments (7)
This sounds bizarre.
The MedPod is designed so that if it runs out of power, is destroyed or otherwise despawned while treating a patient, the patient should immediately be given an (improper) cortical stimulation to wake them up.
As for why the delta-wave induced coma is currently "permanent", this is because I needed a way to keep the patient lying in the MedPod for a whole treatment cycle, as usually with vanilla hospital beds it is possible that a patient partially recovers to the point of regaining the ability to walk, run off to deal with food/other needs, and (maybe) return later to fully recover.
I am thinking of possibly tweaking the delta-wave coma to expire after a period of time, although if it expires while there are still hediffs remaining to be treated, the treatment will get interrupted when the pawn runs off.
Since you mentioned that you're not "100% sure of how this happened, as part of this was off-screen", please go back and try to reproduce this situation in detail, so that I know to start investigating this issue.
from medpod.
I removed a bionic part from a colonist, removed all other hospital beds so she was put in the medpod to recover. I then had a colonist turn the machine off, and carry her to a new hospital bed. She still had the coma after this. Gif of the mentioned steps here: https://imgur.com/a/Rj58cBw
from medpod.
Bug confirmed - this looks like an extremely bizarre edge case.
Detailed Investigation
Setup
- Dev mode
- 6x8 cell single-walled wooden building
- 1 Door, locked
- 1 MedPod
- 1 Battery, filled via Dev Mode
- 2 pawns (Kensuke = doctor, Mari, patient)
Scenario 1
- Mari damaged until downed via Dev mode
- Kensuke hauls Mari to MedPod
- Battery emptied via Dev Mode during diagnosis mode
- Result: Mari falls off the depowered MedPod, with no additional hediffs applied
Scenario 2
- Mari damaged until downed via Dev mode
- Kensuke hauls Mari to MedPod
- Battery emptied via Dev Mode during treatment mode
- Result: Mari falls off the depowered MedPod, with the Cortical Stimulation (improper) hediff applied, which cancels out the Delta Wave Induced Coma hediff
Scenario 3
- Mari damaged until downed via Dev mode
- Kensuke hauls Mari to MedPod
- MedPod destroyed via Dev Mode during diagnosis mode
- Result: Mari falls off the non-existent MedPod, with no additional hediffs applied
Scenario 4
- Mari damaged until downed via Dev mode
- Kensuke hauls Mari to MedPod
- MedPod destroyed via Dev Mode during treatment mode
- Result: Mari falls off the non-existent MedPod, with the Cortical Stimulation (improper) hediff applied, which cancels out the Delta Wave Induced Coma hediff
Scenario 5
- Mari damaged until downed via Dev mode
- Kensuke hauls Mari to MedPod
- Kensuke forced to switch off MedPod during diagnostic mode, via Designate Toggle Power gizmo and Float Menu
- Result: Mari falls off the MedPod before it is fully depowered, with no additional hediffs applied
Scenario 6
- Mari damaged until downed via Dev mode
- Kensuke hauls Mari to MedPod
- Kensuke forced to switch off MedPod during treatment mode, via Designate Toggle Power gizmo and Float Menu
- Result: Mari falls off the MedPod before it is fully depowered, with the Delta Wave Induced Coma hediff still present
Basically, the current code correctly handles situations where the MedPod loses power or is destroyed, by waking the patient up and cancelling out the Delta Wave Induced Coma.
When the Designate Toggle Power gizmo is set to Off, the task for switching off the MedPod is actually given to the patient lying on it. Usually, no other pawn approaches the MedPod until it has finished treating the patient, then the (ex) patient gets off and switches off the MedPod themselves.
If, however, for some bizarre reason the player decides to forcefully tell another pawn to switch off a MedPod while in treatment mode, the patient loses their reservation on the MedPod, falls off and does not get their Delta Wave Induced Coma removed.
Some ways to solve this problem:
-
Have the Delta Wave Induced Coma eventually expire: This is a quick and dirty fix, but if the coma expires before treatment is completed, the patient may get off the MedPod without being fully healed (the coma was specifically designed to keep the patient still during treatment). This problem would be even more apparent with certain players modifying bootleg versions of the MedPod to have longer treatment times for [alleged] balance reasons.
-
Prevent the MedPod from being toggled off, period: Another quick and dirty fix, since it completely prevents the situation from happening in the first place. However, players may want the flexibility to power down MedPods to conserve power in emergency situations.
-
Prevent the MedPod from being toggled off, but only while it is running: This seems to be a particularly elegant solution, although I have yet to assess its robustness.
-
Apply the Cortical Stimulation (Improper) hediff to the patient the moment a pawn is forced to switch off the MedPod: This doesn't quite make sense from a Watsonian perspective. How could a MedPod have the prescience that it's about to get switched off, and thus respond by waking up and kicking off it's patient?
from medpod.
Right, so I've found yet another edge case that triggers this bug:
- A MedPod is operating in treatment mode, with Patient A under a Delta Wave Induced Coma
- The player selects Patient B, right clicks on the MedPod and selected Rest Until Healed (with a warning that the MedPod is already occupied by Patient A)
- Patient A gets kicked off the MedPod, and is stuck with the Delta Wave Induced Coma
This is a more plausible situation, because perhaps the player wants to perform triage by prioritizing a critically-wounded patient over someone with a hangnail who just happened to get on the MedPod first.
To handle this particular edge case, I will need to detect when the current patient is kicked off the MedPod, and apply the improper Cortical Stimulation hediff instead to wake them up.
from medpod.
@CodePanter - Please try the following development build, and see if it fixes both edge cases:
https://github.com/sumghai/MedPod/archive/d1460a96aa99c86c87fa1f0a48c1f9d4d009afa9.zip
from medpod.
I tried all situations I could come up with, including some you didn't mention like using a medpod on a prisoner, and then toggling the 'for prisoner' setting, and everything seems to work perfectly fine. Thank you for fixing this!
from medpod.
Good catch on the prisoner toggle use cases as well, thanks!
Marking this one as done.
from medpod.
Related Issues (20)
- Error in main menu when Vanilla Expanded Cooking mod is enabled HOT 2
- Babies from Biotech DLC stuck in a treatment loop on MedPods HOT 6
- Sanguophage from biotech DLC carried to medpod when deathresting HOT 1
- MedPod appears to be stuck. HOT 2
- EPOE optimizing nanobots causing infinite loop HOT 4
- Pawns with prosthetic arms / legs stuck in treatment loop HOT 3
- XML Verse.HediffDef defines the same field twice: isBad. HOT 3
- vet pod stuck in idle HOT 1
- More difficulty setting HOT 1
- Pawns drop sidearms when anesthetized and uses MedPod HOT 4
- My guests or rescued people leave immediately when colonists put them inside HOT 2
- Vetpods are not treated as valid animal beds to rescue to HOT 4
- Mod Settings to change what health conditions are cured by MedPod HOT 1
- Integration with Prison Labor HOT 3
- MedPod and Diseases+ compatibility HOT 3
- No More Riceworld Incompatibility HOT 2
- Pawns anesthetized after surgery drop weapons when carried to MedPods HOT 2
- Unable to arrest the temporary colonists from creepjoiner event if they're holding a weapon HOT 3
- the mod does to good of a job for keeping pawns around HOT 1
- Patch for [DN] Bundle Of Traits no longer required in RimWorld 1.5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from medpod.