mirror of
https://github.com/yquake2/xatrix.git
synced 2025-06-03 10:30:57 +00:00
Remove superfluous whitespaces and end of lines
With this commit 'xatrix' is cleaned up. Every single line was audited, many bugs removed and hundered of sanity checks added. Additionally the code was reformated. All in all 'Xatrix' should now be much more reliable and for the first time in ~15 years completeable without any crashes, logic bugs or the like. Until now about 130 hours spread over more than a year were spend for this project. Of course this code is totaly untested. The next step is testing, testing and testing. After that the spawn points needs to be fixed so that all maps can pe started by "map $mapname".
This commit is contained in:
parent
1fb978cfeb
commit
00f0bb8df1
52 changed files with 2194 additions and 2194 deletions
68
src/g_ai.c
68
src/g_ai.c
|
@ -21,7 +21,7 @@ float enemy_yaw;
|
|||
* Called once each frame to set level.sight_client
|
||||
* to the player to be checked for in findtarget.
|
||||
* If all clients are either dead or in notarget,
|
||||
* sight_client will be null. In coop games,
|
||||
* sight_client will be null. In coop games,
|
||||
* sight_client will cycle between the clients.
|
||||
*/
|
||||
void
|
||||
|
@ -72,7 +72,7 @@ AI_SetSightClient(void)
|
|||
|
||||
/*
|
||||
* Move the specified distance at current
|
||||
* facing. This replaces the QC functions:
|
||||
* facing. This replaces the QC functions:
|
||||
* ai_forward, ai_back, ai_pain, and ai_painforward
|
||||
*/
|
||||
void
|
||||
|
@ -82,7 +82,7 @@ ai_move(edict_t *self, float dist)
|
|||
}
|
||||
|
||||
/*
|
||||
* Used for standing around and looking for
|
||||
* Used for standing around and looking for
|
||||
* players. Distance is for slight position
|
||||
* adjustments needed by the animations
|
||||
*/
|
||||
|
@ -187,7 +187,7 @@ ai_walk(edict_t *self, float dist)
|
|||
|
||||
/*
|
||||
* Turns towards target and advances.
|
||||
* Use this call with a distnace of 0
|
||||
* Use this call with a distnace of 0
|
||||
* to replace ai_face
|
||||
*/
|
||||
void
|
||||
|
@ -217,7 +217,7 @@ ai_charge(edict_t *self, float dist)
|
|||
*/
|
||||
void
|
||||
ai_turn(edict_t *self, float dist)
|
||||
{
|
||||
{
|
||||
if (!self)
|
||||
{
|
||||
return;
|
||||
|
@ -278,7 +278,7 @@ range(edict_t *self, edict_t *other)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
VectorSubtract(self->s.origin, other->s.origin, v);
|
||||
len = VectorLength(v);
|
||||
|
||||
|
@ -331,7 +331,7 @@ visible(edict_t *self, edict_t *other)
|
|||
}
|
||||
|
||||
/*
|
||||
* returns 1 if the entity is in
|
||||
* returns 1 if the entity is in
|
||||
* front (in sight) of self
|
||||
*/
|
||||
qboolean
|
||||
|
@ -400,12 +400,12 @@ HuntTarget(edict_t *self)
|
|||
|
||||
void
|
||||
FoundTarget(edict_t *self)
|
||||
{
|
||||
{
|
||||
if (!self)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* let other monsters see this monster for a while */
|
||||
if (self->enemy->client)
|
||||
{
|
||||
|
@ -452,8 +452,8 @@ FoundTarget(edict_t *self)
|
|||
/*
|
||||
* Self is currently not attacking anything, so try
|
||||
* to find a target. Returns TRUE if an enemy was sighted.
|
||||
* When a player fires a missile, the point of impact
|
||||
* becomes a fakeplayer so that monsters that see the
|
||||
* When a player fires a missile, the point of impact
|
||||
* becomes a fakeplayer so that monsters that see the
|
||||
* impact will respond as if they had seen the player.
|
||||
*
|
||||
* To avoid spending too much time, only a single client
|
||||
|
@ -466,12 +466,12 @@ FindTarget(edict_t *self)
|
|||
edict_t *client;
|
||||
qboolean heardit;
|
||||
int r;
|
||||
|
||||
|
||||
if (!self)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (self->monsterinfo.aiflags & AI_GOOD_GUY)
|
||||
{
|
||||
return false;
|
||||
|
@ -483,7 +483,7 @@ FindTarget(edict_t *self)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* if the first spawnflag bit is set, the
|
||||
/* if the first spawnflag bit is set, the
|
||||
monster will only wake up on really seeing
|
||||
the player, not another monster getting angry
|
||||
or hearing something */
|
||||
|
@ -677,7 +677,7 @@ FindTarget(edict_t *self)
|
|||
qboolean
|
||||
FacingIdeal(edict_t *self)
|
||||
{
|
||||
float delta;
|
||||
float delta;
|
||||
|
||||
if (!self)
|
||||
{
|
||||
|
@ -702,12 +702,12 @@ M_CheckAttack(edict_t *self)
|
|||
vec3_t spot1, spot2;
|
||||
float chance;
|
||||
trace_t tr;
|
||||
|
||||
|
||||
if (!self)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (self->enemy->health > 0)
|
||||
{
|
||||
/* see if any entities are in the way of the shot */
|
||||
|
@ -817,17 +817,17 @@ M_CheckAttack(edict_t *self)
|
|||
}
|
||||
|
||||
/*
|
||||
* Turn and close until within
|
||||
* Turn and close until within
|
||||
* an angle to launch a melee attack
|
||||
*/
|
||||
void
|
||||
ai_run_melee(edict_t *self)
|
||||
{
|
||||
{
|
||||
if (!self)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
self->ideal_yaw = enemy_yaw;
|
||||
M_ChangeYaw(self);
|
||||
|
||||
|
@ -839,17 +839,17 @@ ai_run_melee(edict_t *self)
|
|||
}
|
||||
|
||||
/*
|
||||
* Turn in place until within
|
||||
* Turn in place until within
|
||||
* an angle to launch a missile attack
|
||||
*/
|
||||
void
|
||||
ai_run_missile(edict_t *self)
|
||||
{
|
||||
{
|
||||
if (!self)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
self->ideal_yaw = enemy_yaw;
|
||||
M_ChangeYaw(self);
|
||||
|
||||
|
@ -861,13 +861,13 @@ ai_run_missile(edict_t *self)
|
|||
}
|
||||
|
||||
/*
|
||||
* Strafe sideways, but stay
|
||||
* Strafe sideways, but stay
|
||||
* at aproximately the same range
|
||||
*/
|
||||
void
|
||||
ai_run_slide(edict_t *self, float distance)
|
||||
{
|
||||
float ofs;
|
||||
float ofs;
|
||||
|
||||
if (!self)
|
||||
{
|
||||
|
@ -896,7 +896,7 @@ ai_run_slide(edict_t *self, float distance)
|
|||
}
|
||||
|
||||
/*
|
||||
* Decides if we're going to
|
||||
* Decides if we're going to
|
||||
* attack or do something else
|
||||
*/
|
||||
qboolean
|
||||
|
@ -904,13 +904,13 @@ ai_checkattack(edict_t *self, float dist)
|
|||
{
|
||||
vec3_t temp;
|
||||
qboolean hesDeadJim;
|
||||
|
||||
|
||||
if (!self)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* this causes monsters to run blindly
|
||||
|
||||
/* this causes monsters to run blindly
|
||||
to the combat point w/o firing */
|
||||
if (self->goalentity)
|
||||
{
|
||||
|
@ -1005,8 +1005,8 @@ ai_checkattack(edict_t *self, float dist)
|
|||
else
|
||||
{
|
||||
/* we need the pausetime otherwise the stand code
|
||||
will just revert to walking with no target and
|
||||
the monsters will wonder around aimlessly trying
|
||||
will just revert to walking with no target and
|
||||
the monsters will wonder around aimlessly trying
|
||||
to hunt the world entity */
|
||||
self->monsterinfo.pausetime = level.time + 100000000;
|
||||
self->monsterinfo.stand(self);
|
||||
|
@ -1052,7 +1052,7 @@ ai_checkattack(edict_t *self, float dist)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* if enemy is not currently
|
||||
/* if enemy is not currently
|
||||
visible, we will never attack */
|
||||
if (!enemy_vis)
|
||||
{
|
||||
|
@ -1078,12 +1078,12 @@ ai_run(edict_t *self, float dist)
|
|||
vec3_t v_forward, v_right;
|
||||
float left, center, right;
|
||||
vec3_t left_target, right_target;
|
||||
|
||||
|
||||
if (!self)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* if we're going to a combat point, just proceed */
|
||||
if (self->monsterinfo.aiflags & AI_COMBAT_POINT)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue