From 4bea51027bcbe63edcbd8be131c914766c84eeda Mon Sep 17 00:00:00 2001 From: AzuleUtama <44248086+AzuleUtama@users.noreply.github.com> Date: Fri, 23 Nov 2018 10:23:38 +0000 Subject: [PATCH] Overall fix for projectile falloff Aims to fix the overall issue of damageless projectiles not working under the new falloff code. Also fixed some weird indentation in the original version of the range() code. --- code/modules/projectiles/projectile.dm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 39f25c5ef89..aa6e1a7866b 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -62,15 +62,17 @@ return ..() /obj/item/projectile/proc/Range() - range-- - if(damage && tile_dropoff) - damage = max(0, damage - tile_dropoff) // decrement projectile damage based on dropoff value for each tile it moves - if(stamina && tile_dropoff_s) - stamina = max(0, stamina - tile_dropoff_s) // as above, but with stamina - if(range <= 0 && loc) - on_range() - if(!damage && !stamina && !nodamage) - on_range() + range-- + if(damage && tile_dropoff) + damage = max(0, damage - tile_dropoff) // decrement projectile damage based on dropoff value for each tile it moves + if(stamina && tile_dropoff_s) + stamina = max(0, stamina - tile_dropoff_s) // as above, but with stamina + if(range <= 0 && loc) + on_range() + if(!damage && !stamina) + if(tile_dropoff || tile_dropoff_s) // does the projectile have falloff to start with + on_range() + /obj/item/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range qdel(src)