Now with 100% more procs!

This commit is contained in:
Tkdrg
2014-02-08 18:22:56 -03:00
parent c43ba64484
commit 6245d00a4d
3 changed files with 12 additions and 13 deletions
@@ -102,9 +102,7 @@
set desc = "Activate to convert your plants into plantable seeds."
for(var/obj/item/O in contents)
seedify(O, 1)
for(var/mob/M in range(1))
if (M.s_active == src)
src.close(M)
close_all()
// -----------------------------
@@ -38,13 +38,8 @@
return
//Close any open UI windows first
var/found = 0
for(var/mob/M in range(1))
if(M.s_active == src)
close(M)
if(M == user)
found = 1
if(!found) //User is too far away
var/found = close_all()
if(!found) //No user had any windows closed
return
user << "<span class='notice'>You fold [src] flat.</span>"
@@ -95,6 +95,14 @@
user.s_active = null
/obj/item/weapon/storage/proc/close_all() //returns 1 if any mobs actually got a close(M) call
var/actually_closed = 0
for(var/mob/M in range(1))
if(M.s_active == src)
close(M)
actually_closed = 1
return actually_closed
//This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right.
//The numbers are calculated from the bottom-left The bottom-left slot being 1,1.
/obj/item/weapon/storage/proc/orient_objs(tx, ty, mx, my)
@@ -400,9 +408,7 @@
/obj/item/weapon/storage/Del()
for(var/mob/M in range(1))
if(M.s_active == src)
close(M)
close_all()
..()