From 5abe26c765f787e12ea5a5225f19e2c1398e5b61 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 21 Oct 2017 06:11:28 -0500 Subject: [PATCH] [MIRROR] fixes gibtonite instant hitting , projectile double hitting - not entirely my fault (#3526) * fixes gibtonite instant hitting , projectile double hitting - not entirely my fault (#31891) * Update projectile.dm * Update projectile.dm * Update projectile.dm * fixes gibtonite instant hitting , projectile double hitting - not entirely my fault --- code/modules/projectiles/projectile.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 24844d6deb..a24499ab05 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -205,11 +205,12 @@ /obj/item/projectile/proc/select_target(atom/A) //Selects another target from a wall if we hit a wall. - if(!A || !A.density || (A.flags_1 & ON_BORDER_1) || ismob(A)) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs or machines/structures on that tile. + if(!A || !A.density || (A.flags_1 & ON_BORDER_1) || ismob(A) || A == original) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs or machines/structures on that tile. return - if(A == original || original in A) + var/turf/T = get_turf(A) + if(original in T) return original - var/list/mob/possible_mobs = typecache_filter_list(A, GLOB.typecache_mob) + var/list/mob/possible_mobs = typecache_filter_list(T, GLOB.typecache_mob) - A var/list/mob/mobs = list() for(var/i in possible_mobs) var/mob/M = i @@ -219,10 +220,9 @@ var/mob/M = safepick(mobs) if(M) return M.lowest_buckled_mob() - var/obj/O = safepick(typecache_filter_list(A, GLOB.typecache_machine_or_structure)) + var/obj/O = safepick(typecache_filter_list(T, GLOB.typecache_machine_or_structure)) - A if(O) return O - return A /obj/item/projectile/proc/check_ricochet() if(prob(ricochet_chance))