28#define MAX_FORBIDDENLIST (MAX_EDICTS * 4)
49 Sys_Error(
"ForbiddenList.add: list too long\n");
66 byte* forbiddenSize = *(current + 1);
67 memcpy(&entSize, forbiddenSize,
sizeof(entSize));
72 inline bool contains(
const pos3_t pos) {
74 while ((p = getNext(p))) {
83typedef struct pathing_s {
static forbiddenList_t forbiddenList
A list of locations that cannot be moved to.
#define PATHFINDING_WIDTH
absolute max
#define PATHFINDING_HEIGHT
15 max, adjusting above 8 will require a rewrite to the DV code
void Sys_Error(const char *error,...)
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_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).
int Grid_GetTUsForDirection(const int dir, bool crouched)
Returns the amounts of TUs that are needed to perform one step into the given direction.
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.
void Grid_PosToVec(const Routing &routing, const actorSizeEnum_t actorSize, const pos3_t pos, vec3_t vec)
Converts a grid position to world coordinates.
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.
void Grid_MoveStore(pathing_t *path)
Caches the calculated move.
#define MAX_FORBIDDENLIST
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).
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.
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.
unsigned int Grid_Ceiling(const Routing &routing, const actorSizeEnum_t actorSize, const pos3_t pos)
Returns the height of the floor in a cell.
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.
int Grid_Floor(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...
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
A list of locations that cannot be moved to.
pos_t * fbList[MAX_FORBIDDENLIST]
void add(pos3_t pos, byte *entSize)
actorSizeEnum_t getEntSize(pos_t **current)
pos_t ** getNext(pos_t **prev)
byte areaStored[ACTOR_MAX_STATES][PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH]
dvec_t areaFrom[ACTOR_MAX_STATES][PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH]
byte area[ACTOR_MAX_STATES][PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH]
static mapTiles_t mapTiles
#define VectorCompare(a, b)