Wednesday, August 18, 2021

Bug - Immunity From Wound Infections

 



Update:  Build 41.71 fixes this bug!

Hey, I think I found a bug!  Details are in the 7 minute video, but here are the basics:

Disinfecting a body part once prevents wounds from ever infecting that body part.  That would be a bug.

When you disinfect a body part (to tend to a wound), it sets an alcohol level on that part.

function ISDisinfect:perform()
    -- needed to remove from queue / start next.
    ISBaseTimedAction.perform(self);
    self.bodyPart:setAlcoholLevel(self.bodyPart:getAlcoholLevel() + self.alcohol:getAlcoholPower());

AlcoholLevel is set in a few places in the code: When you disinfect, on initialization, and when to fully restore health (or God mode).

I found only one place in the code where AlcoholLevel is reduced, in BodyPart.class:

        } else if (this.isInfectedWound()) {
            boolean bl = false;
            if (this.getAlcoholLevel() > 0.0f) {
                this.setAlcoholLevel(this.getAlcoholLevel() - 2.0E-4f * GameTime.getInstance().getMultiplier());
                this.setWoundInfectionLevel(this.getWoundInfectionLevel() - 2.0E-4f * GameTime.getInstance().getMultiplier());
                if (this.getAlcoholLevel() < 0.0f) {
                    this.setAlcoholLevel(0.0f);
                }
                bl = true;
            }


That only applies to infected wounds.  If you put alcohol on an infected wound it will help you recover from the infection more quickly. 

In order a wound to become infected, it must get past this conditional:

        if (!this.isInfectedWound() && !this.IsInfected && !this.alcoholicBandage && this.getAlcoholLevel() <= 0.0f && (this.getDeepWoundTime() > 0.0f || this.getScratchTime() > 0.0f || this.getCutTime() > 0.0f || this.getStitchTime() > 0.0f)) {

The AlcoholLevel has to be 0 in order for your wound to get infected.  But since alcohol level doesn't go down, that body part can't get infected once you've disinfected it.

You may also notice that if you have an alcoholic bandage you also can't get infected.  Alcoholic bandages are bandages sterilized by either HOT water or alcohol/disinfectant, and the life of those bandages actually does go down.

Not that it really matters - infected wounds only have minor consequences.  But that's a discussion for another time.


If you see a mistake in what I've posted or have any questions you'd like me to tackle, please let me know!

No comments:

Post a Comment

Do Gloves Protect You From Broken Glass?

Yes, gloves protect you from handling broken glass - any pair of gloves.  But gloves are not needed when removing broken glass from a smashe...