Fix two handed items from bricking hands when a user changes species (#29573)

* create flag to skip species transform reequip

* add to bitfield and change to 1<<15
This commit is contained in:
Toastical
2025-06-19 18:00:39 +00:00
committed by GitHub
parent a8eef567fd
commit b1db0e3b8a
4 changed files with 5 additions and 1 deletions
+1
View File
@@ -14,6 +14,7 @@
#define NODECONSTRUCT (1<<9)
#define EARBANGPROTECT (1<<10)
#define HEADBANGPROTECT (1<<11)
#define SKIP_TRANSFORM_REEQUIP (1<<15) // This flag makes items be skipped when a user transforms species.
#define BLOCK_GAS_SMOKE_EFFECT (1<<12) // blocks the effect that chemical clouds would have on a mob --glasses, mask and helmets ONLY!
#define THICKMATERIAL (1<<12) //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body. (NOTE: flag shared with BLOCK_GAS_SMOKE_EFFECT)
+1
View File
@@ -101,6 +101,7 @@ DEFINE_BITFIELD(flags, list(
"HANDSLOW" = HANDSLOW,
"CONDUCT" = CONDUCT,
"ABSTRACT" = ABSTRACT,
"SKIP_TRANSFORM_REEQUIP" = SKIP_TRANSFORM_REEQUIP,
"ON_BORDER" = ON_BORDER,
"PREVENT_CLICK_UNDER" = PREVENT_CLICK_UNDER,
"NODECONSTRUCT" = NODECONSTRUCT,
+1 -1
View File
@@ -410,7 +410,7 @@
name = "offhand"
icon_state = "offhand"
w_class = WEIGHT_CLASS_HUGE
flags = ABSTRACT | NODROP
flags = ABSTRACT | NODROP | SKIP_TRANSFORM_REEQUIP
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/wielded = FALSE // Off Hand tracking of wielded status
@@ -1185,6 +1185,8 @@
for(var/thing in thing_to_check)
var/obj/item/I = get_item_by_slot(thing)
if(I)
if(I.flags & SKIP_TRANSFORM_REEQUIP)
continue
kept_items[I] = thing
item_flags[I] = I.flags
I.flags = 0 // Temporary set the flags to 0