25 #include "../client.h"
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.0
f);
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);
336 #include "../../common/routing.h"
342 void Grid_DumpWholeClientMap_f (
void)
351 void Grid_DumpClientRoutes_f (
void)
363 Com_Error(
ERR_DROP,
"invalid access to configstring array with index: %i", index);
376 Com_Error(
ERR_DROP,
"invalid access to configstring array with index: %i", index);
#define VectorCopy(src, dest)
le_t * CL_BattlescapeSearchAtGridPos(const pos3_t pos, bool includingStunned, const le_t *actor)
Searches a local entity at the given position.
#define VectorSet(v, x, y, z)
#define LE_IsCrouched(le)
static const float mapZBorder
This is the structure that should be used for data that is needed for tactical missions only...
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...
void RT_WriteCSVFiles(const Routing &routing, const char *baseFilename, const GridBox &box)
char * CL_GetConfigString(int index)
char configstrings[MAX_CONFIGSTRINGS][MAX_TOKEN_CHARS]
#define LE_IsInvisible(le)
struct le_s * clientAction
bool CL_OutsideMap(const vec3_t position, const float delta)
Checks whether give position is still inside the map borders.
character_t * CL_ActorGetChr(const le_t *le)
Returns the character information for an actor in the teamlist.
static const float lookupdiff[30]
table for lookup_erf lookup[]= {10*(erf(0.1)-erf(0.0)), 10*(erf(0.2)-erf(0.1)), ...}
float CL_ActorInjuryModifier(const le_t *le, const modifier_types_t type)
Returns the actor injury modifier of the specified type.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
int CL_GetConfigStringInteger(int index)
le_t * LE_GetFromPos(const pos3_t pos)
Searches a local entity on a given grid field.
static bool CL_TestLine(const vec3_t start, const vec3_t stop, const int levelmask)
void Com_Error(int code, const char *fmt,...)
actorSizeEnum_t fieldSize
int NET_ReadString(dbuffer *buf, char *string, size_t length)
static const float lookup[30]
table for lookup_erf lookup[]= {erf(0), erf(0.1), ...}
#define LE_IsSelected(le)
#define GET_ACC(ab, sk, pn)
#define VecToPos(v, p)
Map boundary is +/- MAX_WORLD_WIDTH - to get into the positive area we add the possible max negative ...
#define FIRESH_IsMedikit(firedef)
bool LE_IsLivingAndVisibleActor(const le_t *le)
Checks whether the given le is a living and visible actor.
#define IS_MODE_FIRE_PENDING(x)
int CL_CountVisibleEnemies(void)
Counts visible enemies on the battlescape.
bool CL_BattlescapeRunning(void)
Check whether we already have actors spawned on the battlefield.
int CL_GetHitProbability(const le_t *actor)
Calculates chance to hit if the actor has a fire mode activated.
bool Com_CheckConfigStringIndex(int index)
#define VectorCompare(a, b)
le_t * LE_GetNextInUse(le_t *lastLE)
Iterate through the entities that are in use.
#define PLAYER_CROUCHING_HEIGHT
bool TR_TestLine(mapTiles_t *mapTiles, const vec3_t start, const vec3_t end, const int levelmask)
Checks traces against the world.
static float CL_LookupErrorFunction(float z)
calculate approximate erf, the error function http://en.wikipedia.org/wiki/Error_function uses lookup...
char * CL_SetConfigString(int index, dbuffer *msg)
#define ACTOR_SIZE_NORMAL
int Com_ServerState(void)
Check whether we are the server or have a singleplayer tactical mission.
int skills[SKILL_NUM_TYPES]
#define PLAYER_STANDING_HEIGHT
Describes a character with all its attributes.