Skip to content

Commit

Permalink
Update _ai_controller.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasint committed May 9, 2024
1 parent 01870b1 commit 771c8f9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions code/datums/ai/_ai_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ multiple modular subtrees with behaviors
set_new_cells()

/datum/ai_controller/proc/set_new_cells()
if(isnull(our_cells))
return

var/turf/our_turf = get_turf(pawn)

Expand All @@ -163,13 +165,9 @@ multiple modular subtrees with behaviors
recalculate_idle()

/datum/ai_controller/proc/should_idle()
if(!can_idle)
if(!can_idle || isnull(our_cells))
return FALSE

if(!our_cells)
our_cells = new(interesting_dist, interesting_dist, 1)
set_new_cells()

for(var/datum/spatial_grid_cell/grid as anything in our_cells.member_cells)
if(length(grid.client_contents))
return FALSE
Expand Down

0 comments on commit 771c8f9

Please sign in to comment.