From c4e4c7732000654e5d2d62a87a97ad7ec1a14203 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 14 Mar 2015 01:25:54 -0400 Subject: [PATCH] Having a neck grab on someone causes them to be hit by projectiles first instead of you. If however the bullet misses or passes through the person being grabbed then it continues on and may still hit the person doing the grabbing. --- code/modules/projectiles/projectile.dm | 7 +++++++ code/setup.dm | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 9b710409a1..948998c522 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -194,6 +194,13 @@ if(ismob(A)) var/mob/M = A if(istype(A, /mob/living)) + //if they have a neck grab on someone, that person gets hit instead + for(var/obj/item/weapon/grab/G in list(M.l_hand, M.r_hand)) + if(G.state >= GRAB_NECK) + //If Bump() returns 0 (missed them or went through them) then we continue on to attack M. + if(Bump(G.affecting)) + return + passthrough = !attack_mob(M, distance) else passthrough = 1 //so ghosts don't stop bullets diff --git a/code/setup.dm b/code/setup.dm index 0a09af0cd4..7702564676 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -401,10 +401,10 @@ #define XENO_HOST 32768 // Tracks whether we're gonna be a baby alien's mummy. // Grab levels. +#define GRAB_UPGRADING -1 #define GRAB_PASSIVE 1 #define GRAB_AGGRESSIVE 2 #define GRAB_NECK 3 -#define GRAB_UPGRADING 4 #define GRAB_KILL 5 // Security levels.