From 306f2f0da62e7674a82a30f451a9f222c39ea066 Mon Sep 17 00:00:00 2001
From: ArcaneDefence <51932756+ArcaneDefence@users.noreply.github.com>
Date: Thu, 24 Dec 2020 02:00:36 -0700
Subject: [PATCH] No more original moth wings being set to none (#55672)
Moths that drink a potion of flight have their moth wings set to none, which their handle fire would store as their original, and that would be applied from reconstructive surgery.
Now potions of flight store an original, and handle fire checks to see if something was stored before, so it doesn't overwrite that.
---
code/modules/mining/lavaland/necropolis_chests.dm | 4 ++++
.../mob/living/carbon/human/species_types/mothmen.dm | 6 ++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm
index 97342b60bf3..badefa066a8 100644
--- a/code/modules/mining/lavaland/necropolis_chests.dm
+++ b/code/modules/mining/lavaland/necropolis_chests.dm
@@ -609,7 +609,11 @@
return
if(exposed_carbon.dna.species.has_innate_wings)
to_chat(exposed_carbon, "A terrible pain travels down your back as your wings change shape!")
+ if(!exposed_carbon.dna.features["original_moth_wings"]) //Stores their wings for later possible reconstruction
+ exposed_carbon.dna.features["original_moth_wings"] = exposed_carbon.dna.features["moth_wings"]
exposed_carbon.dna.features["moth_wings"] = "None"
+ if(!exposed_carbon.dna.features["original_moth_antennae"]) //Stores their antennae type as well
+ exposed_carbon.dna.features["original_moth_antennae"] = exposed_carbon.dna.features["moth_antennae"]
exposed_carbon.dna.features["moth_antennae"] = "Regal"
else
to_chat(exposed_carbon, "A terrible pain travels down your back as wings burst out!")
diff --git a/code/modules/mob/living/carbon/human/species_types/mothmen.dm b/code/modules/mob/living/carbon/human/species_types/mothmen.dm
index ef18bfa4184..6a916852287 100644
--- a/code/modules/mob/living/carbon/human/species_types/mothmen.dm
+++ b/code/modules/mob/living/carbon/human/species_types/mothmen.dm
@@ -43,9 +43,11 @@
return
if(H.dna.features["moth_wings"] != "Burnt Off" && H.bodytemperature >= 800 && H.fire_stacks > 0) //do not go into the extremely hot light. you will not survive
to_chat(H, "Your precious wings burn to a crisp!")
- H.dna.features["original_moth_wings"] = H.dna.features["moth_wings"] //Fire apparently destroys DNA, so let's preserve that elsewhere
+ if(!H.dna.features["original_moth_wings"]) //Fire apparently destroys DNA, so let's preserve that elsewhere, checks if an original was already stored to prevent bugs
+ H.dna.features["original_moth_wings"] = H.dna.features["moth_wings"]
H.dna.features["moth_wings"] = "Burnt Off"
- H.dna.features["original_moth_antennae"] = H.dna.features["moth_antennae"]
+ if(!H.dna.features["original_moth_antennae"]) //Stores antennae type for if they get restored later
+ H.dna.features["original_moth_antennae"] = H.dna.features["moth_antennae"]
H.dna.features["moth_antennae"] = "Burnt Off"
if(flying_species) //This is all exclusive to if the person has the effects of a potion of flight
if(H.movement_type & FLYING)