40 le_t* nonActor =
nullptr;
109#define LOOKUP_EPSILON 0.0001f
116 0.0f, 0.1125f, 0.2227f, 0.3286f, 0.4284f, 0.5205f, 0.6039f,
117 0.6778f, 0.7421f, 0.7969f, 0.8427f, 0.8802f, 0.9103f, 0.9340f,
118 0.9523f, 0.9661f, 0.9763f, 0.9838f, 0.9891f, 0.9928f, 0.9953f,
119 0.9970f, 0.9981f, 0.9989f, 0.9993f, 0.9996f, 0.9998f, 0.9999f,
128 1.1246f, 1.1024f, 1.0592f, 0.9977f, 0.9211f, 0.8336f, 0.7395f,
129 0.6430f, 0.5481f, 0.4579f, 0.3750f, 0.3011f, 0.2369f, 0.1828f,
130 0.1382f, 0.1024f, 0.0744f, 0.0530f, 0.0370f, 0.0253f, 0.0170f,
131 0.0112f, 0.0072f, 0.0045f, 0.0028f, 0.0017f, 0.0010f, 0.0006f,
155 ifloat = floor(z * 10.0f);
206 const int distx = fabs(shooter[0] - target[0]);
207 const int disty = fabs(shooter[1] - target[1]);
208 const float distance = sqrtf(distx * distx + disty * disty);
211 pseudosin = distance / distx;
213 pseudosin = distance / disty;
226 const float commonfactor = crouch *
torad * distance;
235 height = height / 18;
238 target[2] += height * 9;
239 float perpX = disty / distance * width;
240 float perpY = 0 - distx / distance * width;
246 target[2] += 6 * height;
251 target[2] -= 6 * height;
256 target[2] += 4 * height;
259 target[2] += 4 * height;
262 target[0] -= perpX * 3;
263 target[1] -= perpY * 3;
264 target[2] -= 12 * height;
269 target[2] += 6 * height;
274 target[2] -= 4 * height;
279 target[2] += 10 * height;
283 return 100 * (hitchance * (0.125) * n);
298 if (position[0] <
cl.mapData->mapBox.getMinX() - delta || position[0] >
cl.mapData->mapBox.getMaxX() + delta)
301 if (position[1] <
cl.mapData->mapBox.getMinY() - delta || position[1] >
cl.mapData->mapBox.getMaxY() + delta)
342void Grid_DumpWholeClientMap_f (
void)
344 RT_DumpWholeMap(
cl.mapTiles,
cl.mapData->routing);
351void Grid_DumpClientRoutes_f (
void)
365 return cl.configstrings[
index];
386 return cl.configstrings[
index];
character_t * CL_ActorGetChr(const le_t *le)
Returns the character information for an actor in the teamlist.
float CL_ActorInjuryModifier(const le_t *le, const modifier_types_t type)
Returns the actor injury modifier of the specified type.
static bool CL_TestLine(const vec3_t start, const vec3_t stop, const int levelmask)
static float CL_LookupErrorFunction(float z)
calculate approximate erf, the error function http://en.wikipedia.org/wiki/Error_function uses lookup...
bool CL_OutsideMap(const vec3_t position, const float delta)
Checks whether give position is still inside the map borders.
char * CL_GetConfigString(int index)
int CL_GetHitProbability(const le_t *actor)
Calculates chance to hit if the actor has a fire mode activated.
static const float lookupdiff[30]
table for lookup_erf lookup[]= {10*(erf(0.1)-erf(0.0)), 10*(erf(0.2)-erf(0.1)), .....
le_t * CL_BattlescapeSearchAtGridPos(const pos3_t pos, bool includingStunned, const le_t *actor)
Searches a local entity at the given position.
int CL_GetConfigStringInteger(int index)
static const float lookup[30]
table for lookup_erf lookup[]= {erf(0), erf(0.1), ...}
char * CL_SetConfigString(int index, dbuffer *msg)
int CL_CountVisibleEnemies(void)
Counts visible enemies on the battlescape.
bool CL_OnBattlescape(void)
Check whether we are in a tactical mission as server or as client. But this only means that we are ab...
static const float mapZBorder
bool CL_BattlescapeRunning(void)
Check whether we already have actors spawned on the battlefield.
le_t * LE_GetNextInUse(le_t *lastLE)
Iterate through the entities that are in use.
bool LE_IsLivingAndVisibleActor(const le_t *le)
Checks whether the given le is a living and visible actor.
le_t * LE_GetFromPos(const pos3_t pos)
Searches a local entity on a given grid field.
#define LE_IsCrouched(le)
#define LE_IsInvisible(le)
#define LE_IsSelected(le)
#define IS_MODE_FIRE_PENDING(x)
Primary header for client.
void RT_WriteCSVFiles(const Routing &routing, const char *baseFilename, const GridBox &box)
int Com_ServerState(void)
Check whether we are the server or have a singleplayer tactical mission.
void Com_Error(int code, const char *fmt,...)
bool Com_CheckConfigStringIndex(int index)
#define ACTOR_SIZE_NORMAL
#define FIRESH_IsMedikit(firedef)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
#define VecToPos(v, p)
Map boundary is +/- MAX_WORLD_WIDTH - to get into the positive area we add the possible max negative ...
int NET_ReadString(dbuffer *buf, char *string, size_t length)
#define GET_ACC(ab, sk, pn)
#define PLAYER_STANDING_HEIGHT
#define PLAYER_CROUCHING_HEIGHT
grid pathfinding and routing
Describes a character with all its attributes.
int skills[SKILL_NUM_TYPES]
This is the structure that should be used for data that is needed for tactical missions only.
actorSizeEnum_t fieldSize
struct le_s * clientAction
bool TR_TestLine(mapTiles_t *mapTiles, const vec3_t start, const vec3_t end, const int levelmask)
Checks traces against the world.
#define VectorCopy(src, dest)
#define VectorCompare(a, b)
#define VectorSet(v, x, y, z)