mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-02 21:44:17 +00:00
@@ -69,9 +69,9 @@
|
|||||||
/obj/item/weapon/gripper/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
/obj/item/weapon/gripper/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/gripper/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
|
/obj/item/weapon/gripper/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity, params)
|
||||||
|
|
||||||
if(!target || !flag) //Target is invalid or we are not adjacent.
|
if(!target || !proximity) //Target is invalid or we are not adjacent.
|
||||||
return
|
return
|
||||||
|
|
||||||
//There's some weirdness with items being lost inside the arm. Trying to fix all cases. ~Z
|
//There's some weirdness with items being lost inside the arm. Trying to fix all cases. ~Z
|
||||||
@@ -80,25 +80,22 @@
|
|||||||
wrapped = thing
|
wrapped = thing
|
||||||
break
|
break
|
||||||
|
|
||||||
if(wrapped) //Already have an item.
|
if(wrapped) //Already have an item.
|
||||||
|
|
||||||
|
//Temporary put wrapped into user so target's attackby() checks pass.
|
||||||
wrapped.loc = user
|
wrapped.loc = user
|
||||||
//Pass the attack on to the target.
|
|
||||||
|
//Pass the attack on to the target. This might delete/relocate wrapped.
|
||||||
target.attackby(wrapped,user)
|
target.attackby(wrapped,user)
|
||||||
|
|
||||||
if(wrapped && src && wrapped.loc == user)
|
//If wrapped did neither get deleted nor put into target, put it back into the gripper.
|
||||||
|
if(wrapped && user && (wrapped.loc == user))
|
||||||
wrapped.loc = src
|
wrapped.loc = src
|
||||||
|
else
|
||||||
//Sanity/item use checks.
|
|
||||||
|
|
||||||
if(!wrapped || !user)
|
|
||||||
return
|
|
||||||
|
|
||||||
if(wrapped.loc != src.loc)
|
|
||||||
wrapped = null
|
wrapped = null
|
||||||
return
|
return
|
||||||
|
|
||||||
if(istype(target,/obj/item)) //Check that we're not pocketing a mob.
|
else if(istype(target,/obj/item)) //Check that we're not pocketing a mob.
|
||||||
|
|
||||||
//...and that the item is not in a container.
|
//...and that the item is not in a container.
|
||||||
if(!isturf(target.loc))
|
if(!isturf(target.loc))
|
||||||
@@ -158,9 +155,9 @@
|
|||||||
/obj/item/weapon/matter_decompiler/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
/obj/item/weapon/matter_decompiler/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/matter_decompiler/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
|
/obj/item/weapon/matter_decompiler/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity, params)
|
||||||
|
|
||||||
if(!flag) return //Not adjacent.
|
if(!proximity) return //Not adjacent.
|
||||||
|
|
||||||
//We only want to deal with using this on turfs. Specific items aren't important.
|
//We only want to deal with using this on turfs. Specific items aren't important.
|
||||||
var/turf/T = get_turf(target)
|
var/turf/T = get_turf(target)
|
||||||
@@ -357,4 +354,4 @@
|
|||||||
stack = stack_plastic
|
stack = stack_plastic
|
||||||
|
|
||||||
stack.amount++
|
stack.amount++
|
||||||
decompiler.stored_comms[type]--;
|
decompiler.stored_comms[type]--;
|
||||||
|
|||||||
Reference in New Issue
Block a user