[MIRROR] Fixes a runtime with AI targeting code, refactors faction checking to be at the atom/movable level [MDB IGNORE] (#24386)

* Fixes a runtime with AI targeting code, refactors faction checking to be at the atom/movable level (#78803)

## About The Pull Request

Saw this in CI.

![firefox_lCYnPMJIqm](https://github.com/tgstation/tgstation/assets/13398309/8ef309df-09b6-4096-b6aa-340b59f7446b)

~~Quick fix for it--because turrets are not mobs trying to call this
proc on them will runtime. So let's give them their own implementation
of the proc.~~ Just kidding, let's refactor faction checking entirely

## Why It's Good For The Game

Fixes an issue with basic mob AI targeting and turrets.

## Changelog

🆑
fix: basic mobs will no longer runtime when trying to check the faction
of a porta turret
refactor: faction checking is now done at the atom/movable level
/🆑

---------

Co-authored-by: san7890 <the@ san7890.com>

* Fixes a runtime with AI targeting code, refactors faction checking to be at the atom/movable level

* Modular updates

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
This commit is contained in:
SkyratBot
2023-10-16 21:41:24 -04:00
committed by GitHub
co-authored by san7890 Bloop
parent e098fa2a19
commit fa31acc3ec
32 changed files with 63 additions and 61 deletions
@@ -401,7 +401,7 @@
give_blood(10)
/obj/item/soulscythe/attack_hand(mob/user, list/modifiers)
if(soul.ckey && !soul.faction_check_mob(user))
if(soul.ckey && !soul.faction_check_atom(user))
to_chat(user, span_warning("You can't pick up [src]!"))
return
return ..()