Skip to content

Commit

Permalink
[MIRROR] fixes basic mobs with ranged attacks attacking in containers (
Browse files Browse the repository at this point in the history
…#1300)

* 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 <[email protected]>
Co-authored-by: Ghom <[email protected]>

* fixes basic mobs with ranged attacks attacking in containers

---------

Co-authored-by: Hatterhat <[email protected]>
Co-authored-by: Hatterhat <[email protected]>
Co-authored-by: Ghom <[email protected]>
  • Loading branch information
4 people authored and StealsThePRs committed Mar 6, 2024
1 parent 4aefee5 commit fdc051d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fdc051d

Please sign in to comment.