mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user