From a60157fe5bc2d6ed0bb3185224f3fe6c282512dc Mon Sep 17 00:00:00 2001 From: Markolie Date: Tue, 28 Jul 2015 19:14:56 +0200 Subject: [PATCH] Make sure check trajectory works --- code/game/machinery/portable_turret.dm | 12 +++++------- code/modules/projectiles/projectile.dm | 8 +++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 438c53e0ce6..93ed0a71efd 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -71,7 +71,7 @@ /obj/machinery/porta_turret/New() ..() - req_access.Cut() + req_access = list() req_one_access = list(access_security, access_heads) //Sets up a spark system @@ -83,7 +83,7 @@ /obj/machinery/porta_turret/crescent/New() ..() - req_one_access.Cut() + req_one_access = list() req_access = list(access_cent_specops) /obj/machinery/porta_turret/proc/setup() @@ -479,7 +479,7 @@ var/list/turret_icons if(L.stat && !emagged) //if the perp is dead/dying, no need to bother really return TURRET_NOT_TARGET //move onto next potential victim! - + if(get_dist(src, L) > 7) //if it's too far away, why bother? return TURRET_NOT_TARGET @@ -502,13 +502,11 @@ var/list/turret_icons if(isanimal(L) || issmall(L)) // Animals are not so dangerous return check_anomalies ? TURRET_SECONDARY_TARGET : TURRET_NOT_TARGET + if(isalien(L)) // Xenos are dangerous return check_anomalies ? TURRET_PRIORITY_TARGET : TURRET_NOT_TARGET - if(ishuman(L)) //if the target is a human, analyze threat level - if(emagged) - return 10 - + if(ishuman(L)) //if the target is a human, analyze threat level if(assess_perp(L, check_access, check_weapons, check_records, check_arrest) < 4) return TURRET_NOT_TARGET //if threat level < 4, keep going diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 8185a1f70c8..66cd750c022 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -325,16 +325,14 @@ if(istype(M)) return 1 - -/proc/check_trajectory(atom/target as mob, var/mob/living/user as mob, var/pass_flags=PASSTABLE|PASSGLASS|PASSGRILLE, flags=null) //Checks if you can hit them or not. - if(!istype(target) || !istype(user)) +/proc/check_trajectory(atom/target as mob|obj, atom/firer as mob|obj, var/pass_flags=PASSTABLE|PASSGLASS|PASSGRILLE, flags=null) //Checks if you can hit them or not. + if(!istype(target) || !istype(firer)) return 0 - var/obj/item/projectile/test/trace = new /obj/item/projectile/test(get_step_to(user,target)) //Making the test.... + var/obj/item/projectile/test/trace = new /obj/item/projectile/test(get_turf(firer)) //Making the test.... trace.target = target if(!isnull(flags)) trace.flags = flags //Set the flags... trace.pass_flags = pass_flags //And the pass flags to that of the real projectile... - trace.firer = user var/output = trace.process() //Test it! qdel(trace) //No need for it anymore return output //Send it back to the gun!