28 #define MAX_FORBIDDENLIST (MAX_EDICTS * 4)
45 fbList[fbListLength++] = pos;
46 fbList[fbListLength++] = entSize;
49 Sys_Error(
"ForbiddenList.add: list too long\n");
60 if (prev >= fbList + fbListLength)
66 byte* forbiddenSize = *(current + 1);
67 memcpy(&entSize, forbiddenSize,
sizeof(entSize));
72 inline bool contains(
const pos3_t pos) {
int Grid_MoveNext(const pathing_t *path, const pos3_t toPos, byte crouchingState)
Get the direction to use to move to a position (used to reconstruct the path)
void Sys_Error(const char *error,...)
void Grid_CalcPathing(const Routing &routing, const actorSizeEnum_t actorSize, pathing_t *path, const pos3_t from, int distance, forbiddenList_t *forbiddenList)
Recalculate the pathing table for the given actor(-position)
bool Grid_FindPath(const Routing &routing, const actorSizeEnum_t actorSize, pathing_t *path, const pos3_t from, const pos3_t targetPos, byte crouchingState, int maxTUs, forbiddenList_t *forbiddenList)
Tries to find a path from the given actor(-position) to a given target position.
pos_t Grid_MoveLength(const pathing_t *path, const pos3_t to, byte crouchingState, bool stored)
Return the needed TUs to walk to a given position.
void Grid_PosToVec(const Routing &routing, const actorSizeEnum_t actorSize, const pos3_t pos, vec3_t vec)
Converts a grid position to world coordinates.
dvec_t areaFrom[ACTOR_MAX_STATES][PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH]
#define MAX_FORBIDDENLIST
pos_t ** getNext(pos_t **prev)
void Grid_RecalcRouting(mapTiles_t *mapTiles, Routing &routing, const char *name, const GridBox &box, const char **list)
This function recalculates the routing surrounding the entity name.
#define PATHFINDING_WIDTH
absolute max
byte area[ACTOR_MAX_STATES][PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH]
int Grid_Floor(const Routing &routing, const actorSizeEnum_t actorSize, const pos3_t pos)
Returns the height of the floor in a cell.
pos_t Grid_Fall(const Routing &routing, const actorSizeEnum_t actorSize, const pos3_t pos)
Calculated the new height level when something falls down from a certain position.
static forbiddenList_t forbiddenList
A list of locations that cannot be moved to.
struct forbiddenList_s forbiddenList_t
A list of locations that cannot be moved to.
bool Grid_ShouldUseAutostand(const pathing_t *path, const pos3_t toPos)
Checks if a crouched actor could save TUs by standing up, walking and crouching again.
pos_t * fbList[MAX_FORBIDDENLIST]
byte areaStored[ACTOR_MAX_STATES][PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH]
#define VectorCompare(a, b)
#define PATHFINDING_HEIGHT
15 max, adjusting above 8 will require a rewrite to the DV code
void Grid_RecalcBoxRouting(mapTiles_t *mapTiles, Routing &routing, const GridBox &box, const char **list)
This function recalculates the routing in and around the box bounded by min and max.
void Grid_MoveStore(pathing_t *path)
Caches the calculated move.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
void add(pos3_t pos, byte *entSize)
int Grid_GetTUsForDirection(const int dir, bool crouched)
Returns the amounts of TUs that are needed to perform one step into the given direction.
struct pathing_s pathing_t
unsigned int Grid_Ceiling(const Routing &routing, const actorSizeEnum_t actorSize, const pos3_t pos)
Returns the height of the floor in a cell.
short dvec_t
The direction vector tells us where the actor came from (in his previous step). The pathing table hol...
A list of locations that cannot be moved to.
actorSizeEnum_t getEntSize(pos_t **current)
static mapTiles_t mapTiles