Files

41 lines
29 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/controller/subsystem/spatial_grid - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="datum/controller/subsystem/spatial_grid.html#var">Var Details</a> - <a href="datum/controller/subsystem/spatial_grid.html#proc">Proc Details</a></header><main><h1>spatial_grid <aside>/<a href="datum.html">datum</a>/<a href="datum/controller.html">controller</a>/<a href="datum/controller/subsystem.html">subsystem</a>/<a href="datum/controller/subsystem/spatial_grid.html">spatial_grid</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L80"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 80"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#var/dummy_list">dummy_list</a></th><td>empty spatial grid cell content lists are just a reference to this instead of a standalone list to save memory without needed to check if its null when iterating</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#var/grids_by_z_level">grids_by_z_level</a></th><td>list of the spatial_grid_cell datums per z level, arranged in the order of y index then x index</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#var/number_of_oranges_ears">number_of_oranges_ears</a></th><td>how many pregenerated /mob/oranges_ear instances currently exist. this should hopefully never exceed its starting value</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#var/pregenerated_oranges_ears">pregenerated_oranges_ears</a></th><td>list of all of /mob/oranges_ear instances we have pregenerated for view() iteration speedup</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#var/spatial_grid_categories">spatial_grid_categories</a></th><td>associative list of the form: movable.spatial_grid_key (string) -&gt; inner list of spatial grid types for that key.
inner lists contain contents channel types such as SPATIAL_GRID_CONTENTS_TYPE_HEARING etc.
we use this to make adding to a cell static cost, and to save on memory</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#var/waiting_to_add_by_type">waiting_to_add_by_type</a></th><td>everything that spawns before us is added to this list until we initialize</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/add_grid_awareness">add_grid_awareness</a></th><td>Adds grid awareness to the passed in atom, of the passed in type
Basically, when this atom moves between grids, it wants to have enter/exit cell called on it</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/add_grid_membership">add_grid_membership</a></th><td>Alerts the atom's current cell that it wishes to be treated as a member
This functionally amounts to &quot;hey, I was recently made aware by [add_grid_awareness], please insert me into my current cell&quot;</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/add_single_type">add_single_type</a></th><td>acts like enter_cell() but only adds the target to a specified type of grid cell contents list</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/after_world_bounds_expanded">after_world_bounds_expanded</a></th><td>adds cells to the grid for every z level when world.maxx or world.maxy is expanded after this subsystem is initialized. hopefully this is never needed.
because i never tested this.</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/assign_oranges_ears">assign_oranges_ears</a></th><td>allocate one <a href="mob/oranges_ear.html" title="/mob/oranges_ear">/mob/oranges_ear</a> mob per turf containing atoms_that_need_ears and give them a reference to every listed atom in their turf.
if an oranges_ear is allocated to a turf that already has an oranges_ear then the second one fails to allocate (and gives the existing one the atom it was assigned to)</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/enter_cell">enter_cell</a></th><td>find the spatial map cell that target belongs to, then add the target to it, as its type prefers.
make sure to provide the turf new_target is &quot;in&quot;</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/enter_pre_init_queue">enter_pre_init_queue</a></th><td>add a movable to the pre init queue for whichever type is specified so that when the subsystem initializes they get added to the grid</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/exit_cell">exit_cell</a></th><td>find the spatial map cell that target used to belong to, then remove the target (and sometimes its important_recusive_contents) from it.
make sure to provide the turf old_target used to be &quot;in&quot;</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/find_hanging_cell_refs_for_movable">find_hanging_cell_refs_for_movable</a></th><td>if shit goes south, this will find hanging references for qdeleting movables inside the spatial grid</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/force_remove_from_cell">force_remove_from_cell</a></th><td>remove this movable from the given spatial_grid_cell</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/force_remove_from_grid">force_remove_from_grid</a></th><td>remove this movable from the grid by finding the grid cell its in and removing it from that.
if it cant infer a grid cell its located in (e.g. if its in nullspace but it can happen if the grid isnt expanded to a z level), search every grid cell.</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/get_cell_of">get_cell_of</a></th><td>get the grid cell encomapassing targets coordinates</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/get_cells_in_bounds">get_cells_in_bounds</a></th><td>get all grid cells intersecting the bounding box around center with sides of length (2 * range_x, 2 * range_y)</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/get_cells_in_range">get_cells_in_range</a></th><td>get all grid cells intersecting the bounding box around center with sides of length 2 * range</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/orthogonal_range_search">orthogonal_range_search</a></th><td>https://en.wikipedia.org/wiki/Range_searching#Orthogonal_range_searching</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/pregenerate_more_oranges_ears">pregenerate_more_oranges_ears</a></th><td>creates number_to_generate new oranges_ear's and adds them to the subsystems list of ears.
i really fucking hope this never gets called after init :clueless:</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/propogate_spatial_grid_to_new_z">propogate_spatial_grid_to_new_z</a></th><td>creates the spatial grid for a new z level</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/queued_item_deleted">queued_item_deleted</a></th><td>if a movable is inside our pre init queue before we're initialized and it gets deleted we need to remove that reference with this proc</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/remove_from_pre_init_queue">remove_from_pre_init_queue</a></th><td>removes an initialized and probably deleted movable from our pre init queue before we're initialized</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/remove_grid_awareness">remove_grid_awareness</a></th><td>Removes grid awareness from the passed in atom, of the passed in type</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/remove_grid_membership">remove_grid_membership</a></th><td>Removes grid membership from the passed in atom, of the passed in type</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/remove_single_type">remove_single_type</a></th><td>acts like exit_cell() but only removes the target from the specified type of grid cell contents list</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/untracked_movable_error">untracked_movable_error</a></th><td>if for whatever reason this movable is &quot;untracked&quot; e.g. it breaks the assumption that a movable is only inside the contents of any grid cell associated with its loc,
this will error. this checks every grid cell in the world so dont call this on live unless you have to.
returns TRUE if this movable is untracked, FALSE otherwise</td></tr><tr><th><a href="datum/controller/subsystem/spatial_grid.html#proc/update_grid_awareness">update_grid_awareness</a></th><td>Updates the string that atoms hold that stores their grid awareness
We will use it to key into their spatial grid categories later</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/dummy_list"><aside class="declaration">var </aside>dummy_list <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L98"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 98"></a></h3><p>empty spatial grid cell content lists are just a reference to this instead of a standalone list to save memory without needed to check if its null when iterating</p><h3 id="var/grids_by_z_level"><aside class="declaration">var </aside>grids_by_z_level <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L86"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 86"></a></h3><p>list of the spatial_grid_cell datums per z level, arranged in the order of y index then x index</p><h3 id="var/number_of_oranges_ears"><aside class="declaration">var </aside>number_of_oranges_ears <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L103"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 103"></a></h3><p>how many pregenerated /mob/oranges_ear instances currently exist. this should hopefully never exceed its starting value</p><h3 id="var/pregenerated_oranges_ears"><aside class="declaration">var </aside>pregenerated_oranges_ears <aside> /list/<a href="mob.html">mob</a>/<a href="mob/oranges_ear.html">oranges_ear</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L101"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 101"></a></h3><p>list of all of /mob/oranges_ear instances we have pregenerated for view() iteration speedup</p><h3 id="var/spatial_grid_categories"><aside class="declaration">var </aside>spatial_grid_categories <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L92"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 92"></a></h3><p>associative list of the form: movable.spatial_grid_key (string) -&gt; inner list of spatial grid types for that key.
inner lists contain contents channel types such as SPATIAL_GRID_CONTENTS_TYPE_HEARING etc.
we use this to make adding to a cell static cost, and to save on memory</p><h3 id="var/waiting_to_add_by_type"><aside class="declaration">var </aside>waiting_to_add_by_type <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L88"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 88"></a></h3><p>everything that spawns before us is added to this list until we initialize</p><h2 id="proc">Proc Details</h2><h3 id="proc/add_grid_awareness"><aside class="declaration">proc </aside>add_grid_awareness<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/add_to, type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L300"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 300"></a></aside></h3><p>Adds grid awareness to the passed in atom, of the passed in type
Basically, when this atom moves between grids, it wants to have enter/exit cell called on it</p><h3 id="proc/add_grid_membership"><aside class="declaration">proc </aside>add_grid_membership<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/add_to, /<a href="turf.html">turf</a>/target_turf, type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L324"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 324"></a></aside></h3><p>Alerts the atom's current cell that it wishes to be treated as a member
This functionally amounts to &quot;hey, I was recently made aware by [add_grid_awareness], please insert me into my current cell&quot;</p><h3 id="proc/add_single_type"><aside class="declaration">proc </aside>add_single_type<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/new_target, /<a href="turf.html">turf</a>/target_turf, exclusive_type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L383"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 383"></a></aside></h3><p>acts like enter_cell() but only adds the target to a specified type of grid cell contents list</p><h3 id="proc/after_world_bounds_expanded"><aside class="declaration">proc </aside>after_world_bounds_expanded<aside>(/<a href="datum.html">datum</a>/<a href="datum/controller.html">controller</a>/<a href="datum/controller/subsystem.html">subsystem</a>/<a href="datum/controller/subsystem/processing/dcs.html">processing/dcs</a>/fucking_dcs, has_expanded_world_maxx, has_expanded_world_maxy) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L178"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 178"></a></aside></h3><p>adds cells to the grid for every z level when world.maxx or world.maxy is expanded after this subsystem is initialized. hopefully this is never needed.
because i never tested this.</p><h3 id="proc/assign_oranges_ears"><aside class="declaration">proc </aside>assign_oranges_ears<aside>(/list/atoms_that_need_ears) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L635"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 635"></a></aside></h3><p>allocate one <a href="mob/oranges_ear.html" title="/mob/oranges_ear">/mob/oranges_ear</a> mob per turf containing atoms_that_need_ears and give them a reference to every listed atom in their turf.
if an oranges_ear is allocated to a turf that already has an oranges_ear then the second one fails to allocate (and gives the existing one the atom it was assigned to)</p><h3 id="proc/enter_cell"><aside class="declaration">proc </aside>enter_cell<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/new_target, /<a href="turf.html">turf</a>/target_turf) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L352"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 352"></a></aside></h3><p>find the spatial map cell that target belongs to, then add the target to it, as its type prefers.
make sure to provide the turf new_target is &quot;in&quot;</p><h3 id="proc/enter_pre_init_queue"><aside class="declaration">proc </aside>enter_pre_init_queue<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/waiting_movable, type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L133"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 133"></a></aside></h3><p>add a movable to the pre init queue for whichever type is specified so that when the subsystem initializes they get added to the grid</p><h3 id="proc/exit_cell"><aside class="declaration">proc </aside>exit_cell<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/old_target, /<a href="turf.html">turf</a>/target_turf, exclusive_type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L422"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 422"></a></aside></h3><p>find the spatial map cell that target used to belong to, then remove the target (and sometimes its important_recusive_contents) from it.
make sure to provide the turf old_target used to be &quot;in&quot;</p>
<ul>
<li>old_target - the thing we want to remove from the spatial grid cell</li>
<li>target_turf - the turf we use to determine the cell we're removing from</li>
<li>exclusive_type - either null or a valid contents channel. if you just want to remove a single type from the grid cell then use this</li>
</ul><h3 id="proc/find_hanging_cell_refs_for_movable"><aside class="declaration">proc </aside>find_hanging_cell_refs_for_movable<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/to_remove, remove_from_cells) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L587"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 587"></a></aside></h3><p>if shit goes south, this will find hanging references for qdeleting movables inside the spatial grid</p><h3 id="proc/force_remove_from_cell"><aside class="declaration">proc </aside>force_remove_from_cell<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/to_remove, /<a href="datum.html">datum</a>/<a href="datum/spatial_grid_cell.html">spatial_grid_cell</a>/input_cell) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L580"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 580"></a></aside></h3><p>remove this movable from the given spatial_grid_cell</p><h3 id="proc/force_remove_from_grid"><aside class="declaration">proc </aside>force_remove_from_grid<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/to_remove) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L558"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 558"></a></aside></h3><p>remove this movable from the grid by finding the grid cell its in and removing it from that.
if it cant infer a grid cell its located in (e.g. if its in nullspace but it can happen if the grid isnt expanded to a z level), search every grid cell.</p><h3 id="proc/get_cell_of"><aside class="declaration">proc </aside>get_cell_of<aside>(/<a href="atom.html">atom</a>/target) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L260"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 260"></a></aside></h3><p>get the grid cell encomapassing targets coordinates</p><h3 id="proc/get_cells_in_bounds"><aside class="declaration">proc </aside>get_cells_in_bounds<aside>(/<a href="atom.html">atom</a>/center, range_x, range_y) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L272"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 272"></a></aside></h3><p>get all grid cells intersecting the bounding box around center with sides of length (2 * range_x, 2 * range_y)</p><h3 id="proc/get_cells_in_range"><aside class="declaration">proc </aside>get_cells_in_range<aside>(/<a href="atom.html">atom</a>/center, range) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L268"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 268"></a></aside></h3><p>get all grid cells intersecting the bounding box around center with sides of length 2 * range</p><h3 id="proc/orthogonal_range_search"><aside class="declaration">proc </aside>orthogonal_range_search<aside>(/<a href="atom.html">atom</a>/center, type, range) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L228"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 228"></a></aside></h3><p>https://en.wikipedia.org/wiki/Range_searching#Orthogonal_range_searching</p>
<p>searches through the grid cells intersecting a rectangular search space (with sides of length 2 * range) then returns all contents of type inside them.
much faster than iterating through view() to find all of what you want.</p>
<p>this does NOT return things only in range distance from center! the search space is a square not a circle, if you want only things in a certain distance
then you need to filter that yourself</p>
<ul>
<li>center - the atom that is the center of the searched circle</li>
<li>type - the type of grid contents you are looking for, see __DEFINES/spatial_grid.dm</li>
<li>range - the bigger this is, the more spatial grid cells the search space intersects</li>
</ul><h3 id="proc/pregenerate_more_oranges_ears"><aside class="declaration">proc </aside>pregenerate_more_oranges_ears<aside>(number_to_generate) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L627"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 627"></a></aside></h3><p>creates number_to_generate new oranges_ear's and adds them to the subsystems list of ears.
i really fucking hope this never gets called after init :clueless:</p><h3 id="proc/propogate_spatial_grid_to_new_z"><aside class="declaration">proc </aside>propogate_spatial_grid_to_new_z<aside>(/<a href="datum.html">datum</a>/<a href="datum/controller.html">controller</a>/<a href="datum/controller/subsystem.html">subsystem</a>/<a href="datum/controller/subsystem/processing/dcs.html">processing/dcs</a>/fucking_dcs, /<a href="datum.html">datum</a>/<a href="datum/space_level.html">space_level</a>/z_level) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L163"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 163"></a></aside></h3><p>creates the spatial grid for a new z level</p><h3 id="proc/queued_item_deleted"><aside class="declaration">proc </aside>queued_item_deleted<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/movable_being_deleted) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L158"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 158"></a></aside></h3><p>if a movable is inside our pre init queue before we're initialized and it gets deleted we need to remove that reference with this proc</p><h3 id="proc/remove_from_pre_init_queue"><aside class="declaration">proc </aside>remove_from_pre_init_queue<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/movable_to_remove, exclusive_type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L139"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 139"></a></aside></h3><p>removes an initialized and probably deleted movable from our pre init queue before we're initialized</p><h3 id="proc/remove_grid_awareness"><aside class="declaration">proc </aside>remove_grid_awareness<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/remove_from, type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L312"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 312"></a></aside></h3><p>Removes grid awareness from the passed in atom, of the passed in type</p><h3 id="proc/remove_grid_membership"><aside class="declaration">proc </aside>remove_grid_membership<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/remove_from, /<a href="turf.html">turf</a>/target_turf, type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L333"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 333"></a></aside></h3><p>Removes grid membership from the passed in atom, of the passed in type</p><h3 id="proc/remove_single_type"><aside class="declaration">proc </aside>remove_single_type<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/old_target, /<a href="turf.html">turf</a>/target_turf, exclusive_type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L454"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 454"></a></aside></h3><p>acts like exit_cell() but only removes the target from the specified type of grid cell contents list</p><h3 id="proc/untracked_movable_error"><aside class="declaration">proc </aside>untracked_movable_error<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/movable_to_check) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L488"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 488"></a></aside></h3><p>if for whatever reason this movable is &quot;untracked&quot; e.g. it breaks the assumption that a movable is only inside the contents of any grid cell associated with its loc,
this will error. this checks every grid cell in the world so dont call this on live unless you have to.
returns TRUE if this movable is untracked, FALSE otherwise</p><h3 id="proc/update_grid_awareness"><aside class="declaration">proc </aside>update_grid_awareness<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/update, /list/new_list) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/controllers/subsystem/non_firing/SSspatial_grid.dm#L343"><img src="git.png" width="16" height="16" title="code/controllers/subsystem/non_firing/SSspatial_grid.dm 343"></a></aside></h3><p>Updates the string that atoms hold that stores their grid awareness
We will use it to key into their spatial grid categories later</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/8a8a00a2a9bec485351e5f219982b7315d3504fa">8a8a00a</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html>