UFO: Alien Invasion
Loading...
Searching...
No Matches
g_move.cpp
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#include "g_move.h"
26#include "g_actor.h"
27#include "g_client.h"
28#include "g_combat.h"
29#include "g_edicts.h"
30#include "g_health.h"
31#include "g_inventory.h"
32#include "g_reaction.h"
33#include "g_utils.h"
34#include "g_vis.h"
35#include "g_match.h"
36
37#define ACTOR_SPEED_NORMAL 100
38#define ACTOR_SPEED_CROUCHED (ACTOR_SPEED_NORMAL / 2)
39static const float FALLING_DAMAGE_FACTOR = 10.0f;
40
46
59static void G_BuildForbiddenList (int team, const Edict* movingActor)
60{
61 forbiddenList.reset();
62
63 /* team visibility */
64 const teammask_t teamMask = team ? G_TeamToVisMask(team) : TEAM_ALL;
65
66 Edict* ent = nullptr;
67 while ((ent = G_EdictsGetNextInUse(ent))) {
68 /* Dead 2x2 unit will stop walking, too. */
69 if (G_IsBlockingMovementActor(ent) && (G_IsAI(movingActor) || (ent->visflags & teamMask))) {
70 forbiddenList.add(ent->pos, (byte*) &ent->fieldSize);
71 } else if (ent->type == ET_SOLID) {
72 for (int j = 0; j < ent->forbiddenListSize; j++) {
73 forbiddenList.add(ent->forbiddenListPos[j], (byte*) &ent->fieldSize);
74 }
75 }
76 }
77}
78
88void G_MoveCalc (int team, const Actor* movingActor, const pos3_t from, int distance)
89{
90 G_MoveCalcLocal(level.pathingMap, team, movingActor, from, distance);
91}
92
101void G_MoveCalcLocal (pathing_t* pt, int team, const Edict* movingActor, const pos3_t from, int distance)
102{
103 G_BuildForbiddenList(team, movingActor);
104 gi.GridCalcPathing(movingActor->fieldSize, pt, from, distance, &forbiddenList);
105}
106
107bool G_FindPath (int team, const Edict* movingActor, const pos3_t from, const pos3_t targetPos, bool crouched, int maxTUs)
108{
109 G_BuildForbiddenList(team, movingActor);
110 return gi.GridFindPath(movingActor->fieldSize, level.pathingMap, from, targetPos, crouched, maxTUs, &forbiddenList);
111}
112
119{
120 const pos_t oldZ = ent->pos[2];
121
122 ent->pos[2] = gi.GridFall(ent->fieldSize, ent->pos);
123
124 if (oldZ == ent->pos[2])
125 return;
126
127 Edict* entAtPos = G_GetEdictFromPos(ent->pos, ET_NULL);
128 if (entAtPos != nullptr && (G_IsBreakable(entAtPos) || G_IsBlockingMovementActor(entAtPos))) {
129 const int diff = oldZ - ent->pos[2];
130 G_TakeDamage(entAtPos, (int)(FALLING_DAMAGE_FACTOR * (float)diff));
131 }
132
133 ent->calcOrigin();
134 gi.LinkEdict(ent);
135
136 G_CheckVis(ent);
137
138 G_EventActorFall(*ent);
139
140 G_EventEnd();
141}
142
151static bool G_ActorShouldStopInMidMove (const Edict* ent, int visState, dvec_t* dvtab, int max)
152{
153 if (visState & VIS_STOP)
154 return true;
155
156 /* check that the appearing unit is not on a grid position the actor wanted to walk to.
157 * this might be the case if the edict got visible in mid mode */
158 if (visState & VIS_APPEAR) {
159 pos3_t pos;
160 VectorCopy(ent->pos, pos);
161 while (max >= 0) {
162 int tmp = 0;
163
164 PosAddDV(pos, tmp, dvtab[max]);
165 max--;
166 const Actor* blockEdict = G_EdictsGetLivingActorFromPos(pos);
167
168 if (blockEdict && G_IsBlockingMovementActor(blockEdict)) {
169 const bool visible = G_IsVisibleForTeam(blockEdict, ent->getTeam());
170 if (visible)
171 return true;
172 }
173 }
174 }
175 return false;
176}
177
178static void G_SendFootstepSound (Edict* ent, const int contentFlags)
179{
180 const char* snd = nullptr;
181
182 if (contentFlags & CONTENTS_WATER) {
183 if (ent->contentFlags & CONTENTS_WATER) {
184 /* looks like we already are in the water */
185 /* send water moving sound */
186 snd = "footsteps/water_under";
187 } else {
188 /* send water entering sound */
189 snd = "footsteps/water_in";
190 }
191 } else if (ent->contentFlags & CONTENTS_WATER) {
192 /* send water leaving sound */
193 snd = "footsteps/water_out";
194 } else if (Q_strvalid(ent->chr.teamDef->footstepSound)) {
195 /* some teams have a fixed footstep or moving sound */
196 snd = ent->chr.teamDef->footstepSound;
197 } else {
198 /* we should really hit the ground with this */
199 const vec3_t to = {ent->origin[0], ent->origin[1], ent->origin[2] - UNIT_HEIGHT};
200 const trace_t trace = G_Trace(Line(ent->origin, to), nullptr, MASK_SOLID);
201 if (trace.surface) {
202 snd = gi.GetFootstepSound(trace.surface->name);
203 }
204 }
205 if (snd != nullptr) {
206 G_EventSpawnFootstepSound(*ent, snd);
207 }
208}
209
216static void G_WriteStep (Actor* ent, const int dvec, const int contentFlags)
217{
218 /* write move header if not yet done */
219 if (gi.GetEvent() != EV_ACTOR_MOVE) {
221 }
222
223 if (ent->moveinfo.steps >= MAX_ROUTE) {
224 ent->moveinfo.steps = 0;
225 }
226 gi.WriteByte(ent->moveinfo.steps);
227
228 /* write move header and always one step after another - because the next step
229 * might already be the last one due to some stop event */
230 gi.WriteShort(dvec);
231 gi.WriteShort(ent->speed);
232 gi.WriteShort(contentFlags);
233
234 /* Send the sound effect to everyone who's not seeing the actor */
235 if (!ent->isCrouched()) {
236 G_SendFootstepSound(ent, contentFlags);
237 }
238
239 ent->contentFlags = contentFlags;
240
241 ent->moveinfo.steps++;
242}
243
244int G_FillDirectionTable (dvec_t* dvtab, size_t dvtabSize, byte crouchingState, pos3_t pos)
245{
246 int dvec;
247 int numdv = 0;
248 while ((dvec = gi.MoveNext(level.pathingMap, pos, crouchingState)) != ROUTING_UNREACHABLE) {
249 const int oldZ = pos[2];
250 /* dvec indicates the direction traveled to get to the new cell and the original cell height. */
251 /* We are going backwards to the origin. */
252 PosSubDV(pos, crouchingState, dvec);
253 /* Replace the z portion of the DV value so we can get back to where we were. */
254 dvtab[numdv++] = setDVz(dvec, oldZ);
255 if (numdv >= dvtabSize)
256 break;
257 }
258
259 return numdv;
260}
261
270pos_t G_ActorMoveLength (const Actor* actor, const pathing_t* path, const pos3_t to, bool stored)
271{
272 byte crouchingState = actor->isCrouched() ? 1 : 0;
273 const pos_t length = gi.MoveLength(path, to, crouchingState, stored);
274
276 return length;
277
278 pos3_t pos;
279 VectorCopy(to, pos);
280 int dvec, numSteps = 0;
281 while ((dvec = gi.MoveNext(level.pathingMap, pos, crouchingState)) != ROUTING_UNREACHABLE) {
282 ++numSteps;
283 PosSubDV(pos, crouchingState, dvec); /* We are going backwards to the origin. */
284 }
285
286 const bool useAutostand = crouchingState && (G_IsAI(actor) || actor->getPlayer().autostand)
287 && gi.GridShouldUseAutostand(path, to);
288 const int autostandTU = useAutostand ? 2 * TU_CROUCH : 0;
289
290 return std::min(ROUTING_NOT_REACHABLE, length + static_cast<int>(numSteps *
291 G_ActorGetInjuryPenalty(actor, MODIFIER_MOVEMENT)) + autostandTU);
292}
293
307void G_ClientMove (const Player& player, int visTeam, Actor* actor, const pos3_t to)
308{
309 if (VectorCompare(actor->pos, to))
310 return;
311
312 /* check if action is possible */
314 return;
315
316 bool autoCrouchRequired = false;
317 byte crouchingState = actor->isCrouched() ? 1 : 0;
318
319 /* calculate move table */
320 G_MoveCalc(visTeam, actor, actor->pos, actor->TU);
321
322 /* Autostand: check if the actor is crouched and player wants autostanding...*/
323 if (crouchingState && (G_IsAI(actor) || player.autostand)) {
324 /* ...and if this is a long walk... */
325 if (gi.CanActorStandHere(actor->fieldSize, actor->pos)
326 && gi.GridShouldUseAutostand(level.pathingMap, to)) {
327 /* ...make them stand first. If the player really wants them to walk a long
328 * way crouched, he can move the actor in several stages.
329 * Uses the threshold at which standing, moving and crouching again takes
330 * fewer TU than just crawling while crouched. */
331 G_ClientStateChange(player, actor, STATE_CROUCHED, true); /* change to stand state */
332 crouchingState = actor->isCrouched() ? 1 : 0;
333 if (!crouchingState)
334 autoCrouchRequired = true;
335 }
336 }
337
338 const pos_t length = std::min(G_ActorMoveLength(actor, level.pathingMap, to, false)
339 + (autoCrouchRequired ? TU_CROUCH : 0), ROUTING_NOT_REACHABLE);
340 /* length of ROUTING_NOT_REACHABLE means not reachable */
342 return;
343
344 /* assemble dvec-encoded move data */
345 pos3_t pos;
346 VectorCopy(to, pos);
347
348 dvec_t dvtab[MAX_ROUTE];
349 byte numdv = G_FillDirectionTable(dvtab, lengthof(dvtab), crouchingState, pos);
350
351 /* make sure to end any other pending events - we rely on EV_ACTOR_MOVE not being active anymore */
352 G_EventEnd();
353
354 /* everything ok, found valid route? */
355 if (VectorCompare(pos, actor->pos)) {
356 /* no floor inventory at this point */
357 actor->resetFloor();
358
359 if (!G_IsCivilian(actor))
360 G_EventMoveCameraTo(G_VisToPM(actor->visflags & ~G_TeamToVisMask(actor->getTeam())), actor->pos);
361
362 actor->moveinfo.steps = 0;
364 const int initTU = actor->TU;
365 int usedTUs = 0;
366 const int movingModifier = G_ActorGetInjuryPenalty(actor, MODIFIER_MOVEMENT);
367 while (numdv > 0) {
368 const int step = actor->moveinfo.steps;
369 const byte oldDir = actor->dir;
370
371 /* get next dvec */
372 numdv--;
373 const int dvec = dvtab[numdv];
374 /* This is the direction to make the step into */
375 const int dir = getDVdir(dvec);
376
377 /* turn around first */
378 int status = G_ActorDoTurn(actor, dir);
379 if ((status & VIS_STOP) && visTeam != 0) {
380 autoCrouchRequired = false;
381 if (step == 0) {
382 usedTUs += TU_TURN;
383 }
384 break;
385 }
386
387 if (visTeam != 0 && G_ActorShouldStopInMidMove(actor, status, dvtab, numdv)) {
388 /* don't autocrouch if new enemy becomes visible */
389 autoCrouchRequired = false;
390 /* if something appears on our route that didn't trigger a VIS_STOP, we have to
391 * send the turn event if this is our first step */
392 if (oldDir != actor->dir && step == 0) {
393 G_EventActorTurn(*actor);
394 usedTUs += TU_TURN;
395 }
396 break;
397 }
398
399 /* decrease TUs */
400 const float div = gi.GetTUsForDirection(dir, actor->isCrouched());
401 const int stepTUs = div + movingModifier;
402 if (usedTUs + stepTUs > actor->TU)
403 break;
404 usedTUs += stepTUs;
405
406 /* This is now a flag to indicate a change in crouching - we need this for
407 * the stop in mid move call(s), because we need the updated entity position */
408 int crouchFlag = 0;
409 /* Calculate the new position after the decrease in TUs, otherwise the game
410 * remembers the false position if the time runs out */
411 PosAddDV(actor->pos, crouchFlag, dvec);
412
413 /* slower if crouched */
414 if (actor->isCrouched())
416 else
417 actor->speed = ACTOR_SPEED_NORMAL;
418 actor->speed *= g_actorspeed->value;
419
420 const int oldState = actor->state;
421 const int oldHP = actor->HP;
422 const int oldSTUN = actor->getStun();
423 if (crouchFlag == 0) { /* No change in crouch */
424 actor->calcOrigin();
425
426 /* link it at new position - this must be done for every edict
427 * movement - to let the server know about it. */
428 gi.LinkEdict(actor);
429
430 /* Only the PHALANX team has these stats right now. */
431 if (actor->chr.scoreMission) {
432 const float truediv = gi.GetTUsForDirection(dir, 0); /* regardless of crouching ! */
433 if (actor->isCrouched())
434 actor->chr.scoreMission->movedCrouched += truediv;
435 else
436 actor->chr.scoreMission->movedNormal += truediv;
437 }
438 /* write the step to the net */
439 const int contentFlags = G_ActorGetContentFlags(actor->origin);
440 G_WriteStep(actor, dvec, contentFlags);
441
442 status = 0;
443
444 /* Set actor->TU because the reaction code relies on actor->TU being accurate. */
445 G_ActorSetTU(actor, initTU - usedTUs);
446
447 Edict* clientAction = actor->clientAction;
448 /* check triggers at new position */
449 if (G_TouchTriggers(actor)) {
450 if (!clientAction)
451 status |= VIS_STOP;
452 }
453
454 /* check if player appears/perishes, seen from other teams */
455 G_CheckVis(actor);
456
457 /* check for anything appearing, seen by "the moving one" */
458 status |= G_CheckVisTeamAll(actor->getTeam(), 0, actor);
459
460 G_TouchSolids(actor, 10.0f);
461
462 /* state has changed - maybe we walked on a trigger_hurt */
463 if (oldState != actor->state || oldHP != actor->HP || oldSTUN != actor->getStun())
464 status |= VIS_STOP;
465 } else if (crouchFlag == 1) {
466 /* Actor is standing */
467 G_ClientStateChange(player, actor, STATE_CROUCHED, true);
468 } else if (crouchFlag == -1) {
469 /* Actor is crouching and should stand up */
470 G_ClientStateChange(player, actor, STATE_CROUCHED, false);
471 }
472
473 /* check for reaction fire */
474 if (G_ReactionFireOnMovement(actor, step)) {
475 status |= VIS_STOP;
476
477 autoCrouchRequired = false;
478 }
479
480 /* check for death */
481 if (oldHP != actor->HP || oldSTUN != actor->getStun() || oldState != actor->state) {
483 /* maybe this was due to rf - then the G_ActorDie was already called */
484 if (!actor->isDead()) {
485 G_CheckDeathOrKnockout(actor, nullptr, nullptr, (oldHP - actor->HP) + (actor->getStun() - oldSTUN));
486 }
488 autoCrouchRequired = false;
489 break;
490 }
491
492 if (visTeam != 0 && G_ActorShouldStopInMidMove(actor, status, dvtab, numdv - 1)) {
493 /* don't autocrouch if new enemy becomes visible */
494 autoCrouchRequired = false;
495 break;
496 }
497
498 /* Restore actor->TU because the movement code relies on it not being modified! */
499 G_ActorSetTU(actor, initTU);
500 }
501
502 /* submit the TUs / round down */
503 G_ActorSetTU(actor, initTU - usedTUs);
504
505 G_SendStats(*actor);
506
507 /* end the move */
508 G_GetFloorItems(actor);
509 G_EventEnd();
510 }
511
512 if (autoCrouchRequired) {
513 /* toggle back to crouched state */
514 G_ClientStateChange(player, actor, STATE_CROUCHED, true);
515 }
516
518}
@ MODIFIER_MOVEMENT
Definition chr_shared.h:258
static forbiddenList_t forbiddenList
A list of locations that cannot be moved to.
Definition cl_actor.cpp:602
An Edict of type Actor.
Definition g_edict.h:348
bool isDead() const
Definition g_edict.h:362
bool isCrouched() const
Definition g_edict.h:361
teammask_t visflags
Definition g_edict.h:82
int TU
Definition g_edict.h:88
character_t chr
Definition g_edict.h:116
int getIdNum() const
Definition g_edict.h:231
vec3_t origin
Definition g_edict.h:53
pos3_t pos
Definition g_edict.h:55
moveinfo_t moveinfo
Definition g_edict.h:160
actorSizeEnum_t fieldSize
Definition g_edict.h:141
int HP
Definition g_edict.h:89
byte dir
Definition g_edict.h:86
pos3_t * forbiddenListPos
Definition g_edict.h:173
int contentFlags
Definition g_edict.h:84
Edict * clientAction
Definition g_edict.h:113
void resetFloor()
Definition g_edict.h:210
int getTeam() const
Definition g_edict.h:269
void calcOrigin()
Calculate the edict's origin vector from it's grid position.
Definition g_edict.h:216
Player & getPlayer() const
Definition g_edict.h:265
entity_type_t type
Definition g_edict.h:81
int speed
Definition g_edict.h:124
int getStun() const
Definition g_edict.h:308
int forbiddenListSize
Definition g_edict.h:175
int state
Definition g_edict.h:93
Definition line.h:31
#define ROUTING_NOT_REACHABLE
Definition defines.h:283
#define MAX_ROUTE
Definition defines.h:84
#define TU_MOVE_STRAIGHT
Definition defines.h:74
#define UNIT_HEIGHT
Definition defines.h:122
#define TU_TURN
Definition defines.h:73
#define ROUTING_UNREACHABLE
Definition defines.h:284
#define TU_CROUCH
Definition defines.h:72
#define CONTENTS_WATER
Definition defines.h:226
#define MASK_SOLID
Definition defines.h:272
void G_ActorSetTU(Edict *ent, int tus)
Definition g_actor.cpp:267
int G_ActorDoTurn(Edict *ent, byte dir)
Turns an actor around.
Definition g_actor.cpp:154
int G_ActorGetContentFlags(const vec3_t origin)
Get the content flags from where the actor is currently standing.
Definition g_actor.cpp:484
bool G_ActionCheckForCurrentTeam(const Player &player, Actor *ent, int TU)
Checks whether the requested action is possible for the current active team.
Definition g_client.cpp:380
void G_ClientStateChange(const Player &player, Actor *actor, int reqState, bool checkaction)
Changes the state of a player/soldier.
Definition g_client.cpp:473
playermask_t G_VisToPM(teammask_t teamMask)
Converts vis mask to player mask.
Definition g_client.cpp:186
Interface for g_client.cpp.
void G_CheckDeathOrKnockout(Actor *target, Actor *attacker, const fireDef_t *fd, int damage)
Definition g_combat.cpp:499
All parts of the main game logic that are combat related.
Edict * G_EdictsGetNextInUse(Edict *lastEnt)
Iterate through the entities that are in use.
Definition g_edicts.cpp:166
Actor * G_EdictsGetLivingActorFromPos(const pos3_t pos)
Searches an actor at the given grid location.
Definition g_edicts.cpp:270
functions to handle the storage and lifecycle of all edicts in the game module.
void G_EventEnd(void)
Definition g_events.cpp:711
void G_EventSpawnFootstepSound(const Edict &ent, const char *sound)
Definition g_events.cpp:62
void G_EventAdd(playermask_t playerMask, int eType, int entnum)
Definition g_events.cpp:705
void G_EventActorTurn(const Edict &ent)
Send the turn event for the given entity.
Definition g_events.cpp:77
void G_EventMoveCameraTo(playermask_t playerMask, const pos3_t pos)
Centers the view for all clients that are seeing the given edict on the world position of the edict.
Definition g_events.cpp:501
void G_EventActorFall(const Edict &ent)
Definition g_events.cpp:345
#define PM_ALL
Definition g_events.h:36
float G_ActorGetInjuryPenalty(const Edict *const ent, const modifier_types_t type)
Returns the penalty to the given stat caused by the actor wounds.
Definition g_health.cpp:177
Edict * G_GetFloorItems(Edict *ent)
Prepares a list of items on the floor at given entity position.
level_locals_t level
Definition g_main.cpp:38
#define G_IsAI(ent)
Definition g_local.h:141
#define G_IsBreakable(ent)
Definition g_local.h:137
#define G_IsVisibleForTeam(ent, team)
Definition g_local.h:144
#define G_TeamToVisMask(team)
Definition g_local.h:143
void G_SendStats(Edict &ent)
Send stats to network buffer.
Definition g_stats.cpp:34
game_import_t gi
Definition g_main.cpp:39
#define G_IsCivilian(ent)
Definition g_local.h:148
#define G_IsBlockingMovementActor(ent)
Definition g_local.h:150
cvar_t * g_actorspeed
Definition g_main.cpp:119
void G_MatchEndCheck(void)
Checks whether there are still actors to fight with left. If none are the match end will be triggered...
Definition g_match.cpp:280
Match related functions.
int G_FillDirectionTable(dvec_t *dvtab, size_t dvtabSize, byte crouchingState, pos3_t pos)
Definition g_move.cpp:244
#define ACTOR_SPEED_CROUCHED
Definition g_move.cpp:38
pos_t G_ActorMoveLength(const Actor *actor, const pathing_t *path, const pos3_t to, bool stored)
Return the needed TUs to walk to a given position.
Definition g_move.cpp:270
static const float FALLING_DAMAGE_FACTOR
Definition g_move.cpp:39
static void G_WriteStep(Actor *ent, const int dvec, const int contentFlags)
Writes a step of the move event to the net.
Definition g_move.cpp:216
void G_ClientMove(const Player &player, int visTeam, Actor *actor, const pos3_t to)
Generates the client events that are send over the netchannel to move an actor.
Definition g_move.cpp:307
static void G_SendFootstepSound(Edict *ent, const int contentFlags)
Definition g_move.cpp:178
static void G_BuildForbiddenList(int team, const Edict *movingActor)
Build the forbidden list for the pathfinding (server side).
Definition g_move.cpp:59
bool G_FindPath(int team, const Edict *movingActor, const pos3_t from, const pos3_t targetPos, bool crouched, int maxTUs)
Definition g_move.cpp:107
void G_MoveCalcLocal(pathing_t *pt, int team, const Edict *movingActor, const pos3_t from, int distance)
Same as G_MoveCalc, except that it uses the pathing table passed as the first param.
Definition g_move.cpp:101
static bool G_ActorShouldStopInMidMove(const Edict *ent, int visState, dvec_t *dvtab, int max)
Checks whether the actor should stop movement.
Definition g_move.cpp:151
void G_ActorFall(Edict *ent)
Let an actor fall down if e.g. the func_breakable the actor was standing on was destroyed.
Definition g_move.cpp:118
#define ACTOR_SPEED_NORMAL
Definition g_move.cpp:37
void G_MoveCalc(int team, const Actor *movingActor, const pos3_t from, int distance)
Precalculates a move table for a given team and a given starting position. This will calculate a rout...
Definition g_move.cpp:88
bool G_ReactionFireOnMovement(Actor *target, int step)
Called when 'target' moves, possibly triggering or resolving reaction fire.
void G_ReactionFireNotifyClientEndMove(const Actor *target)
void G_ReactionFireNotifyClientStartMove(const Actor *target)
Reaction fire system.
Edict * G_GetEdictFromPos(const pos3_t pos, const entity_type_t type)
Searches an edict of the given type at the given grid location.
Definition g_utils.cpp:59
trace_t G_Trace(const Line &trLine, const Edict *passent, int contentmask)
collision detection - this version is more accurate and includes entity tests
Definition g_utils.cpp:265
void G_TakeDamage(Edict *ent, int damage)
Applies the given damage value to an edict that is either an actor or has the FL_DESTROYABLE flag set...
Definition g_utils.cpp:215
int G_TouchSolids(Edict *ent, float extend)
Call after making a step to a new grid tile to immediately touch edicts whose bbox intersects with th...
Definition g_utils.cpp:590
int G_TouchTriggers(Edict *ent, const entity_type_t type)
Check the world against triggers for the current entity.
Definition g_utils.cpp:547
Misc utility functions for game module.
int G_CheckVisTeamAll(const int team, const vischeckflags_t visFlags, const Edict *ent)
Do G_CheckVisTeam for all entities ent is the one that is looking at the others.
Definition g_vis.cpp:376
void G_CheckVis(Edict *check, const vischeckflags_t visFlags)
Check if the edict appears/perishes for the other teams. If they appear for other teams,...
Definition g_vis.cpp:409
#define VIS_STOP
Definition g_vis.h:40
#define VIS_APPEAR
Definition g_vis.h:36
unsigned int teammask_t
Definition g_vis.h:30
#define TEAM_ALL
Definition g_vis.h:32
#define PosSubDV(p, crouch, dv)
Definition mathlib.h:254
#define PosAddDV(p, crouch, dv)
Definition mathlib.h:253
#define setDVz(dv, z)
Definition mathlib.h:248
short dvec_t
The direction vector tells us where the actor came from (in his previous step). The pathing table hol...
Definition mathlib.h:236
#define getDVdir(dv)
Definition mathlib.h:249
@ EV_ACTOR_MOVE
Definition q_shared.h:100
@ ET_SOLID
Definition q_shared.h:166
@ ET_NULL
Definition q_shared.h:146
#define STATE_CROUCHED
Definition q_shared.h:263
QGL_EXTERN GLuint GLsizei GLsizei * length
Definition r_gl.h:110
#define Q_strvalid(string)
Definition shared.h:141
#define lengthof(x)
Definition shared.h:105
char name[MAX_QPATH]
Definition typedefs.h:38
const teamDef_t * teamDef
Definition chr_shared.h:413
chrScoreMission_t * scoreMission
Definition chr_shared.h:407
A list of locations that cannot be moved to.
Definition grid.h:35
byte steps
Definition g_local.h:278
char footstepSound[MAX_VAR]
Definition chr_shared.h:312
cBspSurface_t * surface
Definition tracing.h:61
pos_t pos3_t[3]
Definition ufotypes.h:58
byte pos_t
Definition ufotypes.h:57
vec_t vec3_t[3]
Definition ufotypes.h:39
#define VectorCopy(src, dest)
Definition vector.h:51
#define VectorCompare(a, b)
Definition vector.h:63