From 91ca03c1d00306487a23ee6939f774adfc618c01 Mon Sep 17 00:00:00 2001 From: DeltaFire <46569814+DeltaFire15@users.noreply.github.com> Date: Wed, 4 Sep 2024 19:25:41 +0200 Subject: [PATCH 1/2] fix and questioning fixes a thing and highlights an issue with something else (we'll figure out what to do with that!) --- code/modules/projectiles/projectile.dm | 10 ++++++++-- nsv13/code/modules/projectiles/overmap.dm | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index df14e6c4bc8..9ef695539e9 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -820,8 +820,14 @@ /obj/item/projectile/proc/process_homing() //Nsv13 - Enhanced the performance of this entire proc. if(QDELETED(homing_target)) //NSV13 - Changed proc to be less performance intensive - return FALSE - var/targetAngle = get_angle(src, homing_target) + if(homing_target) //Bla bla refclearing. Necessary evil. (Probably not worth the hassle of handling this via comsig so this here instead) + homing_target = null + return FALSE //Hi, Delta from the past here, future one. We don't just disable homing entirely here because some projectiles might be able to reassess targets. + var/targetAngle + if(z && SSmapping.level_trait(z, ZTRAIT_OVERMAP)) //This bit of performance cost should be worth making these track properly. + targetAngle = overmap_angle(src, homing_target) + else + targetAngle = get_angle(src, homing_target) var/angle = closer_angle_difference(Angle, targetAngle) next_homing_process = world.time + homing_delay setAngle(Angle + CLAMP(angle, -homing_turn_speed, homing_turn_speed)) diff --git a/nsv13/code/modules/projectiles/overmap.dm b/nsv13/code/modules/projectiles/overmap.dm index c7c08e75929..47a461b0556 100644 --- a/nsv13/code/modules/projectiles/overmap.dm +++ b/nsv13/code/modules/projectiles/overmap.dm @@ -3,9 +3,10 @@ var/valid_angle = 0 //Angle the projectile can track at var/shotdown_effect_type = /obj/effect/temp_visual/impact_effect/torpedo +//Hey look, all this logic doesn't work! I love finding these things. /obj/item/projectile/guided_munition/process_homing(atom/A) . = ..() var/simplify_Angle = SIMPLIFY_DEGREES(Angle) - var/simplify_targetAngle = SIMPLIFY_DEGREES(targetAngle) + var/simplify_targetAngle = SIMPLIFY_DEGREES(targetAngle) //<< This var is never actually modified because [local var] supercedes [obj var] unless src is used. Personally, I'm unsure if we actually WANT it fixed. ~Delta if(simplify_targetAngle > simplify_Angle + valid_angle) homing = FALSE From 99c099a7202c1ffe7b9cff17762be5689e5c18b8 Mon Sep 17 00:00:00 2001 From: DeltaFire <46569814+DeltaFire15@users.noreply.github.com> Date: Wed, 4 Sep 2024 19:57:59 +0200 Subject: [PATCH 2/2] typo'd --- code/modules/projectiles/projectile.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 9ef695539e9..4c47a8aec90 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -820,7 +820,7 @@ /obj/item/projectile/proc/process_homing() //Nsv13 - Enhanced the performance of this entire proc. if(QDELETED(homing_target)) //NSV13 - Changed proc to be less performance intensive - if(homing_target) //Bla bla refclearing. Necessary evil. (Probably not worth the hassle of handling this via comsig so this here instead) + if(homing_target) //Bla bla refclearing. Necessary evil. (Probably not worth the hassle of handling this via comsig, so this is here instead) homing_target = null return FALSE //Hi, Delta from the past here, future one. We don't just disable homing entirely here because some projectiles might be able to reassess targets. var/targetAngle