GregTechCEu / GregTech-Modern

GregTech CE Unofficial for modern versions
GNU Lesser General Public License v3.0
237 stars 129 forks source link

Dying to Carcinogen while wearing Protection armor breaks your character's health #1522

Open iwishforducks opened 1 week ago

iwishforducks commented 1 week ago

Checked for existing issues

Tested latest version

GregTech CEu Version

1.3.0-a

Recipe Viewer Installed

JEI

Environment

Singleplayer

Cross-Mod Interaction

Unsure

Other Installed Mods

ATM Gravitas2

Expected Behavior

When carrying radioactive materials and reaching max stage Carcinogen, you should outright die.

Actual Behavior

However, if you're wearing any kind of Protective armor, your character health is instead set to NaNf, causing you to be permanently bricked until you edit your health in an external program.

Steps to Reproduce

  1. Equip some protective armor (Unsure if it has to be armor in general or specifically enchanted Protection armor?)
  2. Carry loads of radioactive material
  3. Wait until you reach max stage of Carcinogen

Additional Information

This is the line responsible for the DEATH symptom:

public static final Symptom DEATH = new Symptom(defaultKey("death"), 1, 1,
  ((medicalConditionTracker, condition, configuredSymptom, baseSymptom, modifier) -> {
    if (modifier > 0) {
      Player player = medicalConditionTracker.getPlayer();
      player.hurt(condition.getDamageSource(medicalConditionTracker), Float.MAX_VALUE);
    }
  }));

I believe this is caused by the fact that it's hurting the player by infinity, and then getting divided due to armor calculations somewhere along the line, causing a division error.

Note that ATM Gravitas2 has TerrafirmaCraft. I'm unsure if this is TFC specific or not, since I think TFC changes the way health works internally?

screret commented 6 days ago

that's the same thing /kill does internally so to me it sounds like a TFC issue and that they patched /kill to work again

iwishforducks commented 5 days ago

that's the same thing /kill does internally so to me it sounds like a TFC issue and that they patched /kill to work again

Just tested and it is indeed a TFC thing, or perhaps something in the modpack. Should I put up an issue on TFC's github?