mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Fixes runtimes caused by opportunistic melee AI behaviors (#94475)
## About The Pull Request Opportunistic melee behavior did not check for target's existence unlike its parent, which means it could runtime if the target got destroyed before the behavior ran ## Changelog 🆑 fix: Fixes runtimes caused by opportunistic melee AI behaviors /🆑
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
/datum/ai_behavior/basic_melee_attack/opportunistic/perform(seconds_per_tick, datum/ai_controller/controller, target_key, targeting_strategy_key, hiding_location_key)
|
||||
var/atom/movable/atom_pawn = controller.pawn
|
||||
var/atom/atom_target = controller.blackboard[target_key]
|
||||
if (QDELETED(atom_target))
|
||||
return AI_BEHAVIOR_DELAY | AI_BEHAVIOR_FAILED
|
||||
if(!atom_target.IsReachableBy(atom_pawn))
|
||||
return AI_BEHAVIOR_INSTANT | AI_BEHAVIOR_SUCCEEDED
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user