diff --git a/code/datums/ammo/bullet/sniper.dm b/code/datums/ammo/bullet/sniper.dm index 10f0d7fc3ac2..1900802ad350 100644 --- a/code/datums/ammo/bullet/sniper.dm +++ b/code/datums/ammo/bullet/sniper.dm @@ -114,7 +114,7 @@ if(istype(aimed_projectile.shot_from, /obj/item/weapon/gun/rifle/sniper/XM43E1)) var/obj/item/weapon/gun/rifle/sniper/XM43E1/amr = aimed_projectile.shot_from - if(target_mob == amr.focused_fire_target) + if(target_mob == (amr.focused_fire_target?.resolve())) if(amr.focused_fire_counter < 2) amr.focused_fire_counter += 1 else @@ -123,7 +123,7 @@ amr.focused_fire_counter = 0 amr_counter = amr.focused_fire_counter + 1 - amr.focused_fire_target = target_mob + amr.focused_fire_target = WEAKREF(target_mob) var/mob/living/living_target = target_mob var/size_damage_mod = 0.8 // 1.8x vs Non-Xenos (225) diff --git a/code/datums/elements/bullet_trait/damage_boost.dm b/code/datums/elements/bullet_trait/damage_boost.dm index 165980acb4ab..43d9d1b23377 100644 --- a/code/datums/elements/bullet_trait/damage_boost.dm +++ b/code/datums/elements/bullet_trait/damage_boost.dm @@ -78,7 +78,7 @@ GLOBAL_LIST_INIT(damage_boost_vehicles, typecacheof(/obj/vehicle/multitile)) active_damage_mult = damage_mult - if(boosted_projectile.damage_boosted && (boosted_projectile.last_atom_signaled != hit_atom) && (!boosted_projectile.bonus_projectile_check)) + if(boosted_projectile.damage_boosted && ((boosted_projectile.last_atom_signaled?.resolve()) != hit_atom) && (!boosted_projectile.bonus_projectile_check)) //If this is after a boosted hit, the last atom that procced this isn't the same as the current target, and this isn't a bonus projectile sharing the same damage_boost if(!boosted_projectile.last_damage_mult) //Make sure stored mult isn't 0 boosted_projectile.last_damage_mult = 1 @@ -95,4 +95,4 @@ GLOBAL_LIST_INIT(damage_boost_vehicles, typecacheof(/obj/vehicle/multitile)) boosted_projectile.last_damage_mult = 1 boosted_projectile.damage_boosted++ //Mark that a boosted hit occurred. - boosted_projectile.last_atom_signaled = hit_atom //Save the current triggering atom to the projectile + boosted_projectile.last_atom_signaled = WEAKREF(hit_atom) //Save the current triggering atom to the projectile diff --git a/code/modules/projectiles/guns/specialist/sniper.dm b/code/modules/projectiles/guns/specialist/sniper.dm index 16761416d7d5..5cfdbf556080 100644 --- a/code/modules/projectiles/guns/specialist/sniper.dm +++ b/code/modules/projectiles/guns/specialist/sniper.dm @@ -347,7 +347,7 @@ indestructible = 1 aimed_shot_cooldown_delay = 4 SECONDS var/focused_fire_counter = 0 - var/mob/focused_fire_target = null + var/datum/weakref/focused_fire_target = null fire_sound = 'sound/weapons/sniper_heavy.ogg' current_mag = /obj/item/ammo_magazine/sniper/anti_materiel //Renamed from anti-tank to align with new identity/description. Other references have been changed as well. -Kaga diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index c3a27f7117fe..8e0e7ee003c4 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -84,7 +84,7 @@ var/bonus_projectile_check = 0 /// What atom did this last receive a registered signal from? Used by damage_boost.dm - var/atom/last_atom_signaled = null + var/datum/weakref/last_atom_signaled = null /// Was this projectile affected by damage_boost.dm? If so, what was the last modifier? var/damage_boosted = 0