From 2063ebb8d854364973dced0c7ce009b0e06874a1 Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Sun, 5 Apr 2015 23:42:01 +1200 Subject: [PATCH] Reflex runtime fix - Fixed runtime when reflex shooting targets - Fixed runtime when stopping aiming at a target which has lost its connected client --- code/modules/projectiles/projectile.dm | 10 ++++++---- code/modules/projectiles/targeting.dm | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 3786dda532e..89b2ee6f5b6 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -274,7 +274,7 @@ spawn while(src) if(kill_count-- < 1) on_impact(src.loc) //for any final impact behaviours - del(src) + del(src) if((!( current ) || loc == current)) current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z) if((x == 1 || x == world.maxx || y == 1 || y == world.maxy)) @@ -294,7 +294,7 @@ first_step = 0 else tracer_effect(effect_transform) - + if(!bumped && !isturf(original)) if(loc == get_turf(original)) if(!(original in permutated)) @@ -346,7 +346,7 @@ P.pixel_y = location.pixel_y P.activate() -//"Tracing" projectile +//"Tracing" projectile /obj/item/projectile/test //Used to see if you can hit them. invisibility = 101 //Nope! Can't see me! yo = null @@ -374,6 +374,8 @@ yo = targloc.y - curloc.y xo = targloc.x - curloc.x target = targloc + original = target + starting = curloc //plot the initial trajectory setup_trajectory() @@ -408,4 +410,4 @@ trace.firer = user var/output = trace.process() //Test it! del(trace) //No need for it anymore - return output //Send it back to the gun! + return output //Send it back to the gun! diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm index 1136f832275..85885cd15f6 100644 --- a/code/modules/projectiles/targeting.dm +++ b/code/modules/projectiles/targeting.dm @@ -236,7 +236,7 @@ if(!I.aim_targets.len) del(I.aim_targets) var/mob/living/T = I.loc //Remove the targeting icons - if(T && ismob(T) && !I.aim_targets) + if(T && ismob(T) && !I.aim_targets && T.client) T.client.remove_gun_icons() if(!targeted_by.len) del target_locked //Remove the overlay