mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-28 18:11:16 +00:00
* Fixes Massive Radio Overtime, Implements a Spatial Grid System for Faster Searching Over Areas * no spamming pings for upstream :( * E * E Co-authored-by: Kylerace <kylerlumpkin1@gmail.com> Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Co-authored-by: Gandalf <jzo123@hotmail.com>
17 lines
891 B
Plaintext
17 lines
891 B
Plaintext
///each cell in a spatial_grid is this many turfs in length and width
|
|
#define SPATIAL_GRID_CELLSIZE 17
|
|
|
|
#define SPATIAL_GRID_CELLS_PER_SIDE(world_bounds) ROUND_UP((world_bounds) / SPATIAL_GRID_CELLSIZE)
|
|
|
|
#define SPATIAL_GRID_CHANNELS 2
|
|
|
|
//grid contents channels
|
|
|
|
///everything that is hearing sensitive is stored in this channel
|
|
#define SPATIAL_GRID_CONTENTS_TYPE_HEARING RECURSIVE_CONTENTS_HEARING_SENSITIVE
|
|
///every movable that has a client in it is stored in this channel
|
|
#define SPATIAL_GRID_CONTENTS_TYPE_CLIENTS RECURSIVE_CONTENTS_CLIENT_MOBS
|
|
|
|
///whether movable is itself or containing something which should be in one of the spatial grid channels.
|
|
#define HAS_SPATIAL_GRID_CONTENTS(movable) (movable.important_recursive_contents && (movable.important_recursive_contents[RECURSIVE_CONTENTS_HEARING_SENSITIVE] || movable.important_recursive_contents[RECURSIVE_CONTENTS_CLIENT_MOBS]))
|