Removes persistence of items through changing species when not allowed to (#70008)

* Removes persistence of species-restricted items through changing

Makes use of item's mob_can_equip instead of mob's can_equip, making it take the item's restrictions into account.

Also, fixes the inventory's color, so it's properly red when you can't equip such an item, by making it also use mob_can_equip.

Finally, expands the species clothing unit test to take that into account, to prevent it breaking in the future.
This commit is contained in:
John Willard
2022-09-21 10:32:33 -07:00
committed by GitHub
parent 1f4e8eaab8
commit a0442ee002
9 changed files with 32 additions and 32 deletions
+2 -14
View File
@@ -225,13 +225,7 @@
if (!ismob(source))
return FALSE
if (!equipping.mob_can_equip(
source,
user,
item_slot,
disable_warning = TRUE,
bypass_equip_delay_self = TRUE,
))
if (!equipping.mob_can_equip(source, item_slot, disable_warning = TRUE, bypass_equip_delay_self = TRUE))
to_chat(user, span_warning("\The [equipping] doesn't fit in that place!"))
return FALSE
@@ -248,13 +242,7 @@
if (!do_mob(user, source, get_equip_delay(equipping)))
return FALSE
if (!equipping.mob_can_equip(
source,
user,
item_slot,
disable_warning = TRUE,
bypass_equip_delay_self = TRUE,
))
if (!equipping.mob_can_equip(source, item_slot, disable_warning = TRUE, bypass_equip_delay_self = TRUE))
return FALSE
if (!user.temporarilyRemoveItemFromInventory(equipping))