From 25a8d35ab0c5015b7fc90443cf8e952e55f3803f Mon Sep 17 00:00:00 2001 From: Krausus Date: Mon, 4 May 2015 03:49:02 -0400 Subject: [PATCH] Fixes magnetic gripper never afterattack-ing This fixes magnetic grippers not being able to mount frames. Also, this includes an exception for magnetic grippers in the wall code, to prevent superfluous wall pushes. --- code/game/turfs/simulated/walls.dm | 3 +++ code/modules/mob/living/silicon/robot/drone/drone_items.dm | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 4dd7d14d460..7dbaa7b2492 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -475,6 +475,9 @@ P.loc = src P.level = 2 return + // The magnetic gripper does a separate attackby, so bail from this one + else if(istype(W, /obj/item/weapon/gripper)) + return else return attack_hand(user) diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm index 199720a1e0e..ea9ff45b5a6 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -86,7 +86,10 @@ wrapped.loc = user //Pass the attack on to the target. This might delete/relocate wrapped. - target.attackby(wrapped,user, params) + if(!target.attackby(wrapped, user, params) && target && wrapped) + // If the attackby didn't resolve or delete the target or wrapped, afterattack + // (Certain things, such as mountable frames, rely on afterattack) + wrapped.afterattack(target, user, 1, params) //If wrapped did neither get deleted nor put into target, put it back into the gripper. if(wrapped && user && (wrapped.loc == user))