Skip to content

Commit

Permalink
[MIRROR] [no gbp] Fixes goat runtime [MDB IGNORE] (#24952) (#584)
Browse files Browse the repository at this point in the history
* [no gbp] Fixes goat runtime (#79672)

## About The Pull Request

Fixes #79063
Instead of checking if a list is QDELETED (this doesn't work) we check
if it has a length.

## Changelog

:cl:
fix: Goats will now calm down after getting grumpy without causing a
runtime error.
/:cl:

* [no gbp] Fixes goat runtime

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Jacquerel <[email protected]>
  • Loading branch information
3 people authored Nov 13, 2023
1 parent 57bca2e commit 414450a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/datums/ai/_ai_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,11 @@ multiple modular subtrees with behaviors
/// Returns true if we have a blackboard key with the provided key and it is not qdeleting
/datum/ai_controller/proc/blackboard_key_exists(key)
var/datum/key_value = blackboard[key]
return !QDELETED(key_value)
if (isdatum(key_value))
return !QDELETED(key_value)
if (islist(key_value))
return length(key_value) > 0
return !!key_value

/**
* Used to manage references to datum by AI controllers
Expand Down

0 comments on commit 414450a

Please sign in to comment.