From a84407f069fd9cf61e3311637fee8768dd92958f Mon Sep 17 00:00:00 2001 From: Zwei <35403274+Gottfrei@users.noreply.github.com> Date: Sat, 22 Jun 2024 21:41:33 +0300 Subject: [PATCH] bugfix: Few Projectile Runtimes (#5257) --- .../hostile/megafauna/colossus.dm | 7 ++++--- .../hostile/mining/elites/herald.dm | 2 +- code/modules/projectiles/projectile.dm | 21 ++++++++++--------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 91e2e2f6f96..0a7d1265e11 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -212,15 +212,16 @@ Difficulty: Very Hard icon_state = initial(icon_state) /mob/living/simple_animal/hostile/megafauna/colossus/proc/shoot_projectile(turf/marker, set_angle) - if(!isnum(set_angle) && (!marker || marker == loc)) + // a lot of sleeps around colossus shooting, so its better to check if our marker is still exist by this point + if(QDELETED(marker) || marker == loc) return var/turf/startloc = get_turf(src) var/obj/item/projectile/P = new /obj/item/projectile/colossus(startloc) - P.preparePixelProjectile(marker, marker, startloc) + P.preparePixelProjectile(marker, marker, src) P.firer = src if(target) P.original = target - P.fire(set_angle) + P.fire(isnum(set_angle) ? set_angle : null) /mob/living/simple_animal/hostile/megafauna/colossus/proc/random_shots(do_sleep = TRUE) ranged_cooldown = world.time + 30 diff --git a/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm b/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm index 384599dae3d..f73fee3985d 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/elites/herald.dm @@ -139,7 +139,7 @@ shoot_projectile(marker, set_angle - 15, FALSE, FALSE) else var/obj/item/projectile/herald/teleshot/H = new(startloc) - H.preparePixelProjectile(marker, marker, startloc) + H.preparePixelProjectile(marker, marker, src) H.firer = src H.damage = H.damage * dif_mult_dmg if(target) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index c251619fedb..2b708f9e505 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -182,16 +182,17 @@ var/list/shift = list("x" = 0, "y" = 0) var/turf/step_over = get_step(target_loca, splatter_dir) - if(get_splatter_blockage(step_over, target, splatter_dir, target_loca)) //If you can't cross the tile or any of its relevant obstacles... - shift = pixel_shift_dir(splatter_dir) //Pixel shift the blood there instead (so you can't see wallsplatter through walls). - else - target_loca = step_over - L.add_splatter_floor(target_loca, shift_x = shift["x"], shift_y = shift["y"]) - if(istype(H)) - for(var/mob/living/carbon/human/M in step_over) //Bloody the mobs who're infront of the spray. - M.bloody_hands(H) - /* Uncomment when bloody_body stops randomly not transferring blood colour. - M.bloody_body(H) */ + if(step_over) + if(get_splatter_blockage(step_over, target, splatter_dir, target_loca)) //If you can't cross the tile or any of its relevant obstacles... + shift = pixel_shift_dir(splatter_dir) //Pixel shift the blood there instead (so you can't see wallsplatter through walls). + else + target_loca = step_over + L.add_splatter_floor(target_loca, shift_x = shift["x"], shift_y = shift["y"]) + if(istype(H)) + for(var/mob/living/carbon/human/M in step_over) //Bloody the mobs who're infront of the spray. + M.bloody_hands(H) + /* Uncomment when bloody_body stops randomly not transferring blood colour. + M.bloody_body(H) */ else if(impact_effect_type) new impact_effect_type(target_loca, hitx, hity)