Fixes strippanel stuff. (#48937)

* Fixes strippanel stuff.

* Cleanup
This commit is contained in:
AnturK
2020-01-23 12:52:35 +13:00
committed by oranges
parent d3ad08caba
commit 873c0a7765
2 changed files with 23 additions and 25 deletions
@@ -237,7 +237,7 @@
return
if(href_list["pockets"] && usr.canUseTopic(src, BE_CLOSE, NO_DEXTERITY)) //TODO: Make it match (or intergrate it into) strippanel so you get 'item cannot fit here' warnings if mob_can_equip fails
var/pocket_side = href_list["pockets"]
var/pocket_side = href_list["pockets"] != "right" ? "left" : "right"
var/pocket_id = (pocket_side == "right" ? ITEM_SLOT_RPOCKET : ITEM_SLOT_LPOCKET)
var/obj/item/pocket_item = (pocket_id == ITEM_SLOT_RPOCKET ? r_store : l_store)
var/obj/item/place_item = usr.get_active_held_item() // Item to place in the pocket, if it's empty
+22 -24
View File
@@ -604,36 +604,34 @@
* * handles the strip panel equip and unequip as well if "item" sent
*/
/mob/Topic(href, href_list)
var/mob/user = usr
if(href_list["mach_close"])
var/t1 = text("window=[href_list["mach_close"]]")
unset_machine()
src << browse(null, t1)
if(href_list["refresh"])
if(machine && in_range(src, usr))
show_inv(machine)
if(user != src)
if(href_list["item"] && user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY))
var/slot = text2num(href_list["item"])
var/hand_index = text2num(href_list["hand_index"])
var/obj/item/what
if(hand_index)
what = get_item_for_held_index(hand_index)
slot = list(slot,hand_index)
else
what = get_item_by_slot(slot)
if(what)
if(!(what.item_flags & ABSTRACT))
user.stripPanelUnequip(what,src,slot)
else
user.stripPanelEquip(what,src,slot)
if(href_list["item"] && usr.canUseTopic(src, BE_CLOSE, NO_DEXTERITY))
var/slot = text2num(href_list["item"])
var/hand_index = text2num(href_list["hand_index"])
var/obj/item/what
if(hand_index)
what = get_item_for_held_index(hand_index)
slot = list(slot,hand_index)
else
what = get_item_by_slot(slot)
if(what)
if(!(what.item_flags & ABSTRACT))
usr.stripPanelUnequip(what,src,slot)
else
usr.stripPanelEquip(what,src,slot)
if(usr.machine == src)
if(Adjacent(usr))
show_inv(usr)
else
usr << browse(null,"window=mob[REF(src)]")
if(user.machine == src)
if(Adjacent(user))
show_inv(user)
else
user << browse(null,"window=mob[REF(src)]")
// The src mob is trying to strip an item from someone
// Defined in living.dm