Improves dumping of "quick" containers

Allows all "quick" containers to be dumped into a disposal (click) or
onto a table (drag-drop).
This commit is contained in:
Krausus
2015-05-08 07:20:44 -04:00
parent e7c1cf8eb3
commit d8e6893e35
2 changed files with 20 additions and 16 deletions
@@ -38,6 +38,18 @@
show_to(M)
return
if((allow_quick_empty || allow_quick_gather) && istype(over_object, /obj/structure/table) \
&& contents.len && over_object.Adjacent(usr))
var/turf/T = get_turf(over_object)
hide_from(usr)
usr.face_atom(src)
usr.visible_message("<span class='notice'>[usr] empties \the [src] onto \the [over_object].</span>",
"<span class='notice'>You empty \the [src] onto \the [over_object].</span>")
for(var/obj/item/I in contents)
remove_from_storage(I, T)
update_icon() // For content-sensitive icons
return
if (!( istype(over_object, /obj/screen) ))
return ..()
if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
+8 -16
View File
@@ -93,22 +93,14 @@
user << "You can't place that item inside the disposal unit."
return
if(istype(I, /obj/item/weapon/storage/bag/trash))
var/obj/item/weapon/storage/bag/trash/T = I
if(T.contents.len)
user << "\blue You empty the bag."
for(var/obj/item/O in T.contents)
T.remove_from_storage(O,src)
T.update_icon()
update()
return
if(istype(I, /obj/item/weapon/storage/part_replacer))
var/obj/item/weapon/storage/part_replacer/P = I
if(P.contents.len)
user << "\blue You empty the RPED's contents."
for(var/obj/item/O in P.contents)
P.remove_from_storage(O,src)
if(istype(I, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = I
if((S.allow_quick_empty || S.allow_quick_gather) && S.contents.len)
S.hide_from(user)
user.visible_message("[user] empties \the [S] into \the [src].", "You empty \the [S] into \the [src].")
for(var/obj/item/O in S.contents)
S.remove_from_storage(O, src)
S.update_icon() // For content-sensitive icons
update()
return