grabbed_by assignment is now done in the grab constructor, instead of
leaking out all over the place.
This commit is contained in:
mwerezak
2014-10-10 00:23:03 -04:00
parent 6eea41bcc1
commit 7a81e116d2
12 changed files with 7 additions and 17 deletions

View File

@@ -26,7 +26,6 @@
G.assailant = src
G.layer = 20
G.affecting = target
target.grabbed_by += G
G.synch()
target.LAssailant = src

View File

@@ -95,7 +95,6 @@
M.r_hand = G
G.layer = 20
G.affecting = src
grabbed_by += G
G.synch()
LAssailant = M
@@ -150,7 +149,6 @@
M.r_hand = G
G.layer = 20
G.affecting = src
grabbed_by += G
G.synch()
LAssailant = M

View File

@@ -293,7 +293,6 @@
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M

View File

@@ -265,11 +265,10 @@
if ("grab")
if (M == src)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, src )
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M

View File

@@ -15,7 +15,6 @@
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M

View File

@@ -102,7 +102,6 @@
if(!G) //the grab will delete itself in New if affecting is anchored
return
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M

View File

@@ -681,6 +681,7 @@ It can still be worn/put on as normal.
for (var/obj/item/weapon/grab/G in target.grabbed_by)
if (G.loc == source && G.state >= GRAB_AGGRESSIVE)
grabbing = 1
break
if (!grabbing)
slot_to_process = null
source << "\red Your grasp was broken before you could restrain [target]!"

View File

@@ -277,7 +277,6 @@
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M
@@ -342,11 +341,10 @@
if ("grab")
if (M == src)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, src )
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
LAssailant = M

View File

@@ -839,11 +839,10 @@
if ("grab")
if (M == src)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, src )
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))

View File

@@ -253,7 +253,6 @@
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
G.affecting = src
LAssailant = M
@@ -285,11 +284,10 @@
if(!(status_flags & CANPUSH))
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, src )
M.put_in_active_hand(G)
grabbed_by += G
G.synch()
G.affecting = src
LAssailant = M

View File

@@ -28,6 +28,8 @@
del(src)
return
affecting.grabbed_by += src
hud = new /obj/screen/grab(src)
hud.icon_state = "reinforce"
hud.name = "reinforce grab"

View File

@@ -207,7 +207,6 @@
M.r_hand = G
G.layer = 20
G.affecting = src
src.grabbed_by += G
G.synch()
playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))