Emergency projectile fix #42544

Okay, oranges was right and I'm stupid.
Stops the server from crashing from a beam rifle, jesus.
This commit is contained in:
kevinz000
2019-01-28 20:22:32 +13:00
committed by oranges
parent 23fc38af7e
commit 5d4143f923
3 changed files with 6 additions and 11 deletions
+1 -3
View File
@@ -7,9 +7,7 @@
return TRUE
if(istype(mover, /obj/item/projectile))
var/obj/item/projectile/P = mover
if(P.can_hit_target(src, P.permutated, src == P.original, TRUE))
P.Bump(src)
return TRUE
return !P.can_hit_target(src, P.permutated, src == P.original, TRUE)
if(mover.throwing)
return (!density || !(mobility_flags & MOBILITY_STAND))
if(buckled == mover)
@@ -565,7 +565,7 @@
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/prehit(atom/target)
qdel(src)
return BULLET_ACT_HIT
return FALSE
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/on_hit()
qdel(src)
+4 -7
View File
@@ -230,13 +230,6 @@
if(hitscan)
store_hitscan_collision(pcache)
return TRUE
if(firer && !ignore_source_check)
var/mob/checking = firer
if((A == firer) || (((A in firer.buckled_mobs) || (istype(checking) && (A == checking.buckled))) && (A != original)) || (A == firer.loc && ismecha(A))) //cannot shoot yourself or your mech
trajectory_ignore_forcemove = TRUE
forceMove(T)
trajectory_ignore_forcemove = FALSE
return FALSE
var/distance = get_dist(T, starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
@@ -529,6 +522,10 @@
/obj/item/projectile/proc/can_hit_target(atom/target, list/passthrough, direct_target = FALSE, ignore_loc = FALSE)
if(QDELETED(target))
return FALSE
if(!ignore_source_check && firer)
var/mob/M = firer
if((target == firer) || ((target == firer.loc) && ismecha(firer.loc)) || (target in firer.buckled_mobs) || (istype(M) && (M.buckled == target)))
return FALSE
if(!ignore_loc && (loc != target.loc))
return FALSE
if(target in passthrough)