From cfc9dbf4376490d73d2069001837d807dfebf196 Mon Sep 17 00:00:00 2001 From: Hatterhat <31829017+Hatterhat@users.noreply.github.com> Date: Wed, 6 Mar 2024 11:58:13 -0600 Subject: [PATCH] fixes basic mobs with ranged attacks attacking in containers (#81804) ## About The Pull Request see title - changes an isturf check to an !ismob check for an attacking basic mob's loc in can_attack(), as previously this allowed mobs to shoot from inside containers ## Why It's Good For The Game ![image](https://github.com/tgstation/tgstation/assets/31829017/ffe03955-78f2-4e6e-b15c-9fdf6d85d588) ## Changelog :cl: fix: Basic mobs no longer have the (unintended) ability to shoot out of containers, like bluespace body bags. /:cl: --------- Co-authored-by: Hatterhat Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- .../targeting_strategies/basic_targeting_strategy.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/datums/ai/basic_mobs/targeting_strategies/basic_targeting_strategy.dm b/code/datums/ai/basic_mobs/targeting_strategies/basic_targeting_strategy.dm index a7d43d600b1..14f0d032079 100644 --- a/code/datums/ai/basic_mobs/targeting_strategies/basic_targeting_strategy.dm +++ b/code/datums/ai/basic_mobs/targeting_strategies/basic_targeting_strategy.dm @@ -50,7 +50,9 @@ if(living_mob.see_invisible < the_target.invisibility) //Target's invisible to us, forget it return FALSE - if(isturf(living_mob.loc) && isturf(the_target.loc) && living_mob.z != the_target.z) // z check will always fail if target is in a mech or pawn is shapeshifted or jaunting + if(!isturf(living_mob.loc)) + return FALSE + if(isturf(the_target.loc) && living_mob.z != the_target.z) // z check will always fail if target is in a mech or pawn is shapeshifted or jaunting return FALSE if(isliving(the_target)) //Targeting vs living mobs