Gandalf
2022-04-06 20:48:02 +01:00
committed by GitHub
parent 9326674439
commit 0b6fb03562
33 changed files with 87576 additions and 6729 deletions
@@ -349,8 +349,13 @@ SUBSYSTEM_DEF(spatial_grid)
///find the spatial map cell that target belongs to, then add target's important_recusive_contents to it.
///make sure to provide the turf new_target is "in"
/datum/controller/subsystem/spatial_grid/proc/enter_cell(atom/movable/new_target, turf/target_turf)
if(!target_turf || !new_target?.important_recursive_contents)
CRASH("/datum/controller/subsystem/spatial_grid/proc/enter_cell() was given null arguments or a new_target without important_recursive_contents!")
if(!initialized)
return
if(QDELETED(new_target))
CRASH("qdeleted or null target trying to enter the spatial grid!")
if(!target_turf || !new_target.important_recursive_contents)
CRASH("null turf loc or a new_target without important_recursive_contents trying to enter the spatial grid!")
var/x_index = ROUND_UP(target_turf.x / SPATIAL_GRID_CELLSIZE)
var/y_index = ROUND_UP(target_turf.y / SPATIAL_GRID_CELLSIZE)