From b77b4830f586e78f3f0103d2ba3a1401c04ba2f8 Mon Sep 17 00:00:00 2001 From: Bokkiewokkie Date: Sat, 8 Jun 2024 23:08:01 +0200 Subject: [PATCH] Why would you put it on a turf anyway? --- nsv13/code/modules/overmap/shieldgen.dm | 13 +++++++------ nsv13/code/modules/overmap/weapons/damage.dm | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/nsv13/code/modules/overmap/shieldgen.dm b/nsv13/code/modules/overmap/shieldgen.dm index d0cd127dd03..dbc675c6cd4 100644 --- a/nsv13/code/modules/overmap/shieldgen.dm +++ b/nsv13/code/modules/overmap/shieldgen.dm @@ -338,7 +338,7 @@ /obj/effect/temp_visual/overmap_shield_hit name = "Shield hit" - icon = 'nsv13/icons/overmap/shieldhit.dmi'; + icon = 'nsv13/icons/overmap/shieldhit.dmi' icon_state = "shieldhit" duration = 0.75 SECONDS layer = ABOVE_MOB_LAYER+0.1 @@ -349,17 +349,18 @@ /obj/effect/temp_visual/overmap_shield_hit/Initialize(mapload, obj/structure/overmap/OM) . = ..() //Scale up the shield hit icon to roughly fit the overmap ship that owns us. - if(!OM) + if(!OM || !istype(OM)) + log_runtime("Shield hit effect was made with no ship!") return INITIALIZE_HINT_QDEL - overmap = OM var/matrix/desired = new() - var/icon/I = icon(overmap.icon) + var/icon/I = icon(OM.icon) var/resize_x = I.Width()/96 var/resize_y = I.Height()/96 desired.Scale(resize_x,resize_y) - desired.Turn(overmap.angle) + desired.Turn(OM.angle) transform = desired - overmap.vis_contents += src + OM.vis_contents |= src + overmap = OM /obj/effect/temp_visual/overmap_shield_hit/Destroy() overmap?.vis_contents -= src diff --git a/nsv13/code/modules/overmap/weapons/damage.dm b/nsv13/code/modules/overmap/weapons/damage.dm index 1bcd3fa46b1..4d36c653326 100644 --- a/nsv13/code/modules/overmap/weapons/damage.dm +++ b/nsv13/code/modules/overmap/weapons/damage.dm @@ -23,7 +23,7 @@ Bullet reactions if(shield_result) var/damage_sound = pick('nsv13/sound/effects/ship/damage/shield_hit.ogg', 'nsv13/sound/effects/ship/damage/shield_hit2.ogg') if(!impact_sound_cooldown) - new /obj/effect/temp_visual/overmap_shield_hit(get_turf(src), src) + new /obj/effect/temp_visual/overmap_shield_hit(src, src) relay(damage_sound) if(P.damage >= 15) //Flak begone shake_everyone(5)