Merge pull request #9273 from GinjaNinja32/grab_del

Fixes grabs runtiming on qdel()
This commit is contained in:
PsiOmegaDelta
2015-05-15 08:22:52 +02:00
+12 -4
View File
@@ -71,10 +71,13 @@
/obj/item/weapon/grab/process()
if(gcDestroyed) // GC is trying to delete us, we'll kill our processing so we can cleanly GC
return PROCESS_KILL
confirm()
if(!assailant)
qdel(src)
return
qdel(src) // Same here, except we're trying to delete ourselves.
return PROCESS_KILL
if(assailant.client)
assailant.client.screen -= hud
@@ -407,7 +410,11 @@
/obj/item/weapon/grab/dropped()
loc = null
qdel(src)
if(!destroying)
qdel(src)
/obj/item/weapon/grab
var/destroying = 0
/obj/item/weapon/grab/Destroy()
animate(affecting, pixel_x = 0, pixel_y = 0, 4, 1, LINEAR_EASING)
@@ -421,4 +428,5 @@
assailant = null
qdel(hud)
hud = null
..()
destroying = 1 // stops us calling qdel(src) on dropped()
..()