Mob inventory cleanup

Replaces three item removal procs with one
Adds a proc to delete an item on the mob
This commit is contained in:
Kelenius
2016-03-24 01:23:08 +03:00
parent 463eb3a4b6
commit df5a0d7941
152 changed files with 296 additions and 423 deletions

View File

@@ -136,7 +136,7 @@
/obj/item/weapon/gun/launcher/crossbow/attackby(obj/item/W as obj, mob/user as mob)
if(!bolt)
if (istype(W,/obj/item/weapon/arrow))
user.drop_from_inventory(W, src)
user.removeItem(W, src)
bolt = W
user.visible_message("[user] slides [bolt] into [src].","You slide [bolt] into [src].")
update_icon()

View File

@@ -47,8 +47,7 @@
if(grenades.len >= max_grenades)
user << "<span class='warning'>[src] is full.</span>"
return
user.remove_from_mob(G)
G.loc = src
user.removeItem(G, src)
grenades.Insert(1, G) //add to the head of the list, so that it is loaded on the next pump
user.visible_message("[user] inserts \a [G] into [src].", "<span class='notice'>You insert \a [G] into [src].</span>")
return
@@ -106,8 +105,7 @@
if(chambered)
user << "<span class='warning'>[src] is already loaded.</span>"
return
user.remove_from_mob(G)
G.loc = src
user.removeItem(G, src)
chambered = G
user.visible_message("[user] load \a [G] into [src].", "<span class='notice'>You load \a [G] into [src].</span>")
return

View File

@@ -65,7 +65,7 @@
/obj/item/weapon/gun/launcher/pneumatic/attackby(obj/item/W as obj, mob/user as mob)
if(!tank && istype(W,/obj/item/weapon/tank))
user.drop_from_inventory(W, src)
user.removeItem(W, src)
tank = W
user.visible_message("[user] jams [W] into [src]'s valve and twists it closed.","You jam [W] into [src]'s valve and twist it closed.")
update_icon()
@@ -161,8 +161,7 @@
/obj/item/weapon/cannonframe/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/pipe))
if(buildstate == 0)
user.drop_from_inventory(W)
qdel(W)
user.deleteItem(W)
user << "<span class='notice'>You secure the piping inside the frame.</span>"
buildstate++
update_icon()
@@ -179,8 +178,7 @@
return
else if(istype(W,/obj/item/device/transfer_valve))
if(buildstate == 4)
user.drop_from_inventory(W)
qdel(W)
user.deleteItem(W)
user << "<span class='notice'>You install the transfer valve and connect it to the piping.</span>"
buildstate++
update_icon()

View File

@@ -22,8 +22,7 @@
if(istype(I, /obj/item/weapon/reagent_containers/syringe))
syringe = I
user << "<span class='notice'>You carefully insert [syringe] into [src].</span>"
user.remove_from_mob(syringe)
syringe.loc = src
user.removeItem(syringe, src)
sharp = 1
name = "syringe dart"
update_icon()
@@ -123,8 +122,7 @@
if(darts.len >= max_darts)
user << "<span class='warning'>[src] is full!</span>"
return
user.remove_from_mob(C)
C.loc = src
user.removeItem(C, src)
darts += C //add to the end
user.visible_message("[user] inserts \a [C] into [src].", "<span class='notice'>You insert \a [C] into [src].</span>")
else