Skip to content
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

Possible incompatibility with armor boosting implants at large (happens with Cybernetic Organism and Neural Network, [RH] Faction: UAC and even Royalty DLC) #17

Closed
randompartyhero opened this issue Jul 13, 2020 · 10 comments
Labels

Comments

@randompartyhero
Copy link

randompartyhero commented Jul 13, 2020

I managed to narrow it down to this mod

Any pawn with implants from said mod gets stuck in a diagnosing loop - no reatomizing happens, just diagnosing/100% clear. Removing the implants finally allowed the colonist to be treated by the pod.

Mod link: https://steamcommunity.com/sharedfiles/filedetails/?id=2130954176

Edit: Curiously, some implants from the mod work with the MedPod. Colonist with implants that only increase the stats like sight, consciousness, tame chance and so on work. But the one that apart from the base stats also gives a buff to armor (i.e. sharp, blunt, heat) causes the loop. I also found the issue present with the armor boosting implants from the Cybernetic Organism and Neural Network (dermaplating and exoskeleton specifically).

Okay, issue is definitely connected to parts that boost armor resistance in general. I just installed the armorskin gland from the Royalty DLC and the loop happens. Removing it from the pawn makes the pod do its magic again. The pawn had multiple implants from different mods but the Armorskin was the only one boosting armor.

@randompartyhero randompartyhero changed the title Incompatibility with [RH] Faction: UAC Possible incompatibility with armor boosting implants at large Jul 13, 2020
@randompartyhero randompartyhero changed the title Possible incompatibility with armor boosting implants at large Possible incompatibility with armor boosting implants at large (happens with Cybernetic Organism and Neural Network, [RH] Faction: UAC and even Royalty DLC) Jul 13, 2020
@sumghai
Copy link
Owner

sumghai commented Jul 14, 2020

Thanks for getting back to me - this is very peculiar. I'll look into this when I have the time.

@sumghai
Copy link
Owner

sumghai commented Jul 18, 2020

@randompartyhero @DJNokem - I think I've figured out the root cause of the problem (as well as how to fix it).

Currently, the MedPod has a bit of code that checks to see if an implanted/prosthetic body part has any child parts, and then ignores them - this prevents the MedPod from, for example, healing the hands and fingers of an arm that has already been entirely replaced with an bionic arm.

Now, this is all fine and dandy, but if the implant belongs to the Torso, then the MedPod ignores everything below that, which practically means the MedPod now has an empty treatment plan, but other bits of code keep telling the patient to stay in the MedPod to receive (non-existent) treatment.

And the kicker is that the Royalty Death Acidifier, Armor Glands and the UAC implants in question are all Torso implants.

The solution is to basically skip checking Torso implants, which allows other body parts to be treated again.

I have a dev build with a working fix, but I'm waiting for feedback on my other FPS/lag fix before I can upload all the fixes into this repo.

@MerGatto
Copy link
Contributor

I also ran into this problem today and dug around in the code a little.
Is there any particular reason why you also skip children from implants and not just added parts?
If I understand it correctly hands wouldn't be treated if the arm has a muscle stimulator for example (from EPOE mod).

Only excluding children from Added parts would probably fix the torso problem as well.

@sumghai
Copy link
Owner

sumghai commented Jul 20, 2020

@MerGatto - As I already mentioned:

this prevents the MedPod from, for example, healing the hands and fingers of an arm that has already been entirely replaced with an bionic arm.

And no, only excluding children from Added parts would not haved fixed the problem, as that was what caused it the the first place.

@sumghai
Copy link
Owner

sumghai commented Jul 22, 2020

@randompartyhero @gogochlwns @DJNokem @LastXsile @MerGatto

Please test the following development build, which contains a fix that ignores the child part checks for Torsos with implants, and should prevent pawns lying in MedPods getting stuck in the diagnosis loop:

https://github.com/sumghai/MedPod/archive/21de9991a4a422fe86c22fcfc3ccc99e29981d30.zip

If you guys can get back to me ASAP, I'll formally publish a new release this weekend.

@MerGatto
Copy link
Contributor

Problem seems to be fixed for torsos.
However I was still able to trigger an infinite diagnosis loop by damaging the fingers of an arm with implants (not replacements), like for example the Muscle stimulator from EPOE mod

@MerGatto
Copy link
Contributor

MerGatto commented Jul 22, 2020

@MerGatto - As I already mentioned:

this prevents the MedPod from, for example, healing the hands and fingers of an arm that has already been entirely replaced with an bionic arm.

And no, only excluding children from Added parts would not haved fixed the problem, as that was what caused it the the first place.

Hediff_AddedParts cause child parts to be removed.
Hediff_Implants do not however.
This is vanilla behavior, the PostAdd method from the Hediff_AddedParts class adds the MissingPart Hediffs to the children.

Can you give me an example where it would cause problems to try and treat children of Body parts with Hediff_Implants?

I compiled a version of MedPod locally where I don't add children of Hediff_Implants to the ignore list. I didn't run into any issues..

@DJNokem
Copy link

DJNokem commented Jul 22, 2020

The update has fixed the torso issue for me. I've not run into any other problems but I don't a large number of mods. Thanks.

@LastXsile
Copy link

LastXsile commented Jul 23, 2020 via email

@sumghai
Copy link
Owner

sumghai commented Jul 23, 2020

@LastXsile - Please open a separate issue for that.

I've just approved some additional tweaks and optimizations courtesy of @MerGatto, so I think I can safely say we're done here.

@sumghai sumghai closed this as completed Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants