fix mob ai using attacks while inside pokeballs (#81671)

## About The Pull Request
fixes pokemon AI still being active while inside the pokeball closes
#81669

## Why It's Good For The Game
fixes pokemon AI still being active while inside the pokeball

## Changelog
🆑
fix: fixes pokemon ai still being active when inside the pokeball
/🆑
This commit is contained in:
Ben10Omintrix
2024-02-26 17:59:25 +01:00
committed by GitHub
parent 5b4d0bc2f0
commit 29437e3559
2 changed files with 12 additions and 3 deletions
@@ -8,7 +8,8 @@
. = ..()
if(!controller.blackboard[targeting_strategy_key])
CRASH("No targeting strategy was supplied in the blackboard for [controller.pawn]")
if(HAS_TRAIT(controller.pawn, TRAIT_HANDS_BLOCKED))
return FALSE
//Hiding location is priority
var/atom/target = controller.blackboard[hiding_location_key] || controller.blackboard[target_key]
if(QDELETED(target))
@@ -67,6 +68,8 @@
/datum/ai_behavior/basic_ranged_attack/setup(datum/ai_controller/controller, target_key, targeting_strategy_key, hiding_location_key)
. = ..()
if(HAS_TRAIT(controller.pawn, TRAIT_HANDS_BLOCKED))
return FALSE
var/atom/target = controller.blackboard[hiding_location_key] || controller.blackboard[target_key]
if(QDELETED(target))
return FALSE