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:
Yamagi Burmeister 2013-02-12 18:49:17 +01:00
parent 1fb978cfeb
commit 00f0bb8df1
52 changed files with 2194 additions and 2194 deletions

View file

@ -31,4 +31,4 @@ The Reckoning 1.03 to 1.04RC:
The Reckoning 1.02 to 1.03:
- Added License
- Added Readme
- Added Readme

View file

@ -39,10 +39,10 @@ endif
# ----------
# Base CFLAGS.
# Base CFLAGS.
#
# -O2 are enough optimizations.
#
#
# -fno-strict-aliasing since the source doesn't comply
# with strict aliasing rules and it's next to impossible
# to get it there...
@ -59,7 +59,7 @@ endif
# -MMD to generate header dependencies.
ifeq ($(OSTYPE), Darwin)
CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
-Wall -pipe -g -arch i386 -arch x86_64
-Wall -pipe -g -arch i386 -arch x86_64
else
CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
-Wall -pipe -g -MMD
@ -69,7 +69,7 @@ endif
# Base LDFLAGS.
ifeq ($(OSTYPE), Darwin)
LDFLAGS := -shared -arch i386 -arch x86_64
LDFLAGS := -shared -arch i386 -arch x86_64
else
LDFLAGS := -shared
endif
@ -101,7 +101,7 @@ endif
ifeq ($(OSTYPE), Windows)
clean:
@echo "===> CLEAN"
@-rmdir /S /Q release build
@-rmdir /S /Q release build
else
clean:
@echo "===> CLEAN"
@ -134,7 +134,7 @@ build/%.o: %.c
release/game.so : CFLAGS += -fPIC
endif
# ----------
XATRIX_OBJS_ = \
@ -189,7 +189,7 @@ XATRIX_OBJS_ = \
src/savegame/savegame.o \
src/shared/flash.o \
src/shared/rand.o \
src/shared/shared.o
src/shared/shared.o
# ----------
@ -217,5 +217,5 @@ release/game.so : $(XATRIX_OBJS)
@echo "===> LD $@"
${Q}$(CC) $(LDFLAGS) -o $@ $(XATRIX_OBJS)
endif
# ----------

4
README
View file

@ -1,8 +1,8 @@
This is a bugfixed version of id Software's Quake II missionpack
"The Reckoning", developed by Xatrix Software. Hundred bugs were
"The Reckoning", developed by Xatrix Software. Hundred bugs were
fixed, this version should run much more stable than the the old
SDK version. It must be used with the "Yamagi Quake II Client".
For more information visit http://www.yamagi.org/quake2.
For more information visit http://www.yamagi.org/quake2.
Installation for FreeBSD, Linux and OpenBSD:
--------------------------------------------

View file

@ -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)
{

View file

@ -3,7 +3,7 @@
* Game command processing.
*
* =======================================================================
*/
*/
#include "header/local.h"
#include "monster/misc/player.h"
@ -15,12 +15,12 @@ ClientTeam(edict_t *ent)
static char value[512];
value[0] = 0;
if (!ent)
{
return value;
}
if (!ent->client)
{
return value;
@ -202,12 +202,12 @@ Cmd_Give_f(edict_t *ent)
int i;
qboolean give_all;
edict_t *it_ent;
if (!ent)
{
return;
}
if ((deathmatch->value || coop->value) && !sv_cheats->value)
{
gi.cprintf(ent, PRINT_HIGH,
@ -408,12 +408,12 @@ void
Cmd_God_f(edict_t *ent)
{
char *msg;
if (!ent)
{
return;
}
if ((deathmatch->value || coop->value) && !sv_cheats->value)
{
gi.cprintf(ent, PRINT_HIGH,
@ -442,12 +442,12 @@ void
Cmd_Notarget_f(edict_t *ent)
{
char *msg;
if (!ent)
{
return;
}
if ((deathmatch->value || coop->value) && !sv_cheats->value)
{
gi.cprintf(ent, PRINT_HIGH,
@ -473,12 +473,12 @@ void
Cmd_Noclip_f(edict_t *ent)
{
char *msg;
if (!ent)
{
return;
}
if ((deathmatch->value || coop->value) && !sv_cheats->value)
{
gi.cprintf(ent, PRINT_HIGH,
@ -509,12 +509,12 @@ Cmd_Use_f(edict_t *ent)
int index;
gitem_t *it;
char *s;
if (!ent)
{
return;
}
s = gi.args();
it = FindItem(s);
@ -574,7 +574,7 @@ Cmd_Drop_f(edict_t *ent)
{
int index;
gitem_t *it;
char *s;
char *s;
if (!ent)
{
@ -637,12 +637,12 @@ Cmd_Inven_f(edict_t *ent)
{
int i;
gclient_t *cl;
if (!ent)
{
return;
}
cl = ent->client;
cl->showscores = false;
@ -670,12 +670,12 @@ void
Cmd_InvUse_f(edict_t *ent)
{
gitem_t *it;
if (!ent)
{
return;
}
ValidateSelectedItem(ent);
if (ent->client->pers.selected_item == -1)
@ -702,12 +702,12 @@ Cmd_WeapPrev_f(edict_t *ent)
int i, index;
gitem_t *it;
int selected_weapon;
if (!ent)
{
return;
}
cl = ent->client;
if (!cl->pers.weapon)
@ -755,12 +755,12 @@ Cmd_WeapNext_f(edict_t *ent)
int i, index;
gitem_t *it;
int selected_weapon;
if (!ent)
{
return;
}
cl = ent->client;
if (!cl->pers.weapon)
@ -807,12 +807,12 @@ Cmd_WeapLast_f(edict_t *ent)
gclient_t *cl;
int index;
gitem_t *it;
if (!ent)
{
return;
}
cl = ent->client;
if (!cl->pers.weapon || !cl->pers.lastweapon)
@ -846,12 +846,12 @@ void
Cmd_InvDrop_f(edict_t *ent)
{
gitem_t *it;
if (!ent)
{
return;
}
ValidateSelectedItem(ent);
if (ent->client->pers.selected_item == -1)
@ -873,12 +873,12 @@ Cmd_InvDrop_f(edict_t *ent)
void
Cmd_Kill_f(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (((level.time - ent->client->respawn_time) < 5) ||
(ent->client->resp.spectator))
{
@ -893,12 +893,12 @@ Cmd_Kill_f(edict_t *ent)
void
Cmd_PutAway_f(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->client->showscores = false;
ent->client->showhelp = false;
ent->client->showinventory = false;
@ -908,12 +908,12 @@ int
PlayerSort(void const *a, void const *b)
{
int anum, bnum;
if (!a || !b)
{
return 0;
}
anum = *(int *)a;
bnum = *(int *)b;
@ -941,12 +941,12 @@ Cmd_Players_f(edict_t *ent)
char small[64];
char large[1280];
int index[256];
if (!ent)
{
return;
}
count = 0;
for (i = 0; i < maxclients->value; i++)
@ -971,7 +971,7 @@ Cmd_Players_f(edict_t *ent)
game.clients[index[i]].pers.netname);
if (strlen(small) + strlen(large) > sizeof(large) - 100)
{
{
/* can't print all of them in one packet */
strcat(large, "...\n");
break;
@ -987,12 +987,12 @@ void
Cmd_Wave_f(edict_t *ent)
{
int i;
if (!ent)
{
return;
}
i = atoi(gi.argv(1));
/* can't wave when ducked */
@ -1047,12 +1047,12 @@ Cmd_Say_f(edict_t *ent, qboolean team, qboolean arg0)
char *p;
char text[2048];
gclient_t *cl;
if (!ent)
{
return;
}
if ((gi.argc() < 2) && !arg0)
{
return;
@ -1170,12 +1170,12 @@ Cmd_PlayerList_f(edict_t *ent)
char st[80];
char text[1400];
edict_t *e2;
if (!ent)
{
return;
}
/* connect time, ping, score, name */
*text = 0;
@ -1210,12 +1210,12 @@ void
ClientCommand(edict_t *ent)
{
char *cmd;
if (!ent)
{
return;
}
if (!ent->client)
{
return; /* not fully in game yet */

View file

@ -4,12 +4,12 @@
* Combat code like damage, death and so on.
*
* =======================================================================
*/
*/
#include "header/local.h"
/*
* Returns true if the inflictor can directly damage the
* Returns true if the inflictor can directly damage the
* target. Used for explosions and melee attacks.
*/
qboolean
@ -137,7 +137,7 @@ Killed(edict_t *targ, edict_t *inflictor, edict_t *attacker,
if ((targ->movetype == MOVETYPE_PUSH) ||
(targ->movetype == MOVETYPE_STOP) ||
(targ->movetype == MOVETYPE_NONE))
{
{
/* doors, triggers, etc */
targ->die(targ, inflictor, attacker, damage, point);
return;
@ -401,14 +401,14 @@ M_ReactToDamage(edict_t *targ, edict_t *attacker)
}
}
/* if attacker is a client, get mad at
/* if attacker is a client, get mad at
them because he's good and we're not */
if (attacker->client)
{
targ->monsterinfo.aiflags &= ~AI_SOUND_TARGET;
/* this can only happen in coop (both new and old
enemies are clients) only switch if can't see the
enemies are clients) only switch if can't see the
current enemy */
if (targ->enemy && targ->enemy->client)
{
@ -432,7 +432,7 @@ M_ReactToDamage(edict_t *targ, edict_t *attacker)
}
/* it's the same base (walk/swim/fly) type and
a different classname and it's not a tank
a different classname and it's not a tank
(they spray too much), get mad at them */
if (((targ->flags & (FL_FLY | FL_SWIM)) ==
(attacker->flags & (FL_FLY | FL_SWIM))) &&
@ -509,7 +509,7 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
}
/* friendly fire avoidance. If enabled you can't
hurt teammates (but you can hurt yourself)
hurt teammates (but you can hurt yourself)
knockback still occurs */
if ((targ != attacker) && ((deathmatch->value &&
((int)(dmflags->value) & (DF_MODELTEAMS | DF_SKINTEAMS))) ||
@ -704,7 +704,7 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
}
/* add to the damage inflicted on a player this frame
the total will be turned into screen blends and view angle kicks
the total will be turned into screen blends and view angle kicks
at the end of the frame */
if (client)
{

File diff suppressed because it is too large Load diff

View file

@ -4,13 +4,13 @@
* Item handling and item definitions.
*
* =======================================================================
*/
*/
#include "header/local.h"
#define HEALTH_IGNORE_MAX 1
#define HEALTH_TIMED 2
qboolean Pickup_Weapon(edict_t *ent, edict_t *other);
void Use_Weapon(edict_t *ent, gitem_t *inv);
void Use_Weapon2(edict_t *ent, gitem_t *inv);
@ -239,12 +239,12 @@ Pickup_Powerup(edict_t *ent, edict_t *other)
void
Drop_General(edict_t *ent, gitem_t *item)
{
{
if (!ent || !item)
{
return;
}
Drop_Item(ent, item);
ent->client->pers.inventory[ITEM_INDEX(item)]--;
ValidateSelectedItem(ent);
@ -280,12 +280,12 @@ Pickup_Adrenaline(edict_t *ent, edict_t *other)
qboolean
Pickup_AncientHead(edict_t *ent, edict_t *other)
{
{
if (!ent || !other)
{
return false;
}
other->max_health += 2;
if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
@ -301,12 +301,12 @@ Pickup_Bandolier(edict_t *ent, edict_t *other)
{
gitem_t *item;
int index;
if (!ent || !other)
{
return false;
}
if (other->client->pers.max_bullets < 250)
{
other->client->pers.max_bullets = 250;
@ -375,12 +375,12 @@ Pickup_Pack(edict_t *ent, edict_t *other)
{
gitem_t *item;
int index;
if (!ent || !other)
{
return false;
}
if (other->client->pers.max_bullets < 300)
{
other->client->pers.max_bullets = 300;
@ -535,12 +535,12 @@ void
Use_Quad(edict_t *ent, gitem_t *item)
{
int timeout;
if (!ent || !item)
{
return;
}
ent->client->pers.inventory[ITEM_INDEX(item)]--;
ValidateSelectedItem(ent);
@ -572,12 +572,12 @@ void
Use_QuadFire(edict_t *ent, gitem_t *item)
{
int timeout;
if (!ent || !item)
{
return;
}
ent->client->pers.inventory[ITEM_INDEX(item)]--;
ValidateSelectedItem(ent);
@ -607,12 +607,12 @@ Use_QuadFire(edict_t *ent, gitem_t *item)
void
Use_Breather(edict_t *ent, gitem_t *item)
{
{
if (!ent || !item)
{
return;
}
ent->client->pers.inventory[ITEM_INDEX(item)]--;
ValidateSelectedItem(ent);
@ -630,12 +630,12 @@ Use_Breather(edict_t *ent, gitem_t *item)
void
Use_Envirosuit(edict_t *ent, gitem_t *item)
{
{
if (!ent || !item)
{
return;
}
ent->client->pers.inventory[ITEM_INDEX(item)]--;
ValidateSelectedItem(ent);
@ -653,12 +653,12 @@ Use_Envirosuit(edict_t *ent, gitem_t *item)
void
Use_Invulnerability(edict_t *ent, gitem_t *item)
{
{
if (!ent || !item)
{
return;
}
ent->client->pers.inventory[ITEM_INDEX(item)]--;
ValidateSelectedItem(ent);
@ -678,12 +678,12 @@ Use_Invulnerability(edict_t *ent, gitem_t *item)
void
Use_Silencer(edict_t *ent, gitem_t *item)
{
{
if (!ent || !item)
{
return;
}
ent->client->pers.inventory[ITEM_INDEX(item)]--;
ValidateSelectedItem(ent);
ent->client->silencer_shots += 30;
@ -693,12 +693,12 @@ Use_Silencer(edict_t *ent, gitem_t *item)
qboolean
Pickup_Key(edict_t *ent, edict_t *other)
{
{
if (!ent || !other)
{
return false;
}
if (coop->value)
{
if (strcmp(ent->classname, "key_power_cube") == 0)
@ -737,12 +737,12 @@ Add_Ammo(edict_t *ent, gitem_t *item, int count)
{
int index;
int max;
if (!ent || !item)
{
return false;
}
if (!ent->client)
{
return false;
@ -808,12 +808,12 @@ Pickup_Ammo(edict_t *ent, edict_t *other)
int oldcount;
int count;
qboolean weapon;
if (!ent || !other)
{
return false;
}
weapon = (ent->item->flags & IT_WEAPON);
if ((weapon) && ((int)dmflags->value & DF_INFINITE_AMMO))
@ -860,12 +860,12 @@ Drop_Ammo(edict_t *ent, gitem_t *item)
{
edict_t *dropped;
int index;
if (!ent || !item)
{
return;
}
index = ITEM_INDEX(item);
dropped = Drop_Item(ent, item);
@ -921,12 +921,12 @@ MegaHealth_think(edict_t *self)
qboolean
Pickup_Health(edict_t *ent, edict_t *other)
{
{
if (!ent || !other)
{
return false;
}
if (!(ent->style & HEALTH_IGNORE_MAX))
{
if (other->health >= other->max_health)
@ -969,12 +969,12 @@ Pickup_Health(edict_t *ent, edict_t *other)
int
ArmorIndex(edict_t *ent)
{
{
if (!ent)
{
return 0;
}
if (!ent->client)
{
return 0;
@ -1007,12 +1007,12 @@ Pickup_Armor(edict_t *ent, edict_t *other)
int newcount;
float salvage;
int salvagecount;
if (!ent || !other)
{
return false;
}
/* get info on new armor */
newinfo = (gitem_armor_t *)ent->item->info;
@ -1109,12 +1109,12 @@ Pickup_Armor(edict_t *ent, edict_t *other)
int
PowerArmorType(edict_t *ent)
{
{
if (!ent)
{
return POWER_ARMOR_NONE;
}
if (!ent->client)
{
return POWER_ARMOR_NONE;
@ -1142,12 +1142,12 @@ void
Use_PowerArmor(edict_t *ent, gitem_t *item)
{
int index;
if (!ent || !item)
{
return;
}
if (ent->flags & FL_POWER_ARMOR)
{
ent->flags &= ~FL_POWER_ARMOR;
@ -1173,12 +1173,12 @@ qboolean
Pickup_PowerArmor(edict_t *ent, edict_t *other)
{
int quantity;
if (!ent || !other)
{
return false;
}
quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
@ -1202,12 +1202,12 @@ Pickup_PowerArmor(edict_t *ent, edict_t *other)
void
Drop_PowerArmor(edict_t *ent, gitem_t *item)
{
{
if (!ent || !item)
{
return;
}
if ((ent->flags & FL_POWER_ARMOR) &&
(ent->client->pers.inventory[ITEM_INDEX(item)] == 1))
{
@ -1223,12 +1223,12 @@ void
Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{
qboolean taken;
if (!ent || !other)
{
return;
}
if (!other->client)
{
return;
@ -1324,12 +1324,12 @@ Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
void
drop_temp_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{
{
if (!ent || !other)
{
return;
}
if (other == ent->owner)
{
return;
@ -1337,19 +1337,19 @@ drop_temp_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
/* plane and surf are unused in Touch_Item
but since the function is part of the
game <-> client interface dropping
game <-> client interface dropping
them is too much pain. */
Touch_Item(ent, other, plane, surf);
}
void
drop_make_touchable(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->touch = Touch_Item;
if (deathmatch->value)
@ -1365,12 +1365,12 @@ Drop_Item(edict_t *ent, gitem_t *item)
edict_t *dropped;
vec3_t forward, right;
vec3_t offset;
if (!ent || !item)
{
return NULL;
}
dropped = G_Spawn();
dropped->classname = item->classname;
@ -1379,7 +1379,7 @@ Drop_Item(edict_t *ent, gitem_t *item)
dropped->s.effects = item->world_model_flags;
dropped->s.renderfx = RF_GLOW;
if (rand() > 0.5)
if (rand() > 0.5)
{
dropped->s.angles[1] += rand()*45;
}
@ -1427,12 +1427,12 @@ Drop_Item(edict_t *ent, gitem_t *item)
void
Use_Item(edict_t *ent, edict_t *other /* unused */, edict_t *activator /* unused */)
{
{
if (!ent)
{
return;
}
ent->svflags &= ~SVF_NOCLIENT;
ent->use = NULL;
@ -1458,12 +1458,12 @@ droptofloor(edict_t *ent)
trace_t tr;
vec3_t dest;
float *v;
if (!ent)
{
return;
}
v = tv(-15, -15, -15);
VectorCopy(v, ent->mins);
v = tv(15, 15, 15);
@ -1648,12 +1648,12 @@ PrecacheItem(gitem_t *it)
*/
void
SpawnItem(edict_t *ent, gitem_t *item)
{
{
if (!ent || !item)
{
return;
}
PrecacheItem(item);
if (ent->spawnflags)
@ -1739,7 +1739,7 @@ SpawnItem(edict_t *ent, gitem_t *item)
gitem_t itemlist[] = {
{
NULL
},
},
/*
@ -2901,12 +2901,12 @@ gitem_t itemlist[] = {
*/
void
SP_item_health(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH))
{
G_FreeEdict(self);
@ -2924,12 +2924,12 @@ SP_item_health(edict_t *self)
*/
void
SP_item_health_small(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH))
{
G_FreeEdict(self);
@ -2948,12 +2948,12 @@ SP_item_health_small(edict_t *self)
*/
void
SP_item_health_large(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH))
{
G_FreeEdict(self);
@ -2971,12 +2971,12 @@ SP_item_health_large(edict_t *self)
*/
void
SP_item_health_mega(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH))
{
G_FreeEdict(self);
@ -2992,12 +2992,12 @@ SP_item_health_mega(edict_t *self)
void
SP_item_foodcube(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH))
{
G_FreeEdict(self);

View file

@ -4,7 +4,7 @@
* Jump in into the game.so and support functions.
*
* =======================================================================
*/
*/
#include "header/local.h"
@ -160,7 +160,7 @@ ClientEndServerFrames(void)
int i;
edict_t *ent;
/* calc the player views now that all
/* calc the player views now that all
pushing and damage has been added */
for (i = 0; i < maxclients->value; i++)
{
@ -182,11 +182,11 @@ edict_t *
CreateTargetChangeLevel(char *map)
{
edict_t *ent;
if (!map)
{
return NULL;
}
}
ent = G_Spawn();
ent->classname = "target_changelevel";
@ -281,7 +281,7 @@ CheckNeedPass(void)
{
int need;
/* if password or spectator_password has changed,
/* if password or spectator_password has changed,
update needpass as needed */
if (password->modified || spectator_password->modified)
{

File diff suppressed because it is too large Load diff

View file

@ -36,7 +36,7 @@ monster_fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
{
return;
}
fire_shotgun(self, start, aimdir, damage, kick, hspread, vspread,
count, MOD_UNKNOWN);
@ -54,7 +54,7 @@ monster_fire_blaster(edict_t *self, vec3_t start, vec3_t dir, int damage,
{
return;
}
fire_blaster(self, start, dir, damage, speed, effect, false);
gi.WriteByte(svc_muzzleflash2);
@ -71,7 +71,7 @@ monster_fire_blueblaster(edict_t *self, vec3_t start, vec3_t dir, int damage,
{
return;
}
fire_blueblaster(self, start, dir, damage, speed, effect);
gi.WriteByte(svc_muzzleflash2);
@ -88,7 +88,7 @@ monster_fire_ionripper(edict_t *self, vec3_t start, vec3_t dir, int damage,
{
return;
}
fire_ionripper(self, start, dir, damage, speed, effect);
gi.WriteByte(svc_muzzleflash2);
@ -105,7 +105,7 @@ monster_fire_heat(edict_t *self, vec3_t start, vec3_t dir, int damage,
{
return;
}
fire_heat(self, start, dir, damage, speed, damage, damage);
gi.WriteByte(svc_muzzleflash2);
@ -126,7 +126,7 @@ dabeam_hit(edict_t *self)
{
return;
}
ignore = self;
VectorCopy(self->s.origin, start);
VectorMA(start, 2048, self->movedir, end);
@ -160,7 +160,7 @@ dabeam_hit(edict_t *self)
}
}
/* if we hit something that's not a monster or
/* if we hit something that's not a monster or
player or is immune to lasers, we're done */
if (!(tr.ent->svflags & SVF_MONSTER) && (!tr.ent->client))
{
@ -193,12 +193,12 @@ monster_dabeam(edict_t *self)
{
vec3_t last_movedir;
vec3_t point;
if (!self)
{
return;
}
self->movetype = MOVETYPE_NONE;
self->solid = SOLID_NOT;
self->s.renderfx |= RF_BEAM | RF_TRANSLUCENT;
@ -251,12 +251,12 @@ monster_dabeam(edict_t *self)
void
monster_fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir,
int damage, int speed, int flashtype)
{
{
if (!self)
{
return;
}
fire_grenade(self, start, aimdir, damage, speed, 2.5, damage + 40);
gi.WriteByte(svc_muzzleflash2);
@ -268,12 +268,12 @@ monster_fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir,
void
monster_fire_rocket(edict_t *self, vec3_t start, vec3_t dir,
int damage, int speed, int flashtype)
{
{
if (!self)
{
return;
}
fire_rocket(self, start, dir, damage, speed, damage + 20, damage);
gi.WriteByte(svc_muzzleflash2);
@ -285,12 +285,12 @@ monster_fire_rocket(edict_t *self, vec3_t start, vec3_t dir,
void
monster_fire_railgun(edict_t *self, vec3_t start, vec3_t aimdir,
int damage, int kick, int flashtype)
{
{
if (!self)
{
return;
}
fire_rail(self, start, aimdir, damage, kick);
gi.WriteByte(svc_muzzleflash2);
@ -302,12 +302,12 @@ monster_fire_railgun(edict_t *self, vec3_t start, vec3_t aimdir,
void
monster_fire_bfg(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
int speed, int kick, float damage_radius, int flashtype)
{
{
if (!self)
{
return;
}
fire_bfg(self, start, aimdir, damage, speed, damage_radius);
gi.WriteByte(svc_muzzleflash2);
@ -320,24 +320,24 @@ monster_fire_bfg(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
void
M_FliesOff(edict_t *self)
{
{
if (!self)
{
return;
}
self->s.effects &= ~EF_FLIES;
self->s.sound = 0;
}
void
M_FliesOn(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->waterlevel)
{
return;
@ -351,12 +351,12 @@ M_FliesOn(edict_t *self)
void
M_FlyCheck(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->waterlevel)
{
return;
@ -373,12 +373,12 @@ M_FlyCheck(edict_t *self)
void
AttackFinished(edict_t *self, float time)
{
{
if (!self)
{
return;
}
self->monsterinfo.attack_finished = level.time + time;
}
@ -387,12 +387,12 @@ M_CheckGround(edict_t *ent)
{
vec3_t point;
trace_t trace;
if (!ent)
{
return;
}
if (ent->flags & (FL_SWIM | FL_FLY))
{
return;
@ -434,12 +434,12 @@ M_CatagorizePosition(edict_t *ent)
{
vec3_t point;
int cont;
if (!ent)
{
return;
}
/* get waterlevel */
point[0] = ent->s.origin[0];
point[1] = ent->s.origin[1];
@ -477,12 +477,12 @@ void
M_WorldEffects(edict_t *ent)
{
int dmg;
if (!ent)
{
return;
}
if (ent->health > 0)
{
if (!(ent->flags & FL_SWIM))
@ -492,7 +492,7 @@ M_WorldEffects(edict_t *ent)
ent->air_finished = level.time + 12;
}
else if (ent->air_finished < level.time)
{
{
/* drown! */
if (ent->pain_debounce_time < level.time)
{
@ -516,7 +516,7 @@ M_WorldEffects(edict_t *ent)
ent->air_finished = level.time + 9;
}
else if (ent->air_finished < level.time)
{
{
/* suffocate! */
if (ent->pain_debounce_time < level.time)
{
@ -606,12 +606,12 @@ M_droptofloor(edict_t *ent)
{
vec3_t end;
trace_t trace;
if (!ent)
{
return;
}
ent->s.origin[2] += 1;
VectorCopy(ent->s.origin, end);
end[2] -= 256;
@ -633,12 +633,12 @@ M_droptofloor(edict_t *ent)
void
M_SetEffects(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->s.effects &= ~(EF_COLOR_SHELL | EF_POWERSCREEN);
ent->s.renderfx &= ~(RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE);
@ -672,12 +672,12 @@ M_MoveFrame(edict_t *self)
{
mmove_t *move;
int index;
if (!self)
{
return;
}
move = self->monsterinfo.currentmove;
self->nextthink = level.time + FRAMETIME;
@ -750,12 +750,12 @@ M_MoveFrame(edict_t *self)
void
monster_think(edict_t *self)
{
{
if (!self)
{
return;
}
M_MoveFrame(self);
if (self->linkcount != self->monsterinfo.linkcount)
@ -770,7 +770,7 @@ monster_think(edict_t *self)
}
/*
* Using a monster makes it angry
* Using a monster makes it angry
* at the current activator
*/
void
@ -801,7 +801,7 @@ monster_use(edict_t *self, edict_t *other /* unused */, edict_t *activator)
return;
}
/* delay reaction so if the monster is
/* delay reaction so if the monster is
teleported, its sound is still heard */
self->enemy = activator;
FoundTarget(self);
@ -809,12 +809,12 @@ monster_use(edict_t *self, edict_t *other /* unused */, edict_t *activator)
void
monster_triggered_spawn(edict_t *self)
{
{
if (!self)
{
return;
}
self->s.origin[2] += 1;
KillBox(self);
@ -870,12 +870,12 @@ monster_triggered_spawn_use(edict_t *self, edict_t *other /* unused */, edict_t
void
monster_triggered_start(edict_t *self)
{
{
if (!self)
{
return;
}
self->solid = SOLID_NOT;
self->movetype = MOVETYPE_NONE;
self->svflags |= SVF_NOCLIENT;
@ -889,12 +889,12 @@ monster_triggered_start(edict_t *self)
*/
void
monster_death_use(edict_t *self)
{
{
if (!self)
{
return;
}
self->flags &= ~(FL_FLY | FL_SWIM);
self->monsterinfo.aiflags &= AI_GOOD_GUY;
@ -919,12 +919,12 @@ monster_death_use(edict_t *self)
qboolean
monster_start(edict_t *self)
{
{
if (!self)
{
return false;
}
if (deathmatch->value)
{
G_FreeEdict(self);
@ -989,18 +989,18 @@ void
monster_start_go(edict_t *self)
{
vec3_t v;
if (!self)
{
return;
}
if (self->health <= 0)
{
return;
}
/* check for target to combat_point
/* check for target to combat_point
and change to combattarget */
if (self->target)
{
@ -1096,12 +1096,12 @@ monster_start_go(edict_t *self)
void
walkmonster_start_go(edict_t *self)
{
{
if (!self)
{
return;
}
if (!(self->spawnflags & 2) && (level.time < 1))
{
M_droptofloor(self);
@ -1133,24 +1133,24 @@ walkmonster_start_go(edict_t *self)
void
walkmonster_start(edict_t *self)
{
{
if (!self)
{
return;
}
self->think = walkmonster_start_go;
monster_start(self);
}
void
flymonster_start_go(edict_t *self)
{
{
if (!self)
{
return;
}
if (!M_walkmove(self, 0, 0))
{
gi.dprintf("%s in solid at %s\n", self->classname, vtos(self->s.origin));
@ -1173,12 +1173,12 @@ flymonster_start_go(edict_t *self)
void
flymonster_start(edict_t *self)
{
{
if (!self)
{
return;
}
self->flags |= FL_FLY;
self->think = flymonster_start_go;
monster_start(self);
@ -1186,12 +1186,12 @@ flymonster_start(edict_t *self)
void
swimmonster_start_go(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->yaw_speed)
{
self->yaw_speed = 10;
@ -1209,12 +1209,12 @@ swimmonster_start_go(edict_t *self)
void
swimmonster_start(edict_t *self)
{
{
if (!self)
{
return;
}
self->flags |= FL_SWIM;
self->think = swimmonster_start_go;
monster_start(self);

View file

@ -13,7 +13,7 @@
#define sv_stopspeed 100
#define sv_friction 6
#define sv_waterfriction 1
/*
* pushmove objects do not obey gravity, and do not interact
* with each other or trigger fields, but block normal movement
@ -34,12 +34,12 @@
edict_t *
SV_TestEntityPosition(edict_t *ent)
{
{
if (!ent)
{
return NULL;
}
trace_t trace;
int mask;
@ -71,12 +71,12 @@ void
SV_CheckVelocity(edict_t *ent)
{
int i;
if (!ent)
{
return;
}
/* bound velocity */
for (i = 0; i < 3; i++)
{
@ -92,19 +92,19 @@ SV_CheckVelocity(edict_t *ent)
}
/*
* Runs thinking code for
* Runs thinking code for
* this frame if necessary
*/
qboolean
SV_RunThink(edict_t *ent)
{
float thinktime;
if (!ent)
{
return false;
}
thinktime = ent->nextthink;
if (thinktime <= 0)
@ -247,14 +247,14 @@ SV_FlyMove(edict_t *ent, float time, int mask)
trace = gi.trace(ent->s.origin, ent->mins, ent->maxs, end, ent, mask);
if (trace.allsolid)
{
{
/* entity is trapped in another solid */
VectorCopy(vec3_origin, ent->velocity);
return 3;
}
if (trace.fraction > 0)
{
{
/* actually covered some distance */
VectorCopy(trace.endpos, ent->s.origin);
VectorCopy(ent->velocity, original_velocity);
@ -296,7 +296,7 @@ SV_FlyMove(edict_t *ent, float time, int mask)
/* cliped to another plane */
if (numplanes >= MAX_CLIP_PLANES)
{
{
/* this shouldn't really happen */
VectorCopy(vec3_origin, ent->velocity);
return 3;
@ -305,7 +305,7 @@ SV_FlyMove(edict_t *ent, float time, int mask)
VectorCopy(trace.plane.normal, planes[numplanes]);
numplanes++;
/* modify original_velocity so it
/* modify original_velocity so it
parallels all of the clip planes */
for (i = 0; i < numplanes; i++)
{
@ -329,12 +329,12 @@ SV_FlyMove(edict_t *ent, float time, int mask)
}
if (i != numplanes)
{
{
/* go along this plane */
VectorCopy(new_velocity, ent->velocity);
}
else
{
{
/* go along the crease */
if (numplanes != 2)
{
@ -347,7 +347,7 @@ SV_FlyMove(edict_t *ent, float time, int mask)
VectorScale(dir, d, ent->velocity);
}
/* If original velocity is against the original
/* If original velocity is against the original
velocity, stop dead to avoid tiny occilations
in sloping corners */
if (DotProduct(ent->velocity, primal_velocity) <= 0)
@ -362,12 +362,12 @@ SV_FlyMove(edict_t *ent, float time, int mask)
void
SV_AddGravity(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->velocity[2] -= ent->gravity * sv_gravity->value * FRAMETIME;
}
@ -669,7 +669,7 @@ SV_Push(edict_t *pusher, vec3_t move, vec3_t amove)
VectorAdd(check->s.origin, move, check->s.origin);
if (check->client)
{
{
check->client->ps.pmove.delta_angles[YAW] += amove[YAW];
}
@ -706,7 +706,7 @@ SV_Push(edict_t *pusher, vec3_t move, vec3_t amove)
block = SV_TestEntityPosition(check);
if (!block)
{
{
/* pushed ok */
gi.linkentity(check);
@ -729,8 +729,8 @@ SV_Push(edict_t *pusher, vec3_t move, vec3_t amove)
/* save off the obstacle so we can call the block function */
obstacle = check;
/* move back any entities we already moved
go backwards, so if the same entity was pushed
/* move back any entities we already moved
go backwards, so if the same entity was pushed
twice, it goes back to the original position */
for (p = pushed_p - 1; p >= pushed; p--)
{
@ -758,7 +758,7 @@ SV_Push(edict_t *pusher, vec3_t move, vec3_t amove)
}
/*
* Bmodel objects don't interact with each
* Bmodel objects don't interact with each
* other, but push all box objects
*/
void
@ -766,20 +766,20 @@ SV_Physics_Pusher(edict_t *ent)
{
vec3_t move, amove;
edict_t *part, *mv;
if (!ent)
{
return;
}
/* if not a team captain, so movement
/* if not a team captain, so movement
will be handled elsewhere */
if (ent->flags & FL_TEAMSLAVE)
{
return;
}
/* make sure all team slaves can move before commiting
/* make sure all team slaves can move before commiting
any moves or calling any think functions. if the move
is blocked, all moved objects will be backed out */
pushed_p = pushed;
@ -788,7 +788,7 @@ SV_Physics_Pusher(edict_t *ent)
{
if (part->velocity[0] || part->velocity[1] || part->velocity[2] ||
part->avelocity[0] || part->avelocity[1] || part->avelocity[2])
{
{
/* object is moving */
VectorScale(part->velocity, FRAMETIME, move);
VectorScale(part->avelocity, FRAMETIME, amove);
@ -816,8 +816,8 @@ SV_Physics_Pusher(edict_t *ent)
}
}
/* if the pusher has a "blocked" function, call it
otherwise, just stay in place until the obstacle
/* if the pusher has a "blocked" function, call it
otherwise, just stay in place until the obstacle
is gone */
if (part->blocked)
{
@ -841,12 +841,12 @@ SV_Physics_Pusher(edict_t *ent)
*/
void
SV_Physics_None(edict_t *ent)
{
{
if (!ent)
{
return;
}
/* regular thinking */
SV_RunThink(ent);
}
@ -856,12 +856,12 @@ SV_Physics_None(edict_t *ent)
*/
void
SV_Physics_Noclip(edict_t *ent)
{
{
if (!ent)
{
return;
}
/* regular thinking */
if (!SV_RunThink(ent))
{
@ -891,12 +891,12 @@ SV_Physics_Toss(edict_t *ent)
qboolean wasinwater;
qboolean isinwater;
vec3_t old_origin;
if (!ent)
{
return;
}
/* regular thinking */
SV_RunThink(ent);
@ -1036,12 +1036,12 @@ SV_AddRotationalFriction(edict_t *ent)
{
int n;
float adjustment;
if (!ent)
{
return;
}
VectorMA(ent->s.angles, FRAMETIME, ent->avelocity, ent->s.angles);
adjustment = FRAMETIME * sv_stopspeed * sv_friction;
@ -1078,12 +1078,12 @@ SV_Physics_Step(edict_t *ent)
float friction;
edict_t *groundentity;
int mask;
if (!ent)
{
return;
}
/* airborn monsters should always check for ground */
if (!ent->groundentity)
{
@ -1108,8 +1108,8 @@ SV_Physics_Step(edict_t *ent)
SV_AddRotationalFriction(ent);
}
/* add gravity except:
- flying monsters
/* add gravity except:
- flying monsters
- swimming monsters who are in the water */
if (!wasonground)
{
@ -1232,12 +1232,12 @@ SV_Physics_Step(edict_t *ent)
void
G_RunEntity(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (ent->prethink)
{
ent->prethink(ent);

View file

@ -293,12 +293,12 @@ ED_CallSpawn(edict_t *ent)
spawn_t *s;
gitem_t *item;
int i;
if (!ent)
{
return;
}
if (!ent->classname)
{
gi.dprintf("ED_CallSpawn: NULL classname\n");
@ -314,7 +314,7 @@ ED_CallSpawn(edict_t *ent)
}
if (!strcmp(item->classname, ent->classname))
{
{
/* found it */
SpawnItem(ent, item);
return;
@ -325,7 +325,7 @@ ED_CallSpawn(edict_t *ent)
for (s = spawns; s->name; s++)
{
if (!strcmp(s->name, ent->classname))
{
{
/* found it */
s->spawn(ent);
return;
@ -391,7 +391,7 @@ ED_ParseField(const char *key, const char *value, edict_t *ent)
for (f = fields; f->name; f++)
{
if (!(f->flags & FFL_NOSPAWN) && !Q_stricmp(f->name, key))
{
{
/* found it */
if (f->flags & FFL_SPAWNTEMP)
{
@ -486,8 +486,8 @@ ED_ParseEdict(char *data, edict_t *ent)
init = true;
/* keynames with a leading underscore are
used for utility comments, and are
/* keynames with a leading underscore are
used for utility comments, and are
immediately discarded by quake */
if (keyname[0] == '_')
{
@ -663,7 +663,7 @@ SpawnEntities(const char *mapname, char *entities, const char *spawnpoint)
ent->spawnflags &= ~SPAWNFLAG_NOT_HARD;
}
/* remove things (except the world) from
/* remove things (except the world) from
different skill levels or deathmatch */
if (ent != g_edicts)
{
@ -972,9 +972,9 @@ SP_worldspawn(edict_t *ent)
gi.soundindex("*pain100_1.wav");
gi.soundindex("*pain100_2.wav");
/* sexed models. you can add more, max 19
THIS ORDER MUST MATCH THE DEFINES IN g_local.h
these models are only loaded in coop or deathmatch.
/* sexed models. you can add more, max 19
THIS ORDER MUST MATCH THE DEFINES IN g_local.h
these models are only loaded in coop or deathmatch.
not singleplayer. */
if (coop->value || deathmatch->value)
{

View file

@ -9,17 +9,17 @@
/* QUAKED target_temp_entity (1 0 0) (-8 -8 -8) (8 8 8)
* Fire an origin based temp entity event to the clients.
*
*
* "style" type byte
*/
void
Use_Target_Tent(edict_t *ent, edict_t *other /* unused */ , edict_t *activator /* unused */)
{
{
if (!ent)
{
return;
}
gi.WriteByte(svc_temp_entity);
gi.WriteByte(ent->style);
gi.WritePosition(ent->s.origin);
@ -52,19 +52,19 @@ SP_target_temp_entity(edict_t *ent)
*
* Looped sounds are always atten 3 / vol 1, and the use function toggles it on/off.
* Multiple identical looping sounds will just increase volume without any speed cost.
*/
*/
void
Use_Target_Speaker(edict_t *ent, edict_t *other /* unused */ , edict_t *activator /* unused */)
{
int chan;
if (!ent)
{
return;
}
if (ent->spawnflags & 3)
{
{
/* looping sound toggles */
if (ent->s.sound)
{
@ -76,7 +76,7 @@ Use_Target_Speaker(edict_t *ent, edict_t *other /* unused */ , edict_t *activato
}
}
else
{
{
/* normal sound */
if (ent->spawnflags & 4)
{
@ -87,7 +87,7 @@ Use_Target_Speaker(edict_t *ent, edict_t *other /* unused */ , edict_t *activato
chan = CHAN_VOICE;
}
/* use a positioned_sound, because this entity won't
/* use a positioned_sound, because this entity won't
normally be sent to any clients because it is invisible */
gi.positioned_sound(ent->s.origin, ent, chan, ent->noise_index,
ent->volume, ent->attenuation, 0);
@ -98,12 +98,12 @@ void
SP_target_speaker(edict_t *ent)
{
char buffer[MAX_QPATH];
if (!ent)
{
return;
}
if (!st.noise)
{
gi.dprintf("target_speaker with no noise set at %s\n",
@ -144,7 +144,7 @@ SP_target_speaker(edict_t *ent)
ent->use = Use_Target_Speaker;
/* must link the entity so we get areas and clusters so
/* must link the entity so we get areas and clusters so
the server can determine who to send updates to */
gi.linkentity(ent);
}
@ -153,12 +153,12 @@ SP_target_speaker(edict_t *ent)
void
Use_Target_Help(edict_t *ent, edict_t *other, edict_t *activator)
{
{
if (!ent)
{
return;
}
if (ent->spawnflags & 1)
{
strncpy(game.helpmessage1, ent->message, sizeof(game.helpmessage2) - 1);
@ -178,14 +178,14 @@ Use_Target_Help(edict_t *ent, edict_t *other, edict_t *activator)
*/
void
SP_target_help(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (deathmatch->value)
{
{
/* auto-remove for deathmatch */
G_FreeEdict(ent);
return;
@ -210,12 +210,12 @@ SP_target_help(edict_t *ent)
*/
void
use_target_secret(edict_t *ent, edict_t *other /* unused */, edict_t *activator /* unused */)
{
{
if (!ent)
{
return;
}
gi.sound(ent, CHAN_VOICE, ent->noise_index, 1, ATTN_NORM, 0);
level.found_secrets++;
@ -226,14 +226,14 @@ use_target_secret(edict_t *ent, edict_t *other /* unused */, edict_t *activator
void
SP_target_secret(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (deathmatch->value)
{
{
/* auto-remove for deathmatch */
G_FreeEdict(ent);
return;
@ -282,14 +282,14 @@ use_target_goal(edict_t *ent, edict_t *other /* unused */, edict_t *activator /*
void
SP_target_goal(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (deathmatch->value)
{
{
/* auto-remove for deathmatch */
G_FreeEdict(ent);
return;
@ -320,12 +320,12 @@ void
target_explosion_explode(edict_t *self)
{
float save;
if (!self)
{
return;
}
gi.WriteByte(svc_temp_entity);
gi.WriteByte(TE_EXPLOSION1);
gi.WritePosition(self->s.origin);
@ -357,12 +357,12 @@ use_target_explosion(edict_t *self, edict_t *other /* unused */, edict_t *activa
void
SP_target_explosion(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->use = use_target_explosion;
ent->svflags = SVF_NOCLIENT;
}
@ -425,12 +425,12 @@ use_target_changelevel(edict_t *self, edict_t *other, edict_t *activator)
void
SP_target_changelevel(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (!ent->map)
{
gi.dprintf("target_changelevel with no map at %s\n", vtos(ent->s.origin));
@ -492,12 +492,12 @@ use_target_splash(edict_t *self, edict_t *other /* unused */, edict_t *activator
void
SP_target_splash(edict_t *self)
{
{
if (!self)
{
return;
}
self->use = use_target_splash;
G_SetMovedir(self->s.angles, self->movedir);
@ -530,12 +530,12 @@ void
use_target_spawner(edict_t *self, edict_t *other /* unused */, edict_t *activator /* unused */)
{
edict_t *ent;
if (!self)
{
return;
}
ent = G_Spawn();
ent->classname = self->target;
VectorCopy(self->s.origin, ent->s.origin);
@ -556,12 +556,12 @@ SP_target_spawner(edict_t *self)
{
self->use = use_target_spawner;
self->svflags = SVF_NOCLIENT;
if (!self)
{
return;
}
if (self->speed)
{
G_SetMovedir(self->s.angles, self->movedir);
@ -580,12 +580,12 @@ SP_target_spawner(edict_t *self)
*/
void
use_target_blaster(edict_t *self, edict_t *other /* unused */, edict_t *activator /* unused */)
{
{
if (!self)
{
return;
}
fire_blaster(self, self->s.origin, self->movedir,
self->dmg, self->speed, EF_BLASTER,
MOD_TARGET_BLASTER);
@ -594,12 +594,12 @@ use_target_blaster(edict_t *self, edict_t *other /* unused */, edict_t *activato
void
SP_target_blaster(edict_t *self)
{
{
if (!self)
{
return;
}
self->use = use_target_blaster;
G_SetMovedir(self->s.angles, self->movedir);
self->noise_index = gi.soundindex("weapons/laser2.wav");
@ -641,12 +641,12 @@ trigger_crosslevel_trigger_use(edict_t *self, edict_t *other /* unused */,
void
SP_target_crosslevel_trigger(edict_t *self)
{
{
if (!self)
{
return;
}
self->svflags = SVF_NOCLIENT;
self->use = trigger_crosslevel_trigger_use;
}
@ -659,15 +659,15 @@ SP_target_crosslevel_trigger(edict_t *self)
*
* "delay" delay before using targets if the trigger has been
* activated (default 1)
*/
*/
void
target_crosslevel_target_think(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->spawnflags ==
(game.serverflags & SFL_CROSS_TRIGGER_MASK & self->spawnflags))
{
@ -678,12 +678,12 @@ target_crosslevel_target_think(edict_t *self)
void
SP_target_crosslevel_target(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->delay)
{
self->delay = 1;
@ -712,12 +712,12 @@ target_laser_think(edict_t *self)
vec3_t point;
vec3_t last_movedir;
int count;
if (!self)
{
return;
}
if (self->spawnflags & 0x80000000)
{
count = 8;
@ -790,12 +790,12 @@ target_laser_think(edict_t *self)
void
target_laser_on(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->activator)
{
self->activator = self;
@ -808,12 +808,12 @@ target_laser_on(edict_t *self)
void
target_laser_off(edict_t *self)
{
{
if (!self)
{
return;
}
self->spawnflags &= ~1;
self->svflags |= SVF_NOCLIENT;
self->nextthink = 0;
@ -843,12 +843,12 @@ void
target_laser_start(edict_t *self)
{
edict_t *ent;
if (!self)
{
return;
}
self->movetype = MOVETYPE_NONE;
self->solid = SOLID_NOT;
self->s.renderfx |= RF_BEAM | RF_TRANSLUCENT;
@ -931,12 +931,12 @@ target_laser_start(edict_t *self)
void
SP_target_laser(edict_t *self)
{
{
if (!self)
{
return;
}
/* let everything else get spawned before we start firing */
self->think = target_laser_start;
self->nextthink = level.time + 1;
@ -947,12 +947,12 @@ SP_target_laser(edict_t *self)
*/
void
target_mal_laser_on(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->activator)
{
self->activator = self;
@ -965,12 +965,12 @@ target_mal_laser_on(edict_t *self)
void
target_mal_laser_off(edict_t *self)
{
{
if (!self)
{
return;
}
self->spawnflags &= ~1;
self->svflags |= SVF_NOCLIENT;
self->nextthink = 0;
@ -998,12 +998,12 @@ target_mal_laser_use(edict_t *self, edict_t *other /* unused */, edict_t *activa
void
mal_laser_think(edict_t *self)
{
{
if (!self)
{
return;
}
target_laser_think(self);
self->nextthink = level.time + self->wait + 0.1;
self->spawnflags |= 0x80000000;
@ -1011,12 +1011,12 @@ mal_laser_think(edict_t *self)
void
SP_target_mal_laser(edict_t *self)
{
{
if (!self)
{
return;
}
self->movetype = MOVETYPE_NONE;
self->solid = SOLID_NOT;
self->s.renderfx |= RF_BEAM | RF_TRANSLUCENT;
@ -1102,12 +1102,12 @@ void
target_lightramp_think(edict_t *self)
{
char style[2];
if (!self)
{
return;
}
style[0] = 'a' + self->movedir[0] +
(level.time - self->timestamp) / FRAMETIME * self->movedir[2];
style[1] = 0;
@ -1130,12 +1130,12 @@ target_lightramp_think(edict_t *self)
void
target_lightramp_use(edict_t *self, edict_t *other /* unused */, edict_t *activator /* unused */)
{
{
if (!self)
{
return;
}
if (!self->enemy)
{
edict_t *e;
@ -1180,12 +1180,12 @@ target_lightramp_use(edict_t *self, edict_t *other /* unused */, edict_t *activa
void
SP_target_lightramp(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->message || (strlen(self->message) != 2) ||
(self->message[0] < 'a') || (self->message[0] > 'z') ||
(self->message[1] < 'a') || (self->message[1] > 'z') ||
@ -1235,12 +1235,12 @@ target_earthquake_think(edict_t *self)
{
int i;
edict_t *e;
if (!self)
{
return;
}
if (self->last_move_time < level.time)
{
gi.positioned_sound(self->s.origin,
@ -1298,12 +1298,12 @@ target_earthquake_use(edict_t *self, edict_t *other /* unused */, edict_t *activ
void
SP_target_earthquake(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->targetname)
{
gi.dprintf("untargeted %s at %s\n", self->classname,

View file

@ -15,12 +15,12 @@ static int windsound;
void
InitTrigger(edict_t *self)
{
{
if (!self)
{
return;
}
if (!VectorCompare(self->s.angles, vec3_origin))
{
G_SetMovedir(self->s.angles, self->movedir);
@ -32,34 +32,34 @@ InitTrigger(edict_t *self)
self->svflags = SVF_NOCLIENT;
}
/*
* The wait time has passed, so set
* back up for another activation
/*
* The wait time has passed, so set
* back up for another activation
*/
void
multi_wait(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->nextthink = 0;
}
/*
/*
* The trigger was just activated. ent->activator should
* be set to the activator so it can be held through a delay
* so wait for the delay time before firing
* be set to the activator so it can be held through a delay
* so wait for the delay time before firing
*/
void
multi_trigger(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (ent->nextthink)
{
return; /* already been triggered */
@ -73,9 +73,9 @@ multi_trigger(edict_t *ent)
ent->nextthink = level.time + ent->wait;
}
else
{
/* we can't just remove (self) here,
because this is a touch function
{
/* we can't just remove (self) here,
because this is a touch function
called while looping through area links... */
ent->touch = NULL;
ent->nextthink = level.time + FRAMETIME;
@ -158,12 +158,12 @@ Touch_Multi(edict_t *self, edict_t *other, cplane_t *plane /* unused */,
void
trigger_enable(edict_t *self, edict_t *other /* unused */,
edict_t *activator /* unused */)
{
{
if (!self)
{
return;
}
self->solid = SOLID_TRIGGER;
self->use = Use_Multi;
gi.linkentity(self);
@ -171,12 +171,12 @@ trigger_enable(edict_t *self, edict_t *other /* unused */,
void
SP_trigger_multiple(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (ent->sounds == 1)
{
ent->noise_index = gi.soundindex("misc/secret.wav");
@ -237,13 +237,13 @@ SP_trigger_multiple(edict_t *ent)
*/
void
SP_trigger_once(edict_t *ent)
{
{
if (!ent)
{
return;
}
/* make old maps work because I messed up
/* make old maps work because I messed up
on flag assignments here. triggered was
on bit 1 when it should have been on bit 4 */
if (ent->spawnflags & 1)
@ -278,12 +278,12 @@ trigger_relay_use(edict_t *self, edict_t *other /* unused */, edict_t *activator
void
SP_trigger_relay(edict_t *self)
{
{
if (!self)
{
return;
}
self->use = trigger_relay_use;
}
@ -402,12 +402,12 @@ trigger_key_use(edict_t *self, edict_t *other /* unused */, edict_t *activator)
void
SP_trigger_key(edict_t *self)
{
{
if (!self)
{
return;
}
if (!st.item)
{
gi.dprintf("no key item for trigger_key at %s\n", vtos(self->s.origin));
@ -486,12 +486,12 @@ trigger_counter_use(edict_t *self, edict_t *other /* unused */, edict_t *activat
void
SP_trigger_counter(edict_t *self)
{
{
if (!self)
{
return;
}
self->wait = -1;
if (!self->count)
@ -508,13 +508,13 @@ SP_trigger_counter(edict_t *self)
*/
void
SP_trigger_always(edict_t *ent)
{
{
if (!ent)
{
return;
}
/* we must have some delay to make
/* we must have some delay to make
sure our use targets are present */
if (ent->delay < 0.2)
{
@ -573,12 +573,12 @@ trigger_effect(edict_t *self)
vec3_t origin;
vec3_t size;
int i;
if (!self)
{
return;
}
VectorScale(self->size, 0.5, size);
VectorAdd(self->absmin, size, origin);
@ -597,12 +597,12 @@ trigger_effect(edict_t *self)
void
trigger_push_inactive(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->delay > level.time)
{
self->nextthink = level.time + 0.1;
@ -618,12 +618,12 @@ trigger_push_inactive(edict_t *self)
void
trigger_push_active(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->delay > level.time)
{
self->nextthink = level.time + 0.1;
@ -644,12 +644,12 @@ SP_trigger_push(edict_t *self)
InitTrigger(self);
windsound = gi.soundindex("misc/windfly.wav");
self->touch = trigger_push_touch;
if (!self)
{
return;
}
if (self->spawnflags & 2)
{
if (!self->wait)
@ -681,15 +681,15 @@ SP_trigger_push(edict_t *self)
* NO_PROTECTION *nothing* stops the damage
*
* "dmg" default 5 (whole numbers only)
*/
*/
void
hurt_use(edict_t *self, edict_t *other /* unused */, edict_t *activator /* unused */)
{
{
if (!self)
{
return;
}
if (self->solid == SOLID_NOT)
{
self->solid = SOLID_TRIGGER;
@ -708,7 +708,7 @@ hurt_use(edict_t *self, edict_t *other /* unused */, edict_t *activator /* unuse
}
void
hurt_touch(edict_t *self, edict_t *other, cplane_t *plane /* unused */,
hurt_touch(edict_t *self, edict_t *other, cplane_t *plane /* unused */,
csurface_t *surf /* unused */)
{
int dflags;
@ -760,12 +760,12 @@ hurt_touch(edict_t *self, edict_t *other, cplane_t *plane /* unused */,
void
SP_trigger_hurt(edict_t *self)
{
{
if (!self)
{
return;
}
InitTrigger(self);
self->noise_index = gi.soundindex("world/electro.wav");
@ -813,12 +813,12 @@ trigger_gravity_touch(edict_t *self, edict_t *other,
void
SP_trigger_gravity(edict_t *self)
{
{
if (!self)
{
return;
}
if (st.gravity == 0)
{
gi.dprintf("trigger_gravity without gravity set at %s\n",
@ -878,12 +878,12 @@ trigger_monsterjump_touch(edict_t *self, edict_t *other,
void
SP_trigger_monsterjump(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->speed)
{
self->speed = 200;

View file

@ -6,13 +6,13 @@
*/
#include "header/local.h"
void infantry_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage);
void infantry_stand(edict_t *self);
void monster_use(edict_t *self, edict_t *other, edict_t *activator);
qboolean FindTarget(edict_t *self);
void
AnglesNormalize(vec3_t vec)
{
@ -103,12 +103,12 @@ turret_breach_fire(edict_t *self)
vec3_t start;
int damage;
int speed;
if (!self)
{
return;
}
AngleVectors(self->s.angles, f, r, u);
VectorMA(self->s.origin, self->move_origin[0], f, start);
VectorMA(start, self->move_origin[1], r, start);
@ -127,12 +127,12 @@ turret_breach_think(edict_t *self)
edict_t *ent;
vec3_t current_angles;
vec3_t delta;
if (!self)
{
return;
}
VectorCopy(self->s.angles, current_angles);
AnglesNormalize(current_angles);
@ -286,12 +286,12 @@ turret_breach_think(edict_t *self)
void
turret_breach_finish_init(edict_t *self)
{
{
if (!self)
{
return;
}
/* get and save info for muzzle location */
if (!self->target)
{
@ -313,12 +313,12 @@ turret_breach_finish_init(edict_t *self)
void
SP_turret_breach(edict_t *self)
{
{
if (!self)
{
return;
}
self->solid = SOLID_BSP;
self->movetype = MOVETYPE_PUSH;
gi.setmodel(self, self->model);
@ -370,12 +370,12 @@ SP_turret_breach(edict_t *self)
*/
void
SP_turret_base(edict_t *self)
{
{
if (!self)
{
return;
}
self->solid = SOLID_BSP;
self->movetype = MOVETYPE_PUSH;
gi.setmodel(self, self->model);
@ -425,12 +425,12 @@ turret_driver_think(edict_t *self)
vec3_t target;
vec3_t dir;
float reaction_time;
if (!self)
{
return;
}
self->nextthink = level.time + FRAMETIME;
if (self->enemy && (!self->enemy->inuse || (self->enemy->health <= 0)))
@ -493,12 +493,12 @@ turret_driver_link(edict_t *self)
{
vec3_t vec;
edict_t *ent;
if (!self)
{
return;
}
self->think = turret_driver_think;
self->nextthink = level.time + FRAMETIME;
@ -533,12 +533,12 @@ turret_driver_link(edict_t *self)
void
SP_turret_driver(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -508,12 +508,12 @@ G_TouchTriggers(edict_t *ent)
{
int i, num;
edict_t *touch[MAX_EDICTS], *hit;
if (!ent)
{
return;
}
/* dead things don't activate triggers! */
if ((ent->client || (ent->svflags & SVF_MONSTER)) && (ent->health <= 0))
{
@ -523,7 +523,7 @@ G_TouchTriggers(edict_t *ent)
num = gi.BoxEdicts(ent->absmin, ent->absmax, touch,
MAX_EDICTS, AREA_TRIGGERS);
/* be careful, it is possible to have an entity in this
/* be careful, it is possible to have an entity in this
list removed before we get to it (killtriggered) */
for (i = 0; i < num; i++)
{
@ -552,16 +552,16 @@ G_TouchSolids(edict_t *ent)
{
int i, num;
edict_t *touch[MAX_EDICTS], *hit;
if (!ent)
{
return;
}
num = gi.BoxEdicts(ent->absmin, ent->absmax, touch,
MAX_EDICTS, AREA_SOLID);
/* be careful, it is possible to have an entity in this
/* be careful, it is possible to have an entity in this
list removed before we get to it (killtriggered) */
for (i = 0; i < num; i++)
{
@ -592,12 +592,12 @@ qboolean
KillBox(edict_t *ent)
{
trace_t tr;
if (!ent)
{
return false;
}
while (1)
{
tr = gi.trace(ent->s.origin, ent->mins, ent->maxs, ent->s.origin,

View file

@ -60,12 +60,12 @@ fire_hit(edict_t *self, vec3_t aim, int damage, int kick)
vec3_t point;
float range;
vec3_t dir;
if (!self)
{
return false;
}
/* see if enemy is in range */
VectorSubtract(self->enemy->s.origin, self->s.origin, dir);
range = VectorLength(dir);
@ -156,12 +156,12 @@ fire_lead(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick,
vec3_t water_start;
qboolean water = false;
int content_mask = MASK_SHOT | MASK_WATER;
if (!self)
{
return;
}
tr = gi.trace(self->s.origin, NULL, NULL, start, self, MASK_SHOT);
if (!(tr.fraction < 1.0))
@ -310,12 +310,12 @@ fire_lead(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick,
void
fire_bullet(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
int kick, int hspread, int vspread, int mod)
{
{
if (!self)
{
return;
}
fire_lead(self, start, aimdir, damage, kick, TE_GUNSHOT,
hspread, vspread, mod);
}
@ -328,12 +328,12 @@ fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
int kick, int hspread, int vspread, int count, int mod)
{
int i;
if (!self)
{
return;
}
for (i = 0; i < count; i++)
{
fire_lead(self, start, aimdir, damage, kick,
@ -412,19 +412,19 @@ fire_blaster(edict_t *self, vec3_t start, vec3_t dir, int damage,
{
edict_t *bolt;
trace_t tr;
if (!self)
{
return;
}
VectorNormalize(dir);
bolt = G_Spawn();
bolt->svflags = SVF_DEADMONSTER;
/* yes, I know it looks weird that projectiles are deadmonsters
what this means is that when prediction is used against the object
/* yes, I know it looks weird that projectiles are deadmonsters
what this means is that when prediction is used against the object
(blaster/hyperblaster shots), the player won't be solid clipped against
the object. Right now trying to run into a firing hyperblaster
is very jerky since you are predicted 'against' the shots. */
@ -474,12 +474,12 @@ fire_blueblaster(edict_t *self, vec3_t start, vec3_t dir, int damage,
{
edict_t *bolt;
trace_t tr;
if (!self)
{
return;
}
VectorNormalize(dir);
bolt = G_Spawn();
@ -523,12 +523,12 @@ Grenade_Explode(edict_t *ent)
{
vec3_t origin;
int mod;
if (!ent)
{
return;
}
if (ent->owner->client)
{
PlayerNoise(ent->owner, ent->s.origin, PNOISE_IMPACT);
@ -661,12 +661,12 @@ fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
edict_t *grenade;
vec3_t dir;
vec3_t forward, right, up;
if (!self)
{
return;
}
vectoangles(aimdir, dir);
AngleVectors(dir, forward, right, up);
@ -701,12 +701,12 @@ fire_grenade2(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
edict_t *grenade;
vec3_t dir;
vec3_t forward, right, up;
if (!self)
{
return;
}
vectoangles(aimdir, dir);
AngleVectors(dir, forward, right, up);
@ -834,12 +834,12 @@ fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage,
int speed, float damage_radius, int radius_damage)
{
edict_t *rocket;
if (!self)
{
return;
}
rocket = G_Spawn();
VectorCopy(start, rocket->s.origin);
VectorCopy(dir, rocket->movedir);
@ -956,12 +956,12 @@ bfg_explode(edict_t *self)
float points;
vec3_t v;
float dist;
if (!self)
{
return;
}
if (self->s.frame == 0)
{
/* the BFG effect */
@ -1082,12 +1082,12 @@ bfg_think(edict_t *self)
vec3_t end;
int dmg;
trace_t tr;
if (!self)
{
return;
}
if (deathmatch->value)
{
dmg = 5;
@ -1181,12 +1181,12 @@ fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage,
int speed, float damage_radius)
{
edict_t *bfg;
if (!self)
{
return;
}
bfg = G_Spawn();
VectorCopy(start, bfg->s.origin);
VectorCopy(dir, bfg->movedir);
@ -1223,12 +1223,12 @@ fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage,
void
ionripper_sparks(edict_t *self)
{
{
if (!self)
{
return;
}
gi.WriteByte(svc_temp_entity);
gi.WriteByte(TE_WELDING_SPARKS);
gi.WriteByte(0);
@ -1283,12 +1283,12 @@ fire_ionripper(edict_t *self, vec3_t start, vec3_t dir, int damage,
{
edict_t *ion;
trace_t tr;
if (!self)
{
return;
}
VectorNormalize(dir);
ion = G_Spawn();
@ -1338,12 +1338,12 @@ heat_think(edict_t *self)
vec3_t vec;
int len;
int oldlen = 0;
if (!self)
{
return;
}
VectorClear(vec);
/* aquire new target */
@ -1407,12 +1407,12 @@ fire_heat(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed,
float damage_radius, int radius_damage)
{
edict_t *heat;
if (!self)
{
return;
}
heat = G_Spawn();
VectorCopy(start, heat->s.origin);
VectorCopy(dir, heat->movedir);
@ -1448,7 +1448,7 @@ void
plasma_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{
vec3_t origin;
if (!ent || !other || !plane || !surf)
{
return;
@ -1495,12 +1495,12 @@ fire_plasma(edict_t *self, vec3_t start, vec3_t dir, int damage,
int speed, float damage_radius, int radius_damage)
{
edict_t *plasma;
if (!self)
{
return;
}
plasma = G_Spawn();
VectorCopy(start, plasma->s.origin);
VectorCopy(dir, plasma->movedir);
@ -1542,12 +1542,12 @@ Trap_Think(edict_t *ent)
int len, i;
int oldlen = 8000;
vec3_t forward, right, up;
if (!ent)
{
return;
}
if (ent->timestamp < level.time)
{
BecomeExplosion1(ent);
@ -1778,12 +1778,12 @@ fire_trap(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
edict_t *trap;
vec3_t dir;
vec3_t forward, right, up;
if (!self)
{
return;
}
vectoangles(aimdir, dir);
AngleVectors(dir, forward, right, up);

View file

@ -17,23 +17,23 @@ static int sound_search;
void
berserk_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
berserk_search(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
@ -56,12 +56,12 @@ mmove_t berserk_move_stand = {
void
berserk_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &berserk_move_stand;
}
@ -97,12 +97,12 @@ mmove_t berserk_move_stand_fidget = {
void
berserk_fidget(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
return;
@ -141,12 +141,12 @@ mmove_t berserk_move_walk = {
void
berserk_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &berserk_move_walk;
}
@ -168,12 +168,12 @@ mmove_t berserk_move_run1 = {
void
berserk_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &berserk_move_stand;
@ -186,7 +186,7 @@ berserk_run(edict_t *self)
void
berserk_attack_spike(edict_t *self)
{
{
static vec3_t aim = {MELEE_DISTANCE, 0, -24};
if (!self)
@ -199,12 +199,12 @@ berserk_attack_spike(edict_t *self)
void
berserk_swing(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_punch, 1, ATTN_NORM, 0);
}
@ -228,7 +228,7 @@ mmove_t berserk_move_attack_spike = {
void
berserk_attack_club(edict_t *self)
{
{
vec3_t aim;
if (!self)
@ -295,12 +295,12 @@ mmove_t berserk_move_attack_strike = {
void
berserk_melee(edict_t *self)
{
{
if (!self)
{
return;
}
if ((rand() % 2) == 0)
{
self->monsterinfo.currentmove = &berserk_move_attack_spike;
@ -356,14 +356,14 @@ mmove_t berserk_move_pain2 = {
};
void
berserk_pain(edict_t *self, edict_t *other /* unsued */,
berserk_pain(edict_t *self, edict_t *other /* unsued */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -394,12 +394,12 @@ berserk_pain(edict_t *self, edict_t *other /* unsued */,
void
berserk_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -454,12 +454,12 @@ berserk_die(edict_t *self, edict_t *inflictor /* unsued */, edict_t *attacker /*
int damage, vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
if (self->health <= self->gib_health)
{
gi.sound(self, CHAN_VOICE, gi.soundindex( "misc/udeath.wav"), 1, ATTN_NORM, 0);
@ -503,12 +503,12 @@ berserk_die(edict_t *self, edict_t *inflictor /* unsued */, edict_t *attacker /*
*/
void
SP_monster_berserk(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -19,12 +19,12 @@ static int sound_search1;
void
boss2_search(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() < 0.5)
{
gi.sound(self, CHAN_VOICE, sound_search1, 1, ATTN_NONE, 0);
@ -47,12 +47,12 @@ Boss2Rocket(edict_t *self)
vec3_t start;
vec3_t dir;
vec3_t vec;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_BOSS2_ROCKET_1],
@ -93,12 +93,12 @@ boss2_firebullet_right(edict_t *self)
{
vec3_t forward, right, target;
vec3_t start;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_BOSS2_MACHINEGUN_R1],
forward, right, start);
@ -117,12 +117,12 @@ boss2_firebullet_left(edict_t *self)
{
vec3_t forward, right, target;
vec3_t start;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_BOSS2_MACHINEGUN_L1],
forward, right, start);
@ -139,12 +139,12 @@ boss2_firebullet_left(edict_t *self)
void
Boss2MachineGun(edict_t *self)
{
{
if (!self)
{
return;
}
boss2_firebullet_left(self);
boss2_firebullet_right(self);
}
@ -173,7 +173,7 @@ mframe_t boss2_frames_stand[] = {
{ai_stand, 0, NULL}
};
mmove_t boss2_move_stand = {
mmove_t boss2_move_stand = {
FRAME_stand30,
FRAME_stand50,
boss2_frames_stand,
@ -293,7 +293,7 @@ mframe_t boss2_frames_attack_pre_mg[] = {
};
mmove_t boss2_move_attack_pre_mg = {
FRAME_attack1,
FRAME_attack1,
FRAME_attack9,
boss2_frames_attack_pre_mg,
NULL
@ -354,7 +354,7 @@ mframe_t boss2_frames_attack_rocket[] = {
};
mmove_t boss2_move_attack_rocket = {
FRAME_attack20,
FRAME_attack20,
FRAME_attack40,
boss2_frames_attack_rocket,
boss2_run
@ -463,23 +463,23 @@ mmove_t boss2_move_death = {
void
boss2_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &boss2_move_stand;
}
void
boss2_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &boss2_move_stand;
@ -492,12 +492,12 @@ boss2_run(edict_t *self)
void
boss2_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &boss2_move_walk;
}
@ -506,12 +506,12 @@ boss2_attack(edict_t *self)
{
vec3_t vec;
float range;
if (!self)
{
return;
}
VectorSubtract(self->enemy->s.origin, self->s.origin, vec);
range = VectorLength(vec);
@ -534,23 +534,23 @@ boss2_attack(edict_t *self)
void
boss2_attack_mg(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &boss2_move_attack_mg;
}
void
boss2_reattack_mg(edict_t *self)
{
{
if (!self)
{
return;
}
if (infront(self, self->enemy))
{
if (random() <= 0.7)
@ -569,14 +569,14 @@ boss2_reattack_mg(edict_t *self)
}
void
boss2_pain(edict_t *self, edict_t *other /* unused */,
boss2_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -608,12 +608,12 @@ boss2_pain(edict_t *self, edict_t *other /* unused */,
void
boss2_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -56, -56, 0);
VectorSet(self->maxs, 56, 56, 80);
self->movetype = MOVETYPE_TOSS;
@ -625,12 +625,12 @@ boss2_dead(edict_t *self)
void
boss2_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
int damage /* unused */, vec3_t point /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NONE, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_NO;
@ -647,12 +647,12 @@ Boss2_CheckAttack(edict_t *self)
trace_t tr;
int enemy_range;
float enemy_yaw;
if (!self)
{
return false;
}
if (self->enemy->health > 0)
{
/* see if any entities are in the way of the shot */
@ -757,12 +757,12 @@ Boss2_CheckAttack(edict_t *self)
*/
void
SP_monster_boss2(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -2,14 +2,14 @@
#include "boss32.h"
void
Use_Boss3(edict_t *ent, edict_t *other /* unused */,
Use_Boss3(edict_t *ent, edict_t *other /* unused */,
edict_t *activator /* unused */)
{
{
if (!ent)
{
return;
}
gi.WriteByte(svc_temp_entity);
gi.WriteByte(TE_BOSSTPORT);
gi.WritePosition(ent->s.origin);
@ -19,12 +19,12 @@ Use_Boss3(edict_t *ent, edict_t *other /* unused */,
void
Think_Boss3Stand(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (ent->s.frame == FRAME_stand260)
{
ent->s.frame = FRAME_stand201;
@ -44,12 +44,12 @@ Think_Boss3Stand(edict_t *ent)
*/
void
SP_monster_boss3_stand(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -39,17 +39,17 @@ void jorg_idle(edict_t *self);
void jorg_step_left(edict_t *self);
void jorg_step_right(edict_t *self);
void jorg_death_hit(edict_t *self);
void
jorg_search(edict_t *self)
{
float r;
if (!self)
{
return;
}
r = random();
if (r <= 0.3)
@ -130,56 +130,56 @@ mmove_t jorg_move_stand = {
void
jorg_idle(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_NORM, 0);
}
void
jorg_death_hit(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_death_hit, 1, ATTN_NORM, 0);
}
void
jorg_step_left(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_step_left, 1, ATTN_NORM, 0);
}
void
jorg_step_right(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_step_right, 1, ATTN_NORM, 0);
}
void
jorg_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &jorg_move_stand;
}
@ -265,23 +265,23 @@ mmove_t jorg_move_end_walk = {
void
jorg_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &jorg_move_walk;
}
void
jorg_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &jorg_move_stand;
@ -407,7 +407,7 @@ mframe_t jorg_frames_death1[] = {
};
mmove_t jorg_move_death = {
FRAME_death01,
FRAME_death01,
FRAME_death50,
jorg_frames_death1,
jorg_dead
@ -486,12 +486,12 @@ mmove_t jorg_move_end_attack1 = {
void
jorg_reattack1(edict_t *self)
{
{
if (!self)
{
return;
}
if (visible(self, self->enemy))
{
if (random() < 0.9)
@ -513,24 +513,24 @@ jorg_reattack1(edict_t *self)
void
jorg_attack1(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &jorg_move_attack1;
}
void
jorg_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -613,12 +613,12 @@ jorgBFG(edict_t *self)
vec3_t start;
vec3_t dir;
vec3_t vec;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_JORG_BFG_1],
forward, right, start);
@ -636,15 +636,15 @@ jorg_firebullet_right(edict_t *self)
{
vec3_t forward, right, target;
vec3_t start;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_JORG_MACHINEGUN_R1],
forward, right, start);
forward, right, start);
VectorMA(self->enemy->s.origin, -0.2, self->enemy->velocity, target);
target[2] += self->enemy->viewheight;
@ -660,12 +660,12 @@ jorg_firebullet_left(edict_t *self)
{
vec3_t forward, right, target;
vec3_t start;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_JORG_MACHINEGUN_L1],
forward, right, start);
@ -681,24 +681,24 @@ jorg_firebullet_left(edict_t *self)
void
jorg_firebullet(edict_t *self)
{
{
if (!self)
{
return;
}
jorg_firebullet_left(self);
jorg_firebullet_right(self);
}
void
jorg_attack(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() <= 0.75)
{
gi.sound(self, CHAN_VOICE, sound_attack1, 1, ATTN_NORM, 0);
@ -721,12 +721,12 @@ jorg_dead(edict_t *self /* unused */)
void
jorg_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
int damage /* unused */, vec3_t point /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_NO;
@ -744,12 +744,12 @@ Jorg_CheckAttack(edict_t *self)
trace_t tr;
int enemy_range;
float enemy_yaw;
if (!self)
{
return false;
}
if (self->enemy->health > 0)
{
/* see if any entities are in the way of the shot */
@ -854,12 +854,12 @@ Jorg_CheckAttack(edict_t *self)
*/
void
SP_monster_jorg(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -37,12 +37,12 @@ void
makron_taunt(edict_t *self)
{
float r;
if (!self)
{
return;
}
r = random();
if (r <= 0.3)
@ -132,12 +132,12 @@ mmove_t makron_move_stand = {
void
makron_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &makron_move_stand;
}
@ -163,67 +163,67 @@ mmove_t makron_move_run = {
void
makron_hit(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_AUTO, sound_hit, 1, ATTN_NONE, 0);
}
void
makron_popup(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_popup, 1, ATTN_NONE, 0);
}
void
makron_step_left(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_step_left, 1, ATTN_NORM, 0);
}
void
makron_step_right(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_step_right, 1, ATTN_NORM, 0);
}
void
makron_brainsplorch(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_brainsplorch, 1, ATTN_NORM, 0);
}
void
makron_prerailgun(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_prerailgun, 1, ATTN_NORM, 0);
}
@ -249,23 +249,23 @@ mmove_t makron_move_walk = {
void
makron_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &makron_move_walk;
}
void
makron_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &makron_move_stand;
@ -501,12 +501,12 @@ mmove_t makron_move_sight = {
void
makronBFG(edict_t *self)
{
{
if (!self)
{
return;
}
vec3_t forward, right;
vec3_t start;
vec3_t dir;
@ -606,12 +606,12 @@ mmove_t makron_move_attack5 = {
void
MakronSaveloc(edict_t *self)
{
{
if (!self)
{
return;
}
VectorCopy(self->enemy->s.origin, self->pos1); /* save for aiming the shot */
self->pos1[2] += self->enemy->viewheight;
}
@ -622,12 +622,12 @@ MakronRailgun(edict_t *self)
vec3_t start;
vec3_t dir;
vec3_t forward, right;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_MAKRON_RAILGUN_1],
forward, right, start);
@ -647,12 +647,12 @@ MakronHyperblaster(edict_t *self)
vec3_t start;
vec3_t forward, right;
int flash_number;
if (!self)
{
return;
}
flash_number = MZ2_MAKRON_BLASTER_1 + (self->s.frame - FRAME_attak405);
AngleVectors(self->s.angles, forward, right, NULL);
@ -692,12 +692,12 @@ MakronHyperblaster(edict_t *self)
void
makron_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -708,7 +708,7 @@ makron_pain(edict_t *self, edict_t *other /* unused */,
return;
}
/* Lessen the chance of him
/* Lessen the chance of him
going into his pain frames */
if (damage <= 25)
{
@ -756,12 +756,12 @@ makron_pain(edict_t *self, edict_t *other /* unused */,
void
makron_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &makron_move_sight;
}
@ -769,12 +769,12 @@ void
makron_attack(edict_t *self)
{
float r;
if (!self)
{
return;
}
r = random();
if (r <= 0.3)
@ -795,12 +795,12 @@ makron_attack(edict_t *self)
void
makron_torso_think(edict_t *self)
{
{
if (!self)
{
return;
}
if (++self->s.frame < 365)
{
self->nextthink = level.time + FRAMETIME;
@ -814,12 +814,12 @@ makron_torso_think(edict_t *self)
void
makron_torso(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->movetype = MOVETYPE_NONE;
ent->solid = SOLID_NOT;
VectorSet(ent->mins, -8, -8, 0);
@ -835,12 +835,12 @@ makron_torso(edict_t *ent)
/* death */
void
makron_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -60, -60, 0);
VectorSet(self->maxs, 60, 60, 72);
self->movetype = MOVETYPE_TOSS;
@ -855,12 +855,12 @@ makron_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /*
{
edict_t *tempent;
int n;
if (!self)
{
return;
}
self->s.sound = 0;
/* check for gib */
@ -914,12 +914,12 @@ Makron_CheckAttack(edict_t *self)
trace_t tr;
int enemy_range;
float enemy_yaw;
if (!self)
{
return false;
}
if (self->enemy->health > 0)
{
/* see if any entities are in the way of the shot */
@ -1047,12 +1047,12 @@ MakronPrecache(void)
*/
void
SP_monster_makron(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -1,8 +1,8 @@
/* =======================================================================
/* =======================================================================
*
* boss 5, only found in xatrix
*
* =======================================================================
*
* =======================================================================
*/
#include "../../header/local.h"
@ -22,26 +22,26 @@ void boss5_dead(edict_t *self);
void boss5Rocket(edict_t *self);
void boss5MachineGun(edict_t *self);
void boss5_reattack1(edict_t *self);
void
TreadSound2(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, tread_sound, 1, ATTN_NORM, 0);
}
void
boss5_search(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() < 0.5)
{
gi.sound(self, CHAN_VOICE, sound_search1, 1, ATTN_NORM, 0);
@ -125,12 +125,12 @@ mmove_t boss5_move_stand = {
void
boss5_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &boss5_move_stand;
}
@ -193,34 +193,34 @@ mmove_t boss5_move_forward = {
void
boss5_forward(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &boss5_move_forward;
}
void
boss5_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &boss5_move_forward;
}
void
boss5_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &boss5_move_stand;
@ -523,12 +523,12 @@ mmove_t boss5_move_end_attack1 = {
void
boss5_reattack1(edict_t *self)
{
{
if (!self)
{
return;
}
if (visible(self, self->enemy))
{
if (random() < 0.9)
@ -549,12 +549,12 @@ boss5_reattack1(edict_t *self)
void
boss5_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -611,12 +611,12 @@ boss5Rocket(edict_t *self)
vec3_t dir;
vec3_t vec;
int flash_number;
if (!self)
{
return;
}
if (self->s.frame == FRAME_attak2_8)
{
flash_number = MZ2_SUPERTANK_ROCKET_1;
@ -625,7 +625,7 @@ boss5Rocket(edict_t *self)
{
flash_number = MZ2_SUPERTANK_ROCKET_2;
}
else
else
{
flash_number = MZ2_SUPERTANK_ROCKET_3;
}
@ -650,12 +650,12 @@ boss5MachineGun(edict_t *self)
vec3_t start;
vec3_t forward, right;
int flash_number;
if (!self)
{
return;
}
flash_number = MZ2_SUPERTANK_MACHINEGUN_1 + (self->s.frame - FRAME_attak1_1);
dir[0] = 0;
@ -685,12 +685,12 @@ boss5_attack(edict_t *self)
{
vec3_t vec;
float range;
if (!self)
{
return;
}
VectorSubtract(self->enemy->s.origin, self->s.origin, vec);
range = VectorLength(vec);
@ -699,7 +699,7 @@ boss5_attack(edict_t *self)
self->monsterinfo.currentmove = &boss5_move_attack1;
}
else
{
{
/* fire rockets more often at distance */
if (random() < 0.3)
{
@ -716,12 +716,12 @@ boss5_attack(edict_t *self)
void
boss5_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -60, -60, 0);
VectorSet(self->maxs, 60, 60, 72);
self->movetype = MOVETYPE_TOSS;
@ -735,12 +735,12 @@ BossExplode2(edict_t *self)
{
vec3_t org;
int n;
if (!self)
{
return;
}
self->think = BossExplode2;
VectorCopy(self->s.origin, org);
org[2] += 24 + (rand() & 15);
@ -811,15 +811,15 @@ BossExplode2(edict_t *self)
}
void
boss5_die(edict_t *self, edict_t *inflictor /* unused */,
boss5_die(edict_t *self, edict_t *inflictor /* unused */,
edict_t *attacker /* unused */, int damage /* unused */,
vec3_t point /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_NO;
@ -832,12 +832,12 @@ boss5_die(edict_t *self, edict_t *inflictor /* unused */,
*/
void
SP_monster_boss5(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -3,7 +3,7 @@
* Brain.
*
* =======================================================================
*/
*/
#include "../../header/local.h"
#include "brain.h"
@ -24,26 +24,26 @@ static int sound_melee2;
static int sound_melee3;
void brain_run(edict_t *self);
void brain_dead(edict_t *self);
void
brain_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
brain_search(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
@ -93,12 +93,12 @@ mmove_t brain_move_stand = {
void
brain_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &brain_move_stand;
}
@ -148,12 +148,12 @@ mmove_t brain_move_idle = {
void
brain_idle(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_AUTO, sound_idle3, 1, ATTN_IDLE, 0);
self->monsterinfo.currentmove = &brain_move_idle;
}
@ -183,12 +183,12 @@ mmove_t brain_move_walk1 = {
void
brain_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &brain_move_walk1;
}
@ -280,12 +280,12 @@ mmove_t brain_move_pain1 = {
void
brain_duck_down(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_DUCKED)
{
return;
@ -299,12 +299,12 @@ brain_duck_down(edict_t *self)
void
brain_duck_hold(edict_t *self)
{
{
if (!self)
{
return;
}
if (level.time >= self->monsterinfo.pausetime)
{
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
@ -317,12 +317,12 @@ brain_duck_hold(edict_t *self)
void
brain_duck_up(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
@ -416,12 +416,12 @@ mmove_t brain_move_death1 = {
void
brain_swing_right(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_melee1, 1, ATTN_NORM, 0);
}
@ -429,12 +429,12 @@ void
brain_hit_right(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->maxs[0], 8);
if (fire_hit(self, aim, (15 + (rand() % 5)), 40))
@ -445,12 +445,12 @@ brain_hit_right(edict_t *self)
void
brain_swing_left(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_melee2, 1, ATTN_NORM, 0);
}
@ -458,12 +458,12 @@ void
brain_hit_left(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->mins[0], 8);
if (fire_hit(self, aim, (15 + (rand() % 5)), 40))
@ -502,12 +502,12 @@ mmove_t brain_move_attack1 = {
void
brain_chest_open(edict_t *self)
{
{
if (!self)
{
return;
}
self->spawnflags &= ~65536;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
gi.sound(self, CHAN_BODY, sound_chest_open, 1, ATTN_NORM, 0);
@ -517,12 +517,12 @@ void
brain_tentacle_attack(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, 0, 8);
if (fire_hit(self, aim, (10 + (rand() % 5)), -600) && (skill->value > 0))
@ -535,12 +535,12 @@ brain_tentacle_attack(edict_t *self)
void
brain_chest_closed(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
if (self->spawnflags & 65536)
@ -579,12 +579,12 @@ mmove_t brain_move_attack2 = {
void
brain_melee(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() <= 0.5)
{
self->monsterinfo.currentmove = &brain_move_attack1;
@ -630,12 +630,12 @@ brain_tounge_attack(edict_t *self)
vec3_t offset, start, f, r, end, dir;
trace_t tr;
int damage;
if (!self)
{
return;
}
AngleVectors(self->s.angles, f, r, NULL);
VectorSet(offset, 24, 0, 16);
G_ProjectSource(self->s.origin, offset, f, r, start);
@ -734,12 +734,12 @@ brain_laserbeam(edict_t *self)
vec3_t tempang, start;
vec3_t dir, angles, end;
edict_t *ent;
if (!self)
{
return;
}
if (random() > 0.8)
{
gi.sound(self, CHAN_AUTO, gi.soundindex("misc/lasfly.wav"),
@ -787,12 +787,12 @@ brain_laserbeam(edict_t *self)
void
brain_laserbeam_reattack(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() < 0.5)
{
if (visible(self, self->enemy))
@ -847,7 +847,7 @@ mframe_t brain_frames_attack4[] = {
};
mmove_t brain_move_attack4 = {
FRAME_walk101,
FRAME_walk101,
FRAME_walk111,
brain_frames_attack4,
brain_run
@ -857,12 +857,12 @@ void
brain_attack(edict_t *self)
{
int r;
if (!self)
{
return;
}
if (random() < 0.8)
{
r = range(self, self->enemy);
@ -910,12 +910,12 @@ mmove_t brain_move_run = {
void
brain_run(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.power_armor_type = POWER_ARMOR_SCREEN;
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
@ -933,12 +933,12 @@ brain_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage /* unused */)
{
float r;
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -977,12 +977,12 @@ brain_pain(edict_t *self, edict_t *other /* unused */,
void
brain_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -996,12 +996,12 @@ brain_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* u
int damage, vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
self->s.effects = 0;
self->monsterinfo.power_armor_type = POWER_ARMOR_NONE;
@ -1054,12 +1054,12 @@ brain_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* u
*/
void
SP_monster_brain(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -34,12 +34,12 @@ static int sound_search;
void
ChickMoan(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() < 0.5)
{
gi.sound(self, CHAN_VOICE, sound_idle1, 1, ATTN_IDLE, 0);
@ -92,12 +92,12 @@ mmove_t chick_move_fidget = {
void
chick_fidget(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
return;
@ -151,12 +151,12 @@ mmove_t chick_move_stand = {
void
chick_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &chick_move_stand;
}
@ -222,23 +222,23 @@ mmove_t chick_move_walk = {
void
chick_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &chick_move_walk;
}
void
chick_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &chick_move_stand;
@ -322,12 +322,12 @@ chick_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
float r;
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -376,12 +376,12 @@ chick_pain(edict_t *self, edict_t *other /* unused */,
void
chick_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, 0);
VectorSet(self->maxs, 16, 16, 16);
self->movetype = MOVETYPE_TOSS;
@ -451,12 +451,12 @@ chick_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point /*unused */)
{
int n;
if (!self)
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{
@ -506,12 +506,12 @@ chick_die(edict_t *self, edict_t *inflictor /* unused */,
void
chick_duck_down(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_DUCKED)
{
return;
@ -526,12 +526,12 @@ chick_duck_down(edict_t *self)
void
chick_duck_hold(edict_t *self)
{
{
if (!self)
{
return;
}
if (level.time >= self->monsterinfo.pausetime)
{
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
@ -544,12 +544,12 @@ chick_duck_hold(edict_t *self)
void
chick_duck_up(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
@ -598,12 +598,12 @@ void
ChickSlash(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->mins[0], 10);
gi.sound(self, CHAN_WEAPON, sound_melee_swing, 1, ATTN_NORM, 0);
fire_hit(self, aim, (10 + (rand() % 6)), 100);
@ -616,12 +616,12 @@ ChickRocket(edict_t *self)
vec3_t start;
vec3_t dir;
vec3_t vec;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_CHICK_ROCKET_1],
forward, right, start);
@ -643,23 +643,23 @@ ChickRocket(edict_t *self)
void
Chick_PreAttack1(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_missile_prelaunch, 1, ATTN_NORM, 0);
}
void
ChickReload(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_missile_reload, 1, ATTN_NORM, 0);
}
@ -727,12 +727,12 @@ mmove_t chick_move_end_attack1 = {
void
chick_rerocket(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->enemy->health > 0)
{
if (range(self, self->enemy) > RANGE_MELEE)
@ -753,12 +753,12 @@ chick_rerocket(edict_t *self)
void
chick_attack1(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &chick_move_attack1;
}
@ -797,12 +797,12 @@ mmove_t chick_move_end_slash = {
void
chick_reslash(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->enemy->health > 0)
{
if (range(self, self->enemy) == RANGE_MELEE)
@ -844,34 +844,34 @@ mmove_t chick_move_start_slash = {
void
chick_melee(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &chick_move_start_slash;
}
void
chick_attack(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &chick_move_start_attack1;
}
void
chick_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
@ -880,12 +880,12 @@ chick_sight(edict_t *self, edict_t *other /* unused */)
*/
void
SP_monster_chick(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);
@ -942,12 +942,12 @@ SP_monster_chick(edict_t *self)
*/
void
SP_monster_chick_heat(edict_t *self)
{
{
if (!self)
{
return;
}
SP_monster_chick(self);
self->s.skinnum = 3;
}

View file

@ -60,12 +60,12 @@ fixbot_FindDeadMonster(edict_t *self)
{
edict_t *ent = NULL;
edict_t *best = NULL;
if (!self)
{
return NULL;
}
while ((ent = findradius(ent, self->s.origin, 1024)) != NULL)
{
if (ent == self)
@ -124,12 +124,12 @@ int
fixbot_search(edict_t *self)
{
edict_t *ent;
if (!self)
{
return 0;
}
if (!self->goalentity)
{
ent = fixbot_FindDeadMonster(self);
@ -155,12 +155,12 @@ landing_goal(edict_t *self)
vec3_t forward, right, up;
vec3_t end;
edict_t *ent;
if (!self)
{
return;
}
ent = G_Spawn();
ent->classname = "bot_goal";
ent->solid = SOLID_BBOX;
@ -190,12 +190,12 @@ takeoff_goal(edict_t *self)
vec3_t forward, right, up;
vec3_t end;
edict_t *ent;
if (!self)
{
return;
}
ent = G_Spawn();
ent->classname = "bot_goal";
ent->solid = SOLID_BBOX;
@ -220,12 +220,12 @@ takeoff_goal(edict_t *self)
void
change_to_roam(edict_t *self)
{
{
if (!self)
{
return;
}
if (fixbot_search(self))
{
return;
@ -273,12 +273,12 @@ roam_goal(edict_t *self)
int len, oldlen, i;
vec3_t vec;
vec3_t whichvec;
if (!self)
{
return;
}
whichvec[0] = 0;
whichvec[1] = 0;
whichvec[2] = 0;
@ -332,12 +332,12 @@ use_scanner(edict_t *self)
float radius = 1024;
vec3_t vec;
int len;
if (!self)
{
return;
}
while ((ent = findradius(ent, self->s.origin, radius)) != NULL)
{
if (ent->health >= 100)
@ -430,12 +430,12 @@ blastoff(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
vec3_t water_start;
qboolean water = false;
int content_mask = MASK_SHOT | MASK_WATER;
if (!self)
{
return;
}
hspread += (self->s.frame - FRAME_takeoff_01);
vspread += (self->s.frame - FRAME_takeoff_01);
@ -589,12 +589,12 @@ fly_vertical(edict_t *self)
vec3_t forward, right, up;
vec3_t start;
vec3_t tempvec;
if (!self)
{
return;
}
VectorSubtract(self->goalentity->s.origin, self->s.origin, v);
self->ideal_yaw = vectoyaw(v);
M_ChangeYaw(self);
@ -627,12 +627,12 @@ fly_vertical2(edict_t *self)
{
vec3_t v;
int len;
if (!self)
{
return;
}
VectorSubtract(self->goalentity->s.origin, self->s.origin, v);
len = VectorLength(v);
self->ideal_yaw = vectoyaw(v);
@ -784,7 +784,7 @@ mmove_t fixbot_move_stand2 = {
/*
* will need the pickup offset for the front pincers
* object will need to stop forward of the object
* and take the object with it ( this may require a
* and take the object with it ( this may require a
* variant of liftoff and landing )
*/
mframe_t fixbot_frames_pickup[] = {
@ -842,12 +842,12 @@ void
ai_facing(edict_t *self, float dist)
{
vec3_t v;
if (!self)
{
return;
}
if (infront(self, self->goalentity))
{
self->monsterinfo.currentmove = &fixbot_move_forward;
@ -873,12 +873,12 @@ mmove_t fixbot_move_turn = {
void
go_roam(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &fixbot_move_stand;
}
@ -965,7 +965,7 @@ mmove_t fixbot_move_pain3 = {
/*
* bot has compleated landing
* and is now on the grownd
* ( may need second land if the
* ( may need second land if the
* bot is releasing jib into jib vat )
*/
mframe_t fixbot_frames_land[] = {
@ -981,12 +981,12 @@ mmove_t fixbot_move_land = {
void
ai_movetogoal(edict_t *self, float dist)
{
{
if (!self)
{
return;
}
M_MoveToGoal(self, dist);
}
@ -1008,7 +1008,7 @@ mframe_t fixbot_frames_walk[] = {
mmove_t fixbot_move_walk = {
FRAME_freeze_01,
FRAME_freeze_01,
fixbot_frames_walk,
fixbot_frames_walk,
NULL
};
@ -1078,12 +1078,12 @@ check_telefrag(edict_t *self)
vec3_t start = {0, 0, 0};
vec3_t forward, right, up;
trace_t tr;
if (!self)
{
return 0;
}
AngleVectors(self->enemy->s.angles, forward, right, up);
VectorMA(start, 48, up, start);
tr = gi.trace(self->enemy->s.origin, self->enemy->mins, self->enemy->maxs,
@ -1105,12 +1105,12 @@ fixbot_fire_laser(edict_t *self)
vec3_t tempang, start;
vec3_t dir, angles, end;
edict_t *ent;
if (!self)
{
return;
}
/* critter dun got blown up while bein' fixed */
if (self->enemy->health <= self->enemy->gib_health)
{
@ -1185,7 +1185,7 @@ mmove_t fixbot_move_laserattack = {
NULL
};
/* need to get forward translation
/* need to get forward translation
data for the charge attack */
mframe_t fixbot_frames_attack2[] = {
{ai_charge, 0, NULL},
@ -1233,12 +1233,12 @@ mmove_t fixbot_move_attack2 = {
void
weldstate(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->s.frame == FRAME_weldstart_10)
{
self->monsterinfo.currentmove = &fixbot_move_weld;
@ -1266,12 +1266,12 @@ void
ai_move2(edict_t *self, float dist)
{
vec3_t v;
if (!self)
{
return;
}
if (dist)
{
M_walkmove(self, self->s.angles[YAW], dist);
@ -1343,12 +1343,12 @@ fixbot_fire_welder(edict_t *self)
vec3_t forward, right, up;
vec3_t vec;
float r;
if (!self)
{
return;
}
if (!self->enemy)
{
return;
@ -1395,12 +1395,12 @@ fixbot_fire_blaster(edict_t *self)
vec3_t forward, right, up;
vec3_t end;
vec3_t dir;
if (!self)
{
return;
}
if (!visible(self, self->enemy))
{
self->monsterinfo.currentmove = &fixbot_move_run;
@ -1420,23 +1420,23 @@ fixbot_fire_blaster(edict_t *self)
void
fixbot_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &fixbot_move_stand;
}
void
fixbot_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &fixbot_move_stand;
@ -1452,12 +1452,12 @@ fixbot_walk(edict_t *self)
{
vec3_t vec;
int len;
if (!self)
{
return;
}
if (strcmp(self->goalentity->classname, "object_repair") == 0)
{
VectorSubtract(self->s.origin, self->goalentity->s.origin, vec);
@ -1475,12 +1475,12 @@ fixbot_walk(edict_t *self)
void
fixbot_start_attack(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &fixbot_move_start_attack;
}
@ -1489,12 +1489,12 @@ fixbot_attack(edict_t *self)
{
vec3_t vec;
int len;
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_MEDIC)
{
if (!visible(self, self->goalentity))
@ -1523,12 +1523,12 @@ fixbot_attack(edict_t *self)
void
fixbot_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage /* unused */)
{
{
if (!self)
{
return;
}
if (level.time < self->pain_debounce_time)
{
return;
@ -1553,12 +1553,12 @@ fixbot_pain(edict_t *self, edict_t *other /* unused */,
void
fixbot_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -1570,12 +1570,12 @@ fixbot_dead(edict_t *self)
void
fixbot_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
int damage /* unused */, vec3_t point /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
}
@ -1585,12 +1585,12 @@ fixbot_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /*
*/
void
SP_monster_fixbot(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -34,12 +34,12 @@ mmove_t flipper_move_stand = {
void
flipper_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_stand;
}
@ -81,12 +81,12 @@ mmove_t flipper_move_run_loop = {
void
flipper_run_loop(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_run_loop;
}
@ -108,12 +108,12 @@ mmove_t flipper_move_run_start = {
void
flipper_run(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_run_start;
}
@ -154,12 +154,12 @@ mmove_t flipper_move_walk = {
void
flipper_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_walk;
}
@ -179,12 +179,12 @@ mmove_t flipper_move_start_run = {
void
flipper_start_run(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_start_run;
}
@ -222,24 +222,24 @@ void
flipper_bite(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, 0, 0);
fire_hit(self, aim, 5, 0);
}
void
flipper_preattack(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_chomp, 1, ATTN_NORM, 0);
}
@ -275,12 +275,12 @@ mmove_t flipper_move_attack = {
void
flipper_melee(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flipper_move_attack;
}
@ -289,12 +289,12 @@ flipper_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
int n;
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -328,12 +328,12 @@ flipper_pain(edict_t *self, edict_t *other /* unused */,
void
flipper_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -415,12 +415,12 @@ mmove_t flipper_move_death = {
void
flipper_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
@ -429,16 +429,16 @@ flipper_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /*
int damage, vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{
gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"),
gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"),
1, ATTN_NORM, 0);
for (n = 0; n < 2; n++)
@ -476,12 +476,12 @@ flipper_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /*
*/
void
SP_monster_flipper(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -3,7 +3,7 @@
* Mechanic.
*
* =======================================================================
*/
*/
#include "../../header/local.h"
#include "float.h"
@ -15,33 +15,33 @@ static int sound_idle;
static int sound_pain1;
static int sound_pain2;
static int sound_sight;
void floater_dead(edict_t *self);
void floater_die(edict_t *self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point);
void floater_run(edict_t *self);
void floater_wham(edict_t *self);
void floater_zap(edict_t *self);
void
floater_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
floater_idle(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
@ -53,12 +53,12 @@ floater_fire_blaster(edict_t *self)
vec3_t end;
vec3_t dir;
int effect;
if (!self)
{
return;
}
if ((self->s.frame == FRAME_attak104) || (self->s.frame == FRAME_attak107))
{
effect = EF_HYPERBLASTER;
@ -199,18 +199,18 @@ mframe_t floater_frames_stand2[] = {
mmove_t floater_move_stand2 = {
FRAME_stand201,
FRAME_stand252,
floater_frames_stand2,
floater_frames_stand2,
NULL
};
void
floater_stand(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() <= 0.5)
{
self->monsterinfo.currentmove = &floater_move_stand1;
@ -500,7 +500,7 @@ mframe_t floater_frames_walk[] = {
};
mmove_t floater_move_walk = {
FRAME_stand101,
FRAME_stand101,
FRAME_stand152,
floater_frames_walk,
NULL
@ -570,12 +570,12 @@ mmove_t floater_move_run = {
void
floater_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &floater_move_stand1;
@ -588,12 +588,12 @@ floater_run(edict_t *self)
void
floater_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &floater_move_walk;
}
@ -601,12 +601,12 @@ void
floater_wham(edict_t *self)
{
static vec3_t aim = {MELEE_DISTANCE, 0, 0};
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_attack3, 1, ATTN_NORM, 0);
fire_hit(self, aim, 5 + rand() % 6, -50);
}
@ -618,12 +618,12 @@ floater_zap(edict_t *self)
vec3_t origin;
vec3_t dir;
vec3_t offset;
if (!self)
{
return;
}
VectorSubtract(self->enemy->s.origin, self->s.origin, dir);
AngleVectors(self->s.angles, forward, right, NULL);
@ -647,23 +647,23 @@ floater_zap(edict_t *self)
void
floater_attack(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &floater_move_attack1;
}
void
floater_melee(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() < 0.5)
{
self->monsterinfo.currentmove = &floater_move_attack3;
@ -679,12 +679,12 @@ floater_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
int n;
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -718,12 +718,12 @@ floater_pain(edict_t *self, edict_t *other /* unused */,
void
floater_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -735,12 +735,12 @@ floater_dead(edict_t *self)
void
floater_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
int damage /* unused */, vec3_t point /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_death1, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
}
@ -750,12 +750,12 @@ floater_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /*
*/
void
SP_monster_floater(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -28,34 +28,34 @@ void flyer_nextmove(edict_t *self);
void
flyer_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
flyer_idle(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
void
flyer_pop_blades(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sproing, 1, ATTN_NORM, 0);
}
@ -226,12 +226,12 @@ mmove_t flyer_move_run = {
void
flyer_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &flyer_move_stand;
@ -244,23 +244,23 @@ flyer_run(edict_t *self)
void
flyer_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flyer_move_walk;
}
void
flyer_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flyer_move_stand;
}
@ -299,23 +299,23 @@ mmove_t flyer_move_stop = {
void
flyer_stop(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flyer_move_stop;
}
void
flyer_start(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flyer_move_start;
}
@ -462,12 +462,12 @@ flyer_fire(edict_t *self, int flash_number)
vec3_t end;
vec3_t dir;
int effect;
if (!self)
{
return;
}
if ((self->s.frame == FRAME_attak204) ||
(self->s.frame == FRAME_attak207) || (self->s.frame == FRAME_attak210))
{
@ -491,23 +491,23 @@ flyer_fire(edict_t *self, int flash_number)
void
flyer_fireleft(edict_t *self)
{
{
if (!self)
{
return;
}
flyer_fire(self, MZ2_FLYER_BLASTER_1);
}
void
flyer_fireright(edict_t *self)
{
{
if (!self)
{
return;
}
flyer_fire(self, MZ2_FLYER_BLASTER_2);
}
@ -542,12 +542,12 @@ void
flyer_slash_left(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->mins[0], 0);
fire_hit(self, aim, 5, 0);
gi.sound(self, CHAN_WEAPON, sound_slash, 1, ATTN_NORM, 0);
@ -557,12 +557,12 @@ void
flyer_slash_right(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->maxs[0], 0);
fire_hit(self, aim, 5, 0);
gi.sound(self, CHAN_WEAPON, sound_slash, 1, ATTN_NORM, 0);
@ -621,46 +621,46 @@ mmove_t flyer_move_loop_melee = {
void
flyer_loop_melee(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flyer_move_loop_melee;
}
void
flyer_attack(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flyer_move_attack2;
}
void
flyer_setstart(edict_t *self)
{
{
if (!self)
{
return;
}
nextmove = ACTION_run;
self->monsterinfo.currentmove = &flyer_move_start;
}
void
flyer_nextmove(edict_t *self)
{
{
if (!self)
{
return;
}
if (nextmove == ACTION_attack1)
{
self->monsterinfo.currentmove = &flyer_move_start_melee;
@ -677,23 +677,23 @@ flyer_nextmove(edict_t *self)
void
flyer_melee(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &flyer_move_start_melee;
}
void
flyer_check_melee(edict_t *self)
{
{
if (!self)
{
return;
}
if (range(self, self->enemy) == RANGE_MELEE)
{
if (random() <= 0.8)
@ -716,12 +716,12 @@ flyer_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
int n;
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -762,12 +762,12 @@ void
flyer_die(edict_t *self, edict_t *inflictor /* unused */,
edict_t *attacker /* unused */, int damage /* unused */,
vec3_t point /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
}
@ -777,12 +777,12 @@ flyer_die(edict_t *self, edict_t *inflictor /* unused */,
*/
void
SP_monster_flyer(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -50,12 +50,12 @@ void gekk_walk(edict_t *self);
qboolean
gekk_check_melee(edict_t *self)
{
{
if (!self)
{
return false;
}
if (!self->enemy && (self->enemy->health <= 0))
{
return false;
@ -74,12 +74,12 @@ gekk_check_jump(edict_t *self)
{
vec3_t v;
float distance;
if (!self)
{
return false;
}
if (self->absmin[2] > (self->enemy->absmin[2] + 0.75 * self->enemy->size[2]))
{
return false;
@ -116,12 +116,12 @@ gekk_check_jump_close(edict_t *self)
{
vec3_t v;
float distance;
if (!self)
{
return false;
}
v[0] = self->s.origin[0] - self->enemy->s.origin[0];
v[1] = self->s.origin[1] - self->enemy->s.origin[1];
v[2] = 0;
@ -145,12 +145,12 @@ gekk_check_jump_close(edict_t *self)
qboolean
gekk_checkattack(edict_t *self)
{
{
if (!self)
{
return false;
}
if (!self->enemy || (self->enemy->health <= 0))
{
return false;
@ -181,12 +181,12 @@ void
gekk_step(edict_t *self)
{
int n;
if (!self)
{
return;
}
n = (rand() + 1) % 3;
if (n == 0)
@ -205,12 +205,12 @@ gekk_step(edict_t *self)
void
gekk_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
@ -218,12 +218,12 @@ void
gekk_search(edict_t *self)
{
float r;
if (!self)
{
return;
}
if (self->spawnflags & 8)
{
r = random();
@ -269,34 +269,34 @@ gekk_search(edict_t *self)
void
gekk_swing(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_swing, 1, ATTN_NORM, 0);
}
void
gekk_face(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gekk_move_run;
}
void
ai_stand2(edict_t *self, float dist)
{
{
if (!self)
{
return;
}
if (self->spawnflags & 8)
{
ai_move(self, dist);
@ -391,12 +391,12 @@ mmove_t gekk_move_standunderwater = {
void
gekk_swim_loop(edict_t *self)
{
{
if (!self)
{
return;
}
self->flags |= FL_SWIM;
self->monsterinfo.currentmove = &gekk_move_swim_loop;
}
@ -463,12 +463,12 @@ mmove_t gekk_move_swim_start = {
void
gekk_swim(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->enemy->waterlevel && (random() > 0.7))
{
water_to_land(self);
@ -477,12 +477,12 @@ gekk_swim(edict_t *self)
void
gekk_stand(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->waterlevel)
{
self->monsterinfo.currentmove = &gekk_move_standunderwater;
@ -495,23 +495,23 @@ gekk_stand(edict_t *self)
void
gekk_chant(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gekk_move_chant;
}
void
gekk_idle_loop(edict_t *self)
{
{
if (!self)
{
return;
}
if ((random() > 0.75) && (self->health < self->max_health))
{
self->monsterinfo.nextframe = FRAME_idle_01;
@ -617,12 +617,12 @@ mmove_t gekk_move_chant = {
void
gekk_idle(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->waterlevel)
{
self->monsterinfo.currentmove = &gekk_move_idle;
@ -651,23 +651,23 @@ mmove_t gekk_move_walk = {
void
gekk_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gekk_move_walk;
}
void
gekk_run_start(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->waterlevel)
{
self->monsterinfo.currentmove = &gekk_move_swim_start;
@ -680,12 +680,12 @@ gekk_run_start(edict_t *self)
void
gekk_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->waterlevel)
{
self->monsterinfo.currentmove = &gekk_move_swim_start;
@ -736,12 +736,12 @@ void
gekk_hit_left(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->mins[0], 8);
if (fire_hit(self, aim, (15 + (rand() % 5)), 100))
@ -758,12 +758,12 @@ void
gekk_hit_right(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->maxs[0], 8);
if (fire_hit(self, aim, (15 + (rand() % 5)), 100))
@ -778,12 +778,12 @@ gekk_hit_right(edict_t *self)
void
gekk_check_refire(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->enemy || !self->enemy->inuse || (self->enemy->health <= 0))
{
return;
@ -807,12 +807,12 @@ gekk_check_refire(edict_t *self)
void
loogie_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
{
if (!self || !other || !plane || !surf)
{
return;
}
if (other == self->owner)
{
return;
@ -844,12 +844,12 @@ fire_loogie(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed)
{
edict_t *loogie;
trace_t tr;
if (!self)
{
return;
}
VectorNormalize(dir);
loogie = G_Spawn();
@ -890,12 +890,12 @@ loogie(edict_t *self)
vec3_t end;
vec3_t dir;
vec3_t gekkoffset;
if (!self)
{
return;
}
VectorSet(gekkoffset, -18, -0.8, 24);
if (!self->enemy || (self->enemy->health <= 0))
@ -917,12 +917,12 @@ loogie(edict_t *self)
void
reloogie(edict_t *self)
{
{
if (!self)
{
return;
}
if ((random() > 0.8) && (self->health < self->max_health))
{
self->monsterinfo.currentmove = &gekk_move_idle2;
@ -1000,12 +1000,12 @@ mmove_t gekk_move_attack2 = {
void
gekk_check_underwater(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->waterlevel)
{
land_to_water(self);
@ -1076,12 +1076,12 @@ void
gekk_bite(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, 0, 0);
fire_hit(self, aim, 5, 0);
}
@ -1129,12 +1129,12 @@ void
gekk_melee(edict_t *self)
{
float r;
if (!self)
{
return;
}
if (self->waterlevel)
{
self->monsterinfo.currentmove = &gekk_move_attack;
@ -1157,12 +1157,12 @@ gekk_melee(edict_t *self)
void
gekk_jump_touch(edict_t *self, edict_t *other, cplane_t *plane /* unsued */,
csurface_t *surf /* unused */)
{
{
if (!self || !other)
{
return;
}
if (self->health <= 0)
{
self->touch = NULL;
@ -1204,12 +1204,12 @@ void
gekk_jump_takeoff(edict_t *self)
{
vec3_t forward;
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
AngleVectors(self->s.angles, forward, NULL, NULL);
self->s.origin[2] += 1;
@ -1236,12 +1236,12 @@ void
gekk_jump_takeoff2(edict_t *self)
{
vec3_t forward;
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
AngleVectors(self->s.angles, forward, NULL, NULL);
self->s.origin[2] = self->enemy->s.origin[2];
@ -1265,12 +1265,12 @@ gekk_jump_takeoff2(edict_t *self)
void
gekk_stop_skid(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->groundentity)
{
VectorClear(self->velocity);
@ -1279,12 +1279,12 @@ gekk_stop_skid(edict_t *self)
void
gekk_check_landing(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->groundentity)
{
gi.sound(self, CHAN_WEAPON, sound_thud, 1, ATTN_NORM, 0);
@ -1308,12 +1308,12 @@ gekk_check_landing(edict_t *self)
void
gekk_jump(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->flags & FL_SWIM || self->waterlevel)
{
return;
@ -1400,16 +1400,16 @@ mmove_t gekk_move_pain2 = {
};
void
gekk_pain(edict_t *self, edict_t *other /* unused */,
gekk_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage /* unused */)
{
float r;
if (!self)
{
return;
}
if (self->spawnflags & 8)
{
self->spawnflags &= ~8;
@ -1460,12 +1460,12 @@ gekk_pain(edict_t *self, edict_t *other /* unused */,
void
gekk_dead(edict_t *self)
{
{
if (!self)
{
return;
}
/* fix this because of no blocking problem */
if (self->waterlevel)
{
@ -1486,12 +1486,12 @@ void
gekk_gibfest(edict_t *self)
{
int damage = 20;
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"), 1, ATTN_NORM, 0);
ThrowGibACID(self, "models/objects/gekkgib/pelvis/tris.md2", damage, GIB_ORGANIC);
@ -1509,12 +1509,12 @@ gekk_gibfest(edict_t *self)
void
isgibfest(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() > 0.9)
{
gekk_gibfest(self);
@ -1659,12 +1659,12 @@ gekk_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* un
int damage, vec3_t point /* unused */)
{
float r;
if (!self)
{
return;
}
if (self->health <= self->gib_health)
{
gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"), 1, ATTN_NORM, 0);
@ -1718,12 +1718,12 @@ gekk_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* un
void
gekk_duck_down(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_DUCKED)
{
return;
@ -1738,12 +1738,12 @@ gekk_duck_down(edict_t *self)
void
gekk_duck_up(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
@ -1752,12 +1752,12 @@ gekk_duck_up(edict_t *self)
void
gekk_duck_hold(edict_t *self)
{
{
if (!self)
{
return;
}
if (level.time >= self->monsterinfo.pausetime)
{
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
@ -1818,12 +1818,12 @@ void
gekk_dodge(edict_t *self, edict_t *attacker, float eta)
{
float r;
if (!self || !attacker)
{
return;
}
r = random();
if (r > 0.25)
@ -1942,12 +1942,12 @@ gekk_dodge(edict_t *self, edict_t *attacker, float eta)
*/
void
SP_monster_gekk(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);
@ -2018,12 +2018,12 @@ SP_monster_gekk(edict_t *self)
void
water_to_land(edict_t *self)
{
{
if (!self)
{
return;
}
self->flags &= ~FL_SWIM;
self->yaw_speed = 20;
self->viewheight = 25;
@ -2036,12 +2036,12 @@ water_to_land(edict_t *self)
void
land_to_water(edict_t *self)
{
{
if (!self)
{
return;
}
self->flags |= FL_SWIM;
self->yaw_speed = 10;
self->viewheight = 10;

View file

@ -21,45 +21,45 @@ static int sound_sight;
void
gladb_idle(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
void
gladb_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
gladb_search(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
void
gladb_cleaver_swing(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_cleaver_swing, 1, ATTN_NORM, 0);
}
@ -82,12 +82,12 @@ mmove_t gladb_move_stand = {
void
gladb_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gladb_move_stand;
}
@ -119,12 +119,12 @@ mmove_t gladb_move_walk = {
void
gladb_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gladb_move_walk;
}
@ -146,12 +146,12 @@ mmove_t gladb_move_run = {
void
gladb_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &gladb_move_stand;
@ -166,12 +166,12 @@ void
GladbMelee(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->mins[0], -4);
if (fire_hit(self, aim, (20 + (rand() % 5)), 300))
@ -213,12 +213,12 @@ mmove_t gladb_move_attack_melee = {
void
gladb_melee(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gladb_move_attack_melee;
}
@ -228,12 +228,12 @@ gladbGun(edict_t *self)
vec3_t start;
vec3_t dir;
vec3_t forward, right;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_GLADIATOR_RAILGUN_1],
forward, right, start);
@ -247,12 +247,12 @@ gladbGun(edict_t *self)
void
gladbGun_check(edict_t *self)
{
{
if (!self)
{
return;
}
if (skill->value == 3)
{
gladbGun(self);
@ -283,12 +283,12 @@ gladb_attack(edict_t *self)
{
float range;
vec3_t v;
if (!self)
{
return;
}
/* a small safe zone */
VectorSubtract(self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v);
@ -340,12 +340,12 @@ mmove_t gladb_move_pain_air = {
void
gladb_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -385,12 +385,12 @@ gladb_pain(edict_t *self, edict_t *other /* unused */,
void
gladb_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -437,12 +437,12 @@ gladb_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point)
{
int n;
if (!self)
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{

View file

@ -21,45 +21,45 @@ static int sound_sight;
void
gladiator_idle(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
void
gladiator_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
gladiator_search(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
void
gladiator_cleaver_swing(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_cleaver_swing, 1, ATTN_NORM, 0);
}
@ -82,12 +82,12 @@ mmove_t gladiator_move_stand = {
void
gladiator_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gladiator_move_stand;
}
@ -119,12 +119,12 @@ mmove_t gladiator_move_walk = {
void
gladiator_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gladiator_move_walk;
}
@ -146,12 +146,12 @@ mmove_t gladiator_move_run = {
void
gladiator_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &gladiator_move_stand;
@ -166,12 +166,12 @@ void
GaldiatorMelee(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->mins[0], -4);
if (fire_hit(self, aim, (20 + (rand() % 5)), 300))
@ -213,12 +213,12 @@ mmove_t gladiator_move_attack_melee = {
void
gladiator_melee(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gladiator_move_attack_melee;
}
@ -228,12 +228,12 @@ GladiatorGun(edict_t *self)
vec3_t start;
vec3_t dir;
vec3_t forward, right;
if (!self)
{
return;
}
AngleVectors(self->s.angles, forward, right, NULL);
G_ProjectSource(self->s.origin, monster_flash_offset[MZ2_GLADIATOR_RAILGUN_1],
forward, right, start);
@ -269,12 +269,12 @@ gladiator_attack(edict_t *self)
{
float range;
vec3_t v;
if (!self)
{
return;
}
/* a small safe zone */
VectorSubtract(self->s.origin, self->enemy->s.origin, v);
range = VectorLength(v);
@ -327,12 +327,12 @@ mmove_t gladiator_move_pain_air = {
void
gladiator_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -377,12 +377,12 @@ gladiator_pain(edict_t *self, edict_t *other /* unused */,
void
gladiator_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -429,12 +429,12 @@ gladiator_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point)
{
int n;
if (!self)
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{
@ -477,12 +477,12 @@ gladiator_die(edict_t *self, edict_t *inflictor /* unused */,
*/
void
SP_monster_gladiator(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -15,44 +15,44 @@ static int sound_idle;
static int sound_open;
static int sound_search;
static int sound_sight;
qboolean visible(edict_t *self, edict_t *other);
void GunnerGrenade(edict_t *self);
void GunnerFire(edict_t *self);
void gunner_fire_chain(edict_t *self);
void gunner_refire_chain(edict_t *self);
void gunner_stand(edict_t *self);
void
gunner_idlesound(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
void
gunner_sight(edict_t *self, edict_t *other)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
gunner_search(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
@ -121,12 +121,12 @@ mmove_t gunner_move_fidget = {
void
gunner_fidget(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
return;
@ -182,12 +182,12 @@ mmove_t gunner_move_stand = {
void
gunner_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gunner_move_stand;
}
@ -216,12 +216,12 @@ mmove_t gunner_move_walk = {
void
gunner_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gunner_move_walk;
}
@ -245,12 +245,12 @@ mmove_t gunner_move_run = {
void
gunner_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &gunner_move_stand;
@ -279,12 +279,12 @@ mmove_t gunner_move_runandshoot = {
void
gunner_runandshoot(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gunner_move_runandshoot;
}
@ -352,12 +352,12 @@ mmove_t gunner_move_pain1 = {
void
gunner_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -400,12 +400,12 @@ gunner_pain(edict_t *self, edict_t *other /* unused */,
void
gunner_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -441,12 +441,12 @@ gunner_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point)
{
int n;
if (!self)
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{
@ -481,12 +481,12 @@ gunner_die(edict_t *self, edict_t *inflictor /* unused */,
void
gunner_duck_down(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_DUCKED)
{
return;
@ -510,12 +510,12 @@ gunner_duck_down(edict_t *self)
void
gunner_duck_hold(edict_t *self)
{
{
if (!self)
{
return;
}
if (level.time >= self->monsterinfo.pausetime)
{
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
@ -528,12 +528,12 @@ gunner_duck_hold(edict_t *self)
void
gunner_duck_up(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
@ -552,8 +552,8 @@ mframe_t gunner_frames_duck[] = {
};
mmove_t gunner_move_duck = {
FRAME_duck01,
FRAME_duck08,
FRAME_duck01,
FRAME_duck08,
gunner_frames_duck,
gunner_run
};
@ -581,12 +581,12 @@ gunner_dodge(edict_t *self, edict_t *attacker, float eta /* unsued */)
void
gunner_opengun(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_open, 1, ATTN_IDLE, 0);
}
@ -598,12 +598,12 @@ GunnerFire(edict_t *self)
vec3_t target;
vec3_t aim;
int flash_number;
if (!self)
{
return;
}
flash_number = MZ2_GUNNER_MACHINEGUN_1 + (self->s.frame - FRAME_attak216);
AngleVectors(self->s.angles, forward, right, NULL);
@ -628,12 +628,12 @@ GunnerGrenade(edict_t *self)
vec3_t forward, right;
vec3_t aim;
int flash_number;
if (!self)
{
return;
}
if (self->s.frame == FRAME_attak105)
{
flash_number = MZ2_GUNNER_GRENADE_1;
@ -743,12 +743,12 @@ mmove_t gunner_move_attack_grenade = {
void
gunner_attack(edict_t *self)
{
{
if (!self)
{
return;
}
if (range(self, self->enemy) == RANGE_MELEE)
{
self->monsterinfo.currentmove = &gunner_move_attack_chain;
@ -768,23 +768,23 @@ gunner_attack(edict_t *self)
void
gunner_fire_chain(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &gunner_move_fire_chain;
}
void
gunner_refire_chain(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->enemy->health > 0)
{
if (visible(self, self->enemy))
@ -805,12 +805,12 @@ gunner_refire_chain(edict_t *self)
*/
void
SP_monster_gunner(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -16,7 +16,7 @@ static int sound_death2;
static int sound_sight;
static int sound_search1;
static int sound_search2;
void hover_run(edict_t *self);
void hover_stand(edict_t *self);
void hover_dead(edict_t *self);
@ -25,26 +25,26 @@ void hover_reattack(edict_t *self);
void hover_fire_blaster(edict_t *self);
void hover_die(edict_t *self, edict_t *inflictor, edict_t *attacker,
int damage, vec3_t point);
void
hover_sight(edict_t *self, edict_t *other)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
hover_search(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() < 0.5)
{
gi.sound(self, CHAN_VOICE, sound_search1, 1, ATTN_NORM, 0);
@ -486,18 +486,18 @@ mframe_t hover_frames_end_attack[] = {
mmove_t hover_move_end_attack = {
FRAME_attak107,
FRAME_attak108,
hover_frames_end_attack,
hover_frames_end_attack,
hover_run
};
void
hover_reattack(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->enemy->health > 0)
{
if (visible(self, self->enemy))
@ -521,12 +521,12 @@ hover_fire_blaster(edict_t *self)
vec3_t end;
vec3_t dir;
int effect;
if (!self)
{
return;
}
if (self->s.frame == FRAME_attak104)
{
effect = EF_HYPERBLASTER;
@ -549,23 +549,23 @@ hover_fire_blaster(edict_t *self)
void
hover_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &hover_move_stand;
}
void
hover_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &hover_move_stand;
@ -578,46 +578,46 @@ hover_run(edict_t *self)
void
hover_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &hover_move_walk;
}
void
hover_start_attack(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &hover_move_start_attack;
}
void
hover_attack(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &hover_move_attack1;
}
void
hover_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -657,12 +657,12 @@ hover_pain(edict_t *self, edict_t *other /* unused */,
void
hover_deadthink(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->groundentity && (level.time < self->timestamp))
{
self->nextthink = level.time + FRAMETIME;
@ -674,12 +674,12 @@ hover_deadthink(edict_t *self)
void
hover_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -695,12 +695,12 @@ hover_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{
@ -746,12 +746,12 @@ hover_die(edict_t *self, edict_t *inflictor /* unused */,
*/
void
SP_monster_hover(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -57,12 +57,12 @@ mmove_t infantry_move_stand = {
void
infantry_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &infantry_move_stand;
}
@ -127,12 +127,12 @@ mmove_t infantry_move_fidget = {
void
infantry_fidget(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &infantry_move_fidget;
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
@ -161,12 +161,12 @@ mmove_t infantry_move_walk = {
void
infantry_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &infantry_move_walk;
}
@ -190,12 +190,12 @@ mmove_t infantry_move_run = {
void
infantry_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &infantry_move_stand;
@ -251,12 +251,12 @@ infantry_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
int n;
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -310,12 +310,12 @@ InfantryMachineGun(edict_t *self)
vec3_t forward, right;
vec3_t vec;
int flash_number;
if (!self)
{
return;
}
if (self->s.frame == FRAME_attak103)
{
flash_number = MZ2_INFANTRY_MACHINEGUN_1;
@ -353,23 +353,23 @@ InfantryMachineGun(edict_t *self)
void
infantry_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_sight, 1, ATTN_NORM, 0);
}
void
infantry_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -470,12 +470,12 @@ infantry_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{
@ -526,12 +526,12 @@ infantry_die(edict_t *self, edict_t *inflictor /* unused */,
void
infantry_duck_down(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_DUCKED)
{
return;
@ -546,12 +546,12 @@ infantry_duck_down(edict_t *self)
void
infantry_duck_hold(edict_t *self)
{
{
if (!self)
{
return;
}
if (level.time >= self->monsterinfo.pausetime)
{
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
@ -564,12 +564,12 @@ infantry_duck_hold(edict_t *self)
void
infantry_duck_up(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
@ -616,35 +616,35 @@ void
infantry_set_firetime(edict_t *self)
{
int n;
if (!self)
{
return;
}
n = (rand() & 15) + 5;
self->monsterinfo.pausetime = level.time + n * FRAMETIME;
}
void
infantry_cock_gun(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_weapon_cock, 1, ATTN_NORM, 0);
}
void
infantry_fire(edict_t *self)
{
{
if (!self)
{
return;
}
InfantryMachineGun(self);
if (level.time >= self->monsterinfo.pausetime)
@ -684,12 +684,12 @@ mmove_t infantry_move_attack1 = {
void
infantry_swing(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_punch_swing, 1, ATTN_NORM, 0);
}
@ -697,12 +697,12 @@ void
infantry_smack(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, 0, 0);
if (fire_hit(self, aim, (5 + (rand() % 5)), 50))
@ -731,12 +731,12 @@ mmove_t infantry_move_attack2 = {
void
infantry_attack(edict_t *self)
{
{
if (!self)
{
return;
}
if (range(self, self->enemy) == RANGE_MELEE)
{
self->monsterinfo.currentmove = &infantry_move_attack2;
@ -752,12 +752,12 @@ infantry_attack(edict_t *self)
*/
void
SP_monster_infantry(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -12,7 +12,7 @@ static int sound_fist;
static int sound_shake;
static int sound_moan;
static int sound_scream[8];
void insane_stand(edict_t *self);
void insane_dead(edict_t *self);
void insane_cross(edict_t *self);
@ -21,37 +21,37 @@ void insane_run(edict_t *self);
void insane_checkdown(edict_t *self);
void insane_checkup(edict_t *self);
void insane_onground(edict_t *self);
void
insane_fist(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_fist, 1, ATTN_IDLE, 0);
}
void
insane_shake(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_shake, 1, ATTN_IDLE, 0);
}
void
insane_moan(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_moan, 1, ATTN_IDLE, 0);
}
@ -345,7 +345,7 @@ mframe_t insane_frames_walk_insane[] = {
};
mmove_t insane_move_walk_insane = {
FRAME_walk1,
FRAME_walk1,
FRAME_walk26,
insane_frames_walk_insane,
insane_walk
@ -520,12 +520,12 @@ mmove_t insane_move_struggle_cross = {
void
insane_cross(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() < 0.8)
{
self->monsterinfo.currentmove = &insane_move_cross;
@ -538,12 +538,12 @@ insane_cross(edict_t *self)
void
insane_walk(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->spawnflags & 16) /* Hold Ground? */
{
if (self->s.frame == FRAME_cr_pain10)
@ -570,12 +570,12 @@ insane_walk(edict_t *self)
void
insane_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->spawnflags & 16) /* Hold Ground? */
{
if (self->s.frame == FRAME_cr_pain10)
@ -605,12 +605,12 @@ insane_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
int l, r;
if (!self)
{
return;
}
if (level.time < self->pain_debounce_time)
{
return;
@ -666,23 +666,23 @@ insane_pain(edict_t *self, edict_t *other /* unused */,
void
insane_onground(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &insane_move_down;
}
void
insane_checkdown(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->spawnflags & 32) /* Always stand */
{
return;
@ -703,12 +703,12 @@ insane_checkdown(edict_t *self)
void
insane_checkup(edict_t *self)
{
{
if (!self)
{
return;
}
if ((self->spawnflags & 4) && (self->spawnflags & 16))
{
return;
@ -722,17 +722,17 @@ insane_checkup(edict_t *self)
void
insane_stand(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->spawnflags & 8) /* If crucified */
{
self->monsterinfo.currentmove = &insane_move_cross;
self->monsterinfo.aiflags |= AI_STAND_GROUND;
}
}
else if ((self->spawnflags & 4) && (self->spawnflags & 16))
{
self->monsterinfo.currentmove = &insane_move_down;
@ -750,12 +750,12 @@ insane_stand(edict_t *self)
void
insane_dead(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->spawnflags & 8)
{
self->flags |= FL_FLY;
@ -778,12 +778,12 @@ insane_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
if (self->health <= self->gib_health)
{
gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"), 1, ATTN_IDLE, 0);
@ -839,12 +839,12 @@ insane_die(edict_t *self, edict_t *inflictor /* unused */,
*/
void
SP_misc_insane(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -3,7 +3,7 @@
* Medic.
*
* =======================================================================
*/
*/
#include "../../header/local.h"
#include "medic.h"
@ -27,12 +27,12 @@ medic_FindDeadMonster(edict_t *self)
{
edict_t *ent = NULL;
edict_t *best = NULL;
if (!self)
{
return NULL;
}
while ((ent = findradius(ent, self->s.origin, 1024)) != NULL)
{
if (ent == self)
@ -91,12 +91,12 @@ void
medic_idle(edict_t *self)
{
edict_t *ent;
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_idle1, 1, ATTN_IDLE, 0);
ent = medic_FindDeadMonster(self);
@ -114,12 +114,12 @@ void
medic_search(edict_t *self)
{
edict_t *ent;
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_IDLE, 0);
if (!self->oldenemy)
@ -139,12 +139,12 @@ medic_search(edict_t *self)
void
medic_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
@ -250,12 +250,12 @@ mmove_t medic_move_stand = {
void
medic_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &medic_move_stand;
}
@ -283,12 +283,12 @@ mmove_t medic_move_walk = {
void
medic_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &medic_move_walk;
}
@ -310,12 +310,12 @@ mmove_t medic_move_run = {
void
medic_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (!(self->monsterinfo.aiflags & AI_MEDIC))
{
edict_t *ent;
@ -389,12 +389,12 @@ mmove_t medic_move_pain2 = {
void
medic_pain(edict_t *self, edict_t *other /* unused */,
float kick, int damage /* unused */)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -432,12 +432,12 @@ medic_fire_blaster(edict_t *self)
vec3_t end;
vec3_t dir;
int effect;
if (!self)
{
return;
}
if ((self->s.frame == FRAME_attack9) || (self->s.frame == FRAME_attack12))
{
effect = EF_BLASTER;
@ -467,12 +467,12 @@ medic_fire_blaster(edict_t *self)
void
medic_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -527,12 +527,12 @@ medic_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
/* if we had a pending patient, free him up for another medic */
if ((self->enemy) && (self->enemy->owner == self))
{
@ -574,12 +574,12 @@ medic_die(edict_t *self, edict_t *inflictor /* unused */,
void
medic_duck_down(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_DUCKED)
{
return;
@ -594,12 +594,12 @@ medic_duck_down(edict_t *self)
void
medic_duck_hold(edict_t *self)
{
{
if (!self)
{
return;
}
if (level.time >= self->monsterinfo.pausetime)
{
self->monsterinfo.aiflags &= ~AI_HOLD_FRAME;
@ -612,12 +612,12 @@ medic_duck_hold(edict_t *self)
void
medic_duck_up(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.aiflags &= ~AI_DUCKED;
self->maxs[2] += 32;
self->takedamage = DAMAGE_AIM;
@ -652,12 +652,12 @@ mmove_t medic_move_duck = {
void
medic_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
{
{
if (!self || !attacker)
{
return;
}
if (random() > 0.25)
{
return;
@ -699,12 +699,12 @@ mmove_t medic_move_attackHyperBlaster = {
void
medic_continue(edict_t *self)
{
{
if (!self)
{
return;
}
if (visible(self, self->enemy))
{
if (random() <= 0.95)
@ -740,12 +740,12 @@ mmove_t medic_move_attackBlaster = {
void
medic_hook_launch(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_hook_launch, 1, ATTN_NORM, 0);
}
@ -769,12 +769,12 @@ medic_cable_attack(edict_t *self)
trace_t tr;
vec3_t dir, angles;
float distance;
if (!self)
{
return;
}
if (!self->enemy->inuse)
{
return;
@ -869,12 +869,12 @@ medic_cable_attack(edict_t *self)
void
medic_hook_retract(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_hook_retract, 1, ATTN_NORM, 0);
self->enemy->monsterinfo.aiflags &= ~AI_RESURRECTING;
}
@ -919,12 +919,12 @@ mmove_t medic_move_attackCable = {
void
medic_attack(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_MEDIC)
{
self->monsterinfo.currentmove = &medic_move_attackCable;
@ -937,12 +937,12 @@ medic_attack(edict_t *self)
qboolean
medic_checkattack(edict_t *self)
{
{
if (!self)
{
return false;
}
if (self->monsterinfo.aiflags & AI_MEDIC)
{
medic_attack(self);
@ -957,12 +957,12 @@ medic_checkattack(edict_t *self)
*/
void
SP_monster_medic(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -13,7 +13,7 @@
int c_yes, c_no;
/*
* Returns false if any part of the bottom
* Returns false if any part of the bottom
* of the entity is off an edge that is not
* a staircase.
*/
@ -24,12 +24,12 @@ M_CheckBottom(edict_t *ent)
trace_t trace;
int x, y;
float mid, bottom;
if (!ent)
{
return false;
}
VectorAdd(ent->s.origin, ent->mins, mins);
VectorAdd(ent->s.origin, ent->maxs, maxs);
@ -109,7 +109,7 @@ realcheck:
* possible, no move is done, false is
* returned, and pr_global_struct->trace_normal
* is set to the normal of the blocking wall
*/
*/
qboolean
SV_movestep(edict_t *ent, vec3_t move, qboolean relink)
{
@ -120,12 +120,12 @@ SV_movestep(edict_t *ent, vec3_t move, qboolean relink)
float stepsize;
vec3_t test;
int contents;
if (!ent)
{
return false;
}
/* try the move */
VectorCopy(ent->s.origin, oldorg);
VectorAdd(ent->s.origin, move, neworg);
@ -354,7 +354,7 @@ SV_movestep(edict_t *ent, vec3_t move, qboolean relink)
if (!M_CheckBottom(ent))
{
if (ent->flags & FL_PARTIALGROUND)
{
{
/* entity had floor mostly pulled out
from underneath it and is trying to
correct */
@ -399,12 +399,12 @@ M_ChangeYaw(edict_t *ent)
float current;
float move;
float speed;
if (!ent)
{
return;
}
current = anglemod(ent->s.angles[YAW]);
ideal = ent->ideal_yaw;
@ -458,12 +458,12 @@ SV_StepDirection(edict_t *ent, float yaw, float dist)
{
vec3_t move, oldorigin;
float delta;
if (!ent)
{
return false;
}
ent->ideal_yaw = yaw;
M_ChangeYaw(ent);
@ -479,7 +479,7 @@ SV_StepDirection(edict_t *ent, float yaw, float dist)
delta = ent->s.angles[YAW] - ent->ideal_yaw;
if ((delta > 45) && (delta < 315))
{
{
/* not turned far enough, so don't take the step */
VectorCopy(oldorigin, ent->s.origin);
}
@ -496,12 +496,12 @@ SV_StepDirection(edict_t *ent, float yaw, float dist)
void
SV_FixCheckBottom(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->flags |= FL_PARTIALGROUND;
}
@ -643,7 +643,7 @@ SV_CloseEnough(edict_t *ent, edict_t *goal, float dist)
if (!ent || !goal)
{
return false;
}
}
for (i = 0; i < 3; i++)
{
@ -665,7 +665,7 @@ void
M_MoveToGoal(edict_t *ent, float dist)
{
edict_t *goal;
if (!ent)
{
return;
@ -698,12 +698,12 @@ qboolean
M_walkmove(edict_t *ent, float yaw, float dist)
{
vec3_t move;
if (!ent)
{
return false;
}
if (!ent->groundentity && !(ent->flags & (FL_FLY | FL_SWIM)))
{
return false;

View file

@ -28,12 +28,12 @@ void
mutant_step(edict_t *self)
{
int n;
if (!self)
{
return;
}
n = (rand() + 1) % 3;
if (n == 0)
@ -52,34 +52,34 @@ mutant_step(edict_t *self)
void
mutant_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
mutant_search(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
}
void
mutant_swing(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_swing, 1, ATTN_NORM, 0);
}
@ -151,23 +151,23 @@ mmove_t mutant_move_stand = {
void
mutant_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &mutant_move_stand;
}
void
mutant_idle_loop(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() < 0.75)
{
self->monsterinfo.nextframe = FRAME_stand155;
@ -199,12 +199,12 @@ mmove_t mutant_move_idle = {
void
mutant_idle(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &mutant_move_idle;
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
@ -233,12 +233,12 @@ mmove_t mutant_move_walk = {
void
mutant_walk_loop(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &mutant_move_walk;
}
@ -258,12 +258,12 @@ mmove_t mutant_move_start_walk = {
void
mutant_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &mutant_move_start_walk;
}
@ -285,12 +285,12 @@ mmove_t mutant_move_run = {
void
mutant_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &mutant_move_stand;
@ -305,12 +305,12 @@ void
mutant_hit_left(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->mins[0], 8);
if (fire_hit(self, aim, (10 + (rand() % 5)), 100))
@ -327,12 +327,12 @@ void
mutant_hit_right(edict_t *self)
{
vec3_t aim;
if (!self)
{
return;
}
VectorSet(aim, MELEE_DISTANCE, self->maxs[0], 8);
if (fire_hit(self, aim, (10 + (rand() % 5)), 100))
@ -347,12 +347,12 @@ mutant_hit_right(edict_t *self)
void
mutant_check_refire(edict_t *self)
{
{
if (!self)
{
return;
}
if (!self->enemy || !self->enemy->inuse || (self->enemy->health <= 0))
{
return;
@ -383,23 +383,23 @@ mmove_t mutant_move_attack = {
void
mutant_melee(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &mutant_move_attack;
}
void
mutant_jump_touch(edict_t *self, edict_t *other,
cplane_t *plane /* unused */, csurface_t *surf /* unused */)
{
{
if (!self)
{
return;
}
if (self->health <= 0)
{
self->touch = NULL;
@ -441,12 +441,12 @@ void
mutant_jump_takeoff(edict_t *self)
{
vec3_t forward;
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
AngleVectors(self->s.angles, forward, NULL, NULL);
self->s.origin[2] += 1;
@ -460,12 +460,12 @@ mutant_jump_takeoff(edict_t *self)
void
mutant_check_landing(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->groundentity)
{
gi.sound(self, CHAN_WEAPON, sound_thud, 1, ATTN_NORM, 0);
@ -504,23 +504,23 @@ mmove_t mutant_move_jump = {
void
mutant_jump(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &mutant_move_jump;
}
qboolean
mutant_check_melee(edict_t *self)
{
{
if (!self)
{
return false;
}
if (range(self, self->enemy) == RANGE_MELEE)
{
return true;
@ -534,12 +534,12 @@ mutant_check_jump(edict_t *self)
{
vec3_t v;
float distance;
if (!self)
{
return false;
}
if (self->absmin[2] > (self->enemy->absmin[2] + 0.75 * self->enemy->size[2]))
{
return false;
@ -573,12 +573,12 @@ mutant_check_jump(edict_t *self)
qboolean
mutant_checkattack(edict_t *self)
{
{
if (!self)
{
return false;
}
if (!self->enemy || (self->enemy->health <= 0))
{
return false;
@ -656,12 +656,12 @@ mutant_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage /* unused */)
{
float r;
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -700,12 +700,12 @@ mutant_pain(edict_t *self, edict_t *other /* unused */,
void
mutant_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -760,12 +760,12 @@ mutant_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
if (self->health <= self->gib_health)
{
gi.sound(self, CHAN_VOICE, gi.soundindex("misc/udeath.wav"), 1, ATTN_NORM, 0);
@ -810,12 +810,12 @@ mutant_die(edict_t *self, edict_t *inflictor /* unused */,
*/
void
SP_monster_mutant(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -31,67 +31,67 @@ void parasite_refidget(edict_t *self);
void
parasite_launch(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_launch, 1, ATTN_NORM, 0);
}
void
parasite_reel_in(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_reelin, 1, ATTN_NORM, 0);
}
void
parasite_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_sight, 1, ATTN_NORM, 0);
}
void
parasite_tap(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_tap, 1, ATTN_IDLE, 0);
}
void
parasite_scratch(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_scratch, 1, ATTN_IDLE, 0);
}
void
parasite_search(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_search, 1, ATTN_IDLE, 0);
}
@ -145,34 +145,34 @@ mmove_t parasite_move_end_fidget = {
void
parasite_end_fidget(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &parasite_move_end_fidget;
}
void
parasite_do_fidget(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &parasite_move_fidget;
}
void
parasite_refidget(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() <= 0.8)
{
self->monsterinfo.currentmove = &parasite_move_fidget;
@ -185,12 +185,12 @@ parasite_refidget(edict_t *self)
void
parasite_idle(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &parasite_move_start_fidget;
}
@ -223,12 +223,12 @@ mmove_t parasite_move_stand = {
void
parasite_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &parasite_move_stand;
}
@ -279,12 +279,12 @@ mmove_t parasite_move_stop_run = {
void
parasite_start_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &parasite_move_stand;
@ -297,12 +297,12 @@ parasite_start_run(edict_t *self)
void
parasite_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &parasite_move_stand;
@ -360,23 +360,23 @@ mmove_t parasite_move_stop_walk = {
void
parasite_start_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &parasite_move_start_walk;
}
void
parasite_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &parasite_move_walk;
}
@ -404,12 +404,12 @@ mmove_t parasite_move_pain1 = {
void
parasite_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage /* unused */)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -474,12 +474,12 @@ parasite_drain_attack(edict_t *self)
vec3_t offset, start, f, r, end, dir;
trace_t tr;
int damage;
if (!self)
{
return;
}
AngleVectors(self->s.angles, f, r, NULL);
VectorSet(offset, 24, 0, 6);
G_ProjectSource(self->s.origin, offset, f, r, start);
@ -610,23 +610,23 @@ mmove_t parasite_move_break = {
void
parasite_attack(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &parasite_move_drain;
}
void
parasite_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -24);
VectorSet(self->maxs, 16, 16, -8);
self->movetype = MOVETYPE_TOSS;
@ -658,12 +658,12 @@ parasite_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{
@ -701,12 +701,12 @@ parasite_die(edict_t *self, edict_t *inflictor /* unused */,
*/
void
SP_monster_parasite(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

File diff suppressed because it is too large Load diff

View file

@ -23,26 +23,26 @@ void supertank_dead(edict_t *self);
void supertankRocket(edict_t *self);
void supertankMachineGun(edict_t *self);
void supertank_reattack1(edict_t *self);
void
TreadSound(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, tread_sound, 1, ATTN_NORM, 0);
}
void
supertank_search(edict_t *self)
{
{
if (!self)
{
return;
}
if (random() < 0.5)
{
gi.sound(self, CHAN_VOICE, sound_search1, 1, ATTN_NORM, 0);
@ -125,12 +125,12 @@ mmove_t supertank_move_stand = {
void
supertank_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &supertank_move_stand;
}
@ -192,34 +192,34 @@ mmove_t supertank_move_forward = {
void
supertank_forward(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &supertank_move_forward;
}
void
supertank_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &supertank_move_forward;
}
void
supertank_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
self->monsterinfo.currentmove = &supertank_move_stand;
@ -522,12 +522,12 @@ mmove_t supertank_move_end_attack1 = {
void
supertank_reattack1(edict_t *self)
{
{
if (!self)
{
return;
}
if (visible(self, self->enemy))
{
if (random() < 0.9)
@ -548,12 +548,12 @@ supertank_reattack1(edict_t *self)
void
supertank_pain(edict_t *self, edict_t *other /* unused */,
float kick /* unused */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum = 1;
@ -615,12 +615,12 @@ supertankRocket(edict_t *self)
vec3_t dir;
vec3_t vec;
int flash_number;
if (!self)
{
return;
}
if (self->s.frame == FRAME_attak2_8)
{
flash_number = MZ2_SUPERTANK_ROCKET_1;
@ -654,12 +654,12 @@ supertankMachineGun(edict_t *self)
vec3_t start;
vec3_t forward, right;
int flash_number;
if (!self)
{
return;
}
flash_number = MZ2_SUPERTANK_MACHINEGUN_1 + (self->s.frame - FRAME_attak1_1);
dir[0] = 0;
@ -688,12 +688,12 @@ supertank_attack(edict_t *self)
{
vec3_t vec;
float range;
if (!self)
{
return;
}
VectorSubtract(self->enemy->s.origin, self->s.origin, vec);
range = VectorLength(vec);
@ -702,7 +702,7 @@ supertank_attack(edict_t *self)
self->monsterinfo.currentmove = &supertank_move_attack1;
}
else
{
{
/* fire rockets more often at distance */
if (random() < 0.3)
{
@ -717,12 +717,12 @@ supertank_attack(edict_t *self)
void
supertank_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -60, -60, 0);
VectorSet(self->maxs, 60, 60, 72);
self->movetype = MOVETYPE_TOSS;
@ -736,12 +736,12 @@ BossExplode(edict_t *self)
{
vec3_t org;
int n;
if (!self)
{
return;
}
self->think = BossExplode;
VectorCopy(self->s.origin, org);
org[2] += 24 + (rand() & 15);
@ -816,7 +816,7 @@ supertank_die(edict_t *self, edict_t *inflictor /* unused */,
{
return;
}
gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
self->deadflag = DEAD_DEAD;
self->takedamage = DAMAGE_NO;
@ -829,12 +829,12 @@ supertank_die(edict_t *self, edict_t *inflictor /* unused */,
*/
void
SP_monster_supertank(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -25,56 +25,56 @@ static int sound_strike;
void
tank_sight(edict_t *self, edict_t *other /* unused */)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
}
void
tank_footstep(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_step, 1, ATTN_NORM, 0);
}
void
tank_thud(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_BODY, sound_thud, 1, ATTN_NORM, 0);
}
void
tank_windup(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_windup, 1, ATTN_NORM, 0);
}
void
tank_idle(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
}
@ -120,12 +120,12 @@ mmove_t tank_move_stand = {
void
tank_stand(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &tank_move_stand;
}
@ -186,12 +186,12 @@ mmove_t tank_move_stop_walk = {
void
tank_walk(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &tank_move_walk;
}
@ -252,12 +252,12 @@ mmove_t tank_move_stop_run = {
void
tank_run(edict_t *self)
{
{
if (!self)
{
return;
}
if (self->enemy && self->enemy->client)
{
self->monsterinfo.aiflags |= AI_BRUTAL;
@ -342,12 +342,12 @@ mmove_t tank_move_pain3 = {
void
tank_pain(edict_t *self, edict_t *other /* other */,
float kick /* other */, int damage)
{
{
if (!self)
{
return;
}
if (self->health < (self->max_health / 2))
{
self->s.skinnum |= 1;
@ -417,12 +417,12 @@ TankBlaster(edict_t *self)
vec3_t end;
vec3_t dir;
int flash_number;
if (!self)
{
return;
}
if (self->s.frame == FRAME_attak110)
{
flash_number = MZ2_TANK_BLASTER_1;
@ -449,12 +449,12 @@ TankBlaster(edict_t *self)
void
TankStrike(edict_t *self)
{
{
if (!self)
{
return;
}
gi.sound(self, CHAN_WEAPON, sound_strike, 1, ATTN_NORM, 0);
}
@ -466,12 +466,12 @@ TankRocket(edict_t *self)
vec3_t dir;
vec3_t vec;
int flash_number;
if (!self)
{
return;
}
if (self->s.frame == FRAME_attak324)
{
flash_number = MZ2_TANK_ROCKET_1;
@ -505,12 +505,12 @@ TankMachineGun(edict_t *self)
vec3_t start;
vec3_t forward, right;
int flash_number;
if (!self)
{
return;
}
flash_number = MZ2_TANK_MACHINEGUN_1 + (self->s.frame - FRAME_attak406);
AngleVectors(self->s.angles, forward, right, NULL);
@ -607,12 +607,12 @@ mmove_t tank_move_attack_post_blast = {
void
tank_reattack_blaster(edict_t *self)
{
{
if (!self)
{
return;
}
if (skill->value >= 2)
{
if (visible(self, self->enemy))
@ -814,12 +814,12 @@ mmove_t tank_move_attack_chain = {
void
tank_refire_rocket(edict_t *self)
{
{
if (!self)
{
return;
}
/* Only on hard or nightmare */
if (skill->value >= 2)
{
@ -841,12 +841,12 @@ tank_refire_rocket(edict_t *self)
void
tank_doattack_rocket(edict_t *self)
{
{
if (!self)
{
return;
}
self->monsterinfo.currentmove = &tank_move_attack_fire_rocket;
}
@ -856,12 +856,12 @@ tank_attack(edict_t *self)
vec3_t vec;
float range;
float r;
if (!self)
{
return;
}
if (self->enemy->health < 0)
{
self->monsterinfo.currentmove = &tank_move_attack_strike;
@ -916,12 +916,12 @@ tank_attack(edict_t *self)
void
tank_dead(edict_t *self)
{
{
if (!self)
{
return;
}
VectorSet(self->mins, -16, -16, -16);
VectorSet(self->maxs, 16, 16, -0);
self->movetype = MOVETYPE_TOSS;
@ -983,7 +983,7 @@ tank_die(edict_t *self, edict_t *inflictor /* unused */,
{
return;
}
/* check for gib */
if (self->health <= self->gib_health)
{
@ -1024,12 +1024,12 @@ tank_die(edict_t *self, edict_t *inflictor /* unused */,
*/
void
SP_monster_tank(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value)
{
G_FreeEdict(self);

View file

@ -36,12 +36,12 @@ SP_CreateUnnamedSpawn(edict_t *self)
*/
void
SP_info_player_start(edict_t *self)
{
{
if (!self)
{
return;
}
if (!coop->value)
{
return;
@ -54,12 +54,12 @@ SP_info_player_start(edict_t *self)
*/
void
SP_info_player_deathmatch(edict_t *self)
{
{
if (!self)
{
return;
}
if (!deathmatch->value)
{
G_FreeEdict(self);
@ -75,12 +75,12 @@ SP_info_player_deathmatch(edict_t *self)
*/
void
SP_info_player_coop(edict_t *self)
{
{
if (!self)
{
return;
}
if (!coop->value)
{
G_FreeEdict(self);
@ -106,7 +106,7 @@ SP_info_player_intermission(void)
/* ======================================================================= */
void
player_pain(edict_t *self /* unsued */, edict_t *other /* unused */,
player_pain(edict_t *self /* unsued */, edict_t *other /* unused */,
float kick /* unused */, int damage /* unused */)
{
/* Player pain is handled at the end
@ -120,12 +120,12 @@ qboolean
IsFemale(edict_t *ent)
{
char *info;
if (!ent)
{
return false;
}
if (!ent->client)
{
return false;
@ -145,12 +145,12 @@ qboolean
IsNeutral(edict_t *ent)
{
char *info;
if (!ent)
{
return false;
}
if (!ent->client)
{
return false;
@ -158,7 +158,7 @@ IsNeutral(edict_t *ent)
info = Info_ValueForKey(ent->client->pers.userinfo, "gender");
if ((info[0] != 'f') && (info[0] != 'F') &&
if ((info[0] != 'f') && (info[0] != 'F') &&
(info[0] != 'm') && (info[0] != 'M'))
{
return true;
@ -443,12 +443,12 @@ TossClientWeapon(edict_t *self)
qboolean quad;
qboolean quadfire;
float spread;
if (!self)
{
return;
}
if (!deathmatch->value)
{
return;
@ -645,7 +645,7 @@ player_die(edict_t *self, edict_t *inflictor, edict_t *attacker,
self->client->quadfire_framenum = 0;
if (self->health < -40)
{
{
/* gib */
gi.sound(self, CHAN_BODY, gi.soundindex("misc/udeath.wav"),
1, ATTN_NORM, 0);
@ -661,7 +661,7 @@ player_die(edict_t *self, edict_t *inflictor, edict_t *attacker,
self->takedamage = DAMAGE_NO;
}
else
{
{
/* normal death */
if (!self->deadflag)
{
@ -795,12 +795,12 @@ SaveClientData(void)
void
FetchClientEntData(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->health = ent->client->pers.health;
ent->max_health = ent->client->pers.max_health;
ent->flags |= ent->client->pers.savedFlags;
@ -860,7 +860,7 @@ PlayersRangeFromSpot(edict_t *spot)
}
/*
* go to a random point, but NOT the two
* go to a random point, but NOT the two
* points closest to other players
*/
edict_t *
@ -953,7 +953,7 @@ SelectFarthestDeathmatchSpawnPoint(void)
return bestspot;
}
/* if there is a player just spawned on each and every start spot
/* if there is a player just spawned on each and every start spot
we have no choice to turn one into a telefrag meltdown */
spot = G_Find(NULL, FOFS(classname), "info_player_deathmatch");
@ -979,12 +979,12 @@ SelectCoopSpawnPoint(edict_t *ent)
int index;
edict_t *spot = NULL;
char *target;
if (!ent)
{
return NULL;
}
index = ent->client - game.clients;
/* player 0 starts in normal player spawn point */
@ -1013,7 +1013,7 @@ SelectCoopSpawnPoint(edict_t *ent)
}
if (Q_stricmp(game.spawnpoint, target) == 0)
{
{
/* this is a coop spawn point for
one of the clients here */
index--;
@ -1035,12 +1035,12 @@ void
SelectSpawnPoint(edict_t *ent, vec3_t origin, vec3_t angles)
{
edict_t *spot = NULL;
if (!ent)
{
return;
}
if (deathmatch->value)
{
spot = SelectDeathmatchSpawnPoint();
@ -1074,7 +1074,7 @@ SelectSpawnPoint(edict_t *ent, vec3_t origin, vec3_t angles)
if (!spot)
{
if (!game.spawnpoint[0])
{
{
/* there wasn't a spawnpoint without a target, so use any */
spot = G_Find(spot, FOFS(classname), "info_player_start");
}
@ -1114,12 +1114,12 @@ body_die(edict_t *self, edict_t *inflictor /* unused */,
vec3_t point /* unused */)
{
int n;
if (!self)
{
return;
}
if (self->health < -40)
{
gi.sound(self, CHAN_BODY, gi.soundindex("misc/udeath.wav"),
@ -1141,12 +1141,12 @@ void
CopyToBodyQue(edict_t *ent)
{
edict_t *body;
if (!ent)
{
return;
}
/* grab a body que and cycle to the next one */
body = &g_edicts[(int)maxclients->value + level.body_que + 1];
level.body_que = (level.body_que + 1) % BODY_QUEUE_SIZE;
@ -1176,12 +1176,12 @@ CopyToBodyQue(edict_t *ent)
void
respawn(edict_t *self)
{
{
if (!self)
{
return;
}
if (deathmatch->value || coop->value)
{
/* spectator's don't leave bodies */
@ -1218,12 +1218,12 @@ void
spectator_respawn(edict_t *ent)
{
int i, numspec;
if (!ent)
{
return;
}
/* if the user wants to become a spectator,
make sure he doesn't exceed max_spectators */
if (ent->client->pers.spectator)
@ -1332,12 +1332,12 @@ PutClientInServer(edict_t *ent)
int i;
client_persistant_t saved;
client_respawn_t resp;
if (!ent)
{
return;
}
/* find a spawn point do it before setting
health back up, so farthest ranging
doesn't count this client */
@ -1491,7 +1491,7 @@ PutClientInServer(edict_t *ent)
}
if (!KillBox(ent))
{
{
/* could't spawn in? */
}
@ -1509,12 +1509,12 @@ PutClientInServer(edict_t *ent)
*/
void
ClientBeginDeathmatch(edict_t *ent)
{
{
if (!ent)
{
return;
}
G_InitEdict(ent);
InitClientResp(ent->client);
@ -1549,12 +1549,12 @@ void
ClientBegin(edict_t *ent)
{
int i;
if (!ent)
{
return;
}
ent->client = game.clients + (ent - g_edicts - 1);
if (deathmatch->value)
@ -1799,12 +1799,12 @@ void
ClientDisconnect(edict_t *ent)
{
int playernum;
if (!ent)
{
return;
}
if (!ent->client)
{
return;
@ -1833,7 +1833,7 @@ ClientDisconnect(edict_t *ent)
edict_t *pm_passent;
/* pmove doesn't need to know
/* pmove doesn't need to know
about passent and contentmask */
trace_t
PM_trace(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end)
@ -2126,12 +2126,12 @@ ClientBeginServerFrame(edict_t *ent)
{
gclient_t *client;
int buttonMask;
if (!ent)
{
return;
}
if (level.intermissiontime)
{
return;

View file

@ -9,12 +9,12 @@
void
MoveClientToIntermission(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (deathmatch->value || coop->value)
{
ent->client->showscores = true;
@ -137,7 +137,7 @@ BeginIntermission(edict_t *targ)
ent = G_Find(NULL, FOFS(classname), "info_player_intermission");
if (!ent)
{
{
/* the map creator forgot to put in an intermission point... */
ent = G_Find(NULL, FOFS(classname), "info_player_start");
@ -147,7 +147,7 @@ BeginIntermission(edict_t *targ)
}
}
else
{
{
/* chose one of four spots */
i = rand() & 3;
@ -305,12 +305,12 @@ DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer)
*/
void
DeathmatchScoreboard(edict_t *ent)
{
{
if (!ent)
{
return;
}
DeathmatchScoreboardMessage(ent, ent->enemy);
gi.unicast(ent, true);
}
@ -320,12 +320,12 @@ DeathmatchScoreboard(edict_t *ent)
*/
void
Cmd_Score_f(edict_t *ent)
{
{
if (!ent)
{
return;
}
ent->client->showinventory = false;
ent->client->showhelp = false;
@ -352,12 +352,12 @@ HelpComputer(edict_t *ent)
{
char string[1024];
char *sk;
if (!ent)
{
return;
}
if (skill->value == 0)
{
sk = "easy";
@ -402,12 +402,12 @@ HelpComputer(edict_t *ent)
*/
void
Cmd_Help_f(edict_t *ent)
{
{
if (!ent)
{
return;
}
/* this is for backwards compatability */
if (deathmatch->value)
{
@ -438,12 +438,12 @@ G_SetStats(edict_t *ent)
gitem_t *item;
int index, cells = 0;
int power_armor_type;
if (!ent)
{
return;
}
/* health */
ent->client->ps.stats[STAT_HEALTH_ICON] = level.pic_health;
ent->client->ps.stats[STAT_HEALTH] = ent->health;
@ -472,7 +472,7 @@ G_SetStats(edict_t *ent)
cells = ent->client->pers.inventory[ITEM_INDEX(FindItem("cells"))];
if (cells == 0)
{
{
/* ran out of cells for power armor */
ent->flags &= ~FL_POWER_ARMOR;
gi.sound(ent, CHAN_ITEM, gi.soundindex( "misc/power2.wav"),
@ -484,7 +484,7 @@ G_SetStats(edict_t *ent)
index = ArmorIndex(ent);
if (power_armor_type && (!index || (level.framenum & 8)))
{
{
/* flash between power armor and other armor icon */
ent->client->ps.stats[STAT_ARMOR_ICON] = gi.imageindex("i_powershield");
ent->client->ps.stats[STAT_ARMOR] = cells;
@ -626,12 +626,12 @@ G_CheckChaseStats(edict_t *ent)
{
int i;
gclient_t *cl;
if (!ent)
{
return;
}
for (i = 1; i <= maxclients->value; i++)
{
cl = g_edicts[i].client;
@ -648,12 +648,12 @@ G_CheckChaseStats(edict_t *ent)
void
G_SetSpectatorStats(edict_t *ent)
{
{
if (!ent)
{
return;
}
gclient_t *cl = ent->client;
if (!cl->chase_target)

View file

@ -82,12 +82,12 @@ PlayerTrail_PickFirst(edict_t *self)
{
int marker;
int n;
if (!self)
{
return NULL;
}
if (!trail_active)
{
return NULL;
@ -123,12 +123,12 @@ PlayerTrail_PickNext(edict_t *self)
{
int marker;
int n;
if (!self)
{
return NULL;
}
if (!trail_active)
{
return NULL;

View file

@ -392,12 +392,12 @@ SV_CalcGunOffset(edict_t *ent)
{
int i;
float delta;
if (!ent)
{
return;
}
/* gun angles from bobbing */
ent->client->ps.gunangles[ROLL] = xyspeed * bobfracsin * 0.005;
ent->client->ps.gunangles[YAW] = xyspeed * bobfracsin * 0.01;
@ -485,12 +485,12 @@ SV_CalcBlend(edict_t *ent)
int contents;
vec3_t vieworg;
int remaining;
if (!ent)
{
return;
}
ent->client->ps.blend[0] = ent->client->ps.blend[1] =
ent->client->ps.blend[2] = ent->client->ps.blend[3] = 0;
@ -636,12 +636,12 @@ P_FallingDamage(edict_t *ent)
float delta;
int damage;
vec3_t dir;
if (!ent)
{
return;
}
if (ent->s.modelindex != 255)
{
return; /* not in the player model */
@ -809,14 +809,14 @@ P_WorldEffects(void)
if ((old_waterlevel == 3) && (waterlevel != 3))
{
if (current_player->air_finished < level.time)
{
{
/* gasp for air */
gi.sound(current_player, CHAN_VOICE,
gi.soundindex("player/gasp1.wav"), 1, ATTN_NORM, 0);
PlayerNoise(current_player, current_player->s.origin, PNOISE_SELF);
}
else if (current_player->air_finished < level.time + 11)
{
{
/* just break surface */
gi.sound(current_player, CHAN_VOICE,
gi.soundindex("player/gasp2.wav"), 1, ATTN_NORM, 0);
@ -855,7 +855,7 @@ P_WorldEffects(void)
/* if out of air, start drowning */
if (current_player->air_finished < level.time)
{
{
/* drown! */
if ((current_player->client->next_drown_time < level.time) &&
(current_player->health > 0))
@ -939,7 +939,7 @@ P_WorldEffects(void)
if (current_player->watertype & CONTENTS_SLIME)
{
if (!envirosuit)
{
{
/* no damage from slime with envirosuit */
T_Damage(current_player, world, world, vec3_origin, current_player->s.origin,
vec3_origin, 1 * waterlevel, 0, 0, MOD_SLIME);
@ -953,12 +953,12 @@ G_SetClientEffects(edict_t *ent)
{
int pa_type;
int remaining;
if (!ent)
{
return;
}
ent->s.effects = 0;
ent->s.renderfx = 0;
@ -1022,12 +1022,12 @@ G_SetClientEffects(edict_t *ent)
void
G_SetClientEvent(edict_t *ent)
{
{
if (!ent)
{
return;
}
if (ent->s.event)
{
return;
@ -1046,12 +1046,12 @@ void
G_SetClientSound(edict_t *ent)
{
char *weap;
if (!ent)
{
return;
}
if (ent->client->pers.game_helpchanged != game.helpchanged)
{
ent->client->pers.game_helpchanged = game.helpchanged;
@ -1107,12 +1107,12 @@ G_SetClientFrame(edict_t *ent)
{
gclient_t *client;
qboolean duck, run;
if (!ent)
{
return;
}
if (ent->s.modelindex != 255)
{
return; /* not in the player model */
@ -1163,7 +1163,7 @@ G_SetClientFrame(edict_t *ent)
}
}
else if (ent->s.frame < client->anim_end)
{
{
/* continue an animation */
ent->s.frame++;
return;
@ -1205,7 +1205,7 @@ newanim:
client->anim_end = FRAME_jump2;
}
else if (run)
{
{
/* running */
if (duck)
{
@ -1219,7 +1219,7 @@ newanim:
}
}
else
{
{
/* standing */
if (duck)
{
@ -1243,12 +1243,12 @@ ClientEndServerFrame(edict_t *ent)
{
float bobtime;
int i;
if (!ent)
{
return;
}
current_player = ent;
current_client = ent->client;
@ -1295,7 +1295,7 @@ ClientEndServerFrame(edict_t *ent)
/* calculate speed and cycle to be used for
all cyclic walking effects */
xyspeed = sqrt(ent->velocity[0] * ent->velocity[0] +
xyspeed = sqrt(ent->velocity[0] * ent->velocity[0] +
ent->velocity[1] * ent->velocity[1]);
if (xyspeed < 5)
@ -1304,7 +1304,7 @@ ClientEndServerFrame(edict_t *ent)
current_client->bobtime = 0; /* start at beginning of cycle again */
}
else if (ent->groundentity)
{
{
/* so bobbing only cycles when on ground */
if (xyspeed > 210)
{

View file

@ -7,19 +7,19 @@
#include "../header/local.h"
#include "../monster/misc/player.h"
#define FRAME_FIRE_FIRST (FRAME_ACTIVATE_LAST + 1)
#define FRAME_IDLE_FIRST (FRAME_FIRE_LAST + 1)
#define FRAME_DEACTIVATE_FIRST (FRAME_IDLE_LAST + 1)
#define GRENADE_TIMER 3.0
#define GRENADE_MINSPEED 400
#define GRENADE_MAXSPEED 800
#define TRAP_TIMER 5.0
#define TRAP_MINSPEED 300
#define TRAP_MAXSPEED 700
static qboolean is_quad;
static qboolean is_quadfire;
static byte is_silenced;
@ -32,12 +32,12 @@ P_ProjectSource(gclient_t *client, vec3_t point, vec3_t distance,
vec3_t forward, vec3_t right, vec3_t result)
{
vec3_t _distance;
if (!client)
{
return;
}
VectorCopy(distance, _distance);
if (client->pers.hand == LEFT_HANDED)
@ -201,19 +201,19 @@ Pickup_Weapon(edict_t *ent, edict_t *other)
}
/*
* The old weapon has been dropped all the
* The old weapon has been dropped all the
* way, so make the new one current
*/
void
ChangeWeapon(edict_t *ent)
{
int i;
if (!ent)
{
return;
}
if (ent->client->grenade_time)
{
ent->client->grenade_time = level.time;
@ -253,7 +253,7 @@ ChangeWeapon(edict_t *ent)
}
if (!ent->client->pers.weapon)
{
{
/* dead */
ent->client->ps.gunindex = 0;
return;
@ -280,7 +280,7 @@ ChangeWeapon(edict_t *ent)
void
NoAmmoWeaponChange(edict_t *ent)
{
{
if (ent->client->pers.inventory[ITEM_INDEX(FindItem("slugs"))] &&
ent->client->pers.inventory[ITEM_INDEX(FindItem("railgun"))])
{
@ -343,12 +343,12 @@ NoAmmoWeaponChange(edict_t *ent)
*/
void
Think_Weapon(edict_t *ent)
{
{
if (!ent)
{
return;
}
/* if just died, put the weapon away */
if (ent->health < 1)
{
@ -723,12 +723,12 @@ weapon_grenade_fire(edict_t *ent, qboolean held)
float timer;
int speed;
float radius;
if (!ent)
{
return;
}
radius = damage + 40;
if (is_quad)
@ -741,7 +741,7 @@ weapon_grenade_fire(edict_t *ent, qboolean held)
P_ProjectSource(ent->client, ent->s.origin, offset, forward, right, start);
timer = ent->client->grenade_time - level.time;
speed = GRENADE_MINSPEED + (GRENADE_TIMER - timer) *
speed = GRENADE_MINSPEED + (GRENADE_TIMER - timer) *
((GRENADE_MAXSPEED - GRENADE_MINSPEED) / GRENADE_TIMER);
fire_grenade2(ent, start, forward, damage, speed, timer, radius, held);
@ -778,12 +778,12 @@ weapon_grenade_fire(edict_t *ent, qboolean held)
void
Weapon_Grenade(edict_t *ent)
{
{
if (!ent)
{
return;
}
if ((ent->client->newweapon) && (ent->client->weaponstate == WEAPON_READY))
{
ChangeWeapon(ent);
@ -920,12 +920,12 @@ weapon_grenadelauncher_fire(edict_t *ent)
vec3_t start;
int damage = 120;
float radius;
if (!ent)
{
return;
}
radius = damage + 40;
if (is_quad)
@ -983,12 +983,12 @@ Weapon_RocketLauncher_Fire(edict_t *ent)
int damage;
float damage_radius;
int radius_damage;
if (!ent)
{
return;
}
damage = 100 + (int)(random() * 20.0);
radius_damage = 120;
damage_radius = 120;
@ -1029,12 +1029,12 @@ Weapon_RocketLauncher(edict_t *ent)
{
static int pause_frames[] = {25, 33, 42, 50, 0};
static int fire_frames[] = {5, 0};
if (!ent)
{
return;
}
Weapon_Generic(ent, 4, 12, 50, 54, pause_frames,
fire_frames, Weapon_RocketLauncher_Fire);
@ -1054,12 +1054,12 @@ Blaster_Fire(edict_t *ent, vec3_t g_offset, int damage,
vec3_t forward, right;
vec3_t start;
vec3_t offset;
if (!ent)
{
return;
}
if (is_quad)
{
damage *= 4;
@ -1097,12 +1097,12 @@ void
Weapon_Blaster_Fire(edict_t *ent)
{
int damage;
if (!ent)
{
return;
}
if (deathmatch->value)
{
damage = 15;
@ -1121,12 +1121,12 @@ Weapon_Blaster(edict_t *ent)
{
static int pause_frames[] = {19, 32, 0};
static int fire_frames[] = {5, 0};
if (!ent)
{
return;
}
Weapon_Generic(ent, 4, 8, 52, 55, pause_frames,
fire_frames, Weapon_Blaster_Fire);
@ -1144,12 +1144,12 @@ Weapon_HyperBlaster_Fire(edict_t *ent)
vec3_t offset;
int effect;
int damage;
if (!ent)
{
return;
}
ent->client->weapon_sound = gi.soundindex("weapons/hyprbl1a.wav");
if (!(ent->client->buttons & BUTTON_ATTACK))
@ -1238,12 +1238,12 @@ Weapon_HyperBlaster(edict_t *ent)
{
static int pause_frames[] = {0};
static int fire_frames[] = {6, 7, 8, 9, 10, 11, 0};
if (!ent)
{
return;
}
Weapon_Generic(ent, 5, 20, 49, 53, pause_frames,
fire_frames, Weapon_HyperBlaster_Fire);
@ -1266,12 +1266,12 @@ Machinegun_Fire(edict_t *ent)
int damage = 8;
int kick = 2;
vec3_t offset;
if (!ent)
{
return;
}
if (!(ent->client->buttons & BUTTON_ATTACK))
{
ent->client->machinegun_shots = 0;
@ -1368,12 +1368,12 @@ Weapon_Machinegun(edict_t *ent)
{
static int pause_frames[] = {23, 45, 0};
static int fire_frames[] = {4, 5, 0};
if (!ent)
{
return;
}
Weapon_Generic(ent, 3, 5, 45, 49, pause_frames,
fire_frames, Machinegun_Fire);
@ -1395,12 +1395,12 @@ Chaingun_Fire(edict_t *ent)
vec3_t offset;
int damage;
int kick = 2;
if (!ent)
{
return;
}
if (deathmatch->value)
{
damage = 6;
@ -1541,12 +1541,12 @@ Weapon_Chaingun(edict_t *ent)
{
static int pause_frames[] = {38, 43, 51, 61, 0};
static int fire_frames[] = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 0};
if (!ent)
{
return;
}
Weapon_Generic(ent, 4, 31, 61, 64, pause_frames, fire_frames, Chaingun_Fire);
if (is_quadfire)
@ -1566,12 +1566,12 @@ weapon_shotgun_fire(edict_t *ent)
vec3_t offset;
int damage = 4;
int kick = 8;
if (!ent)
{
return;
}
if (ent->client->ps.gunframe == 9)
{
ent->client->ps.gunframe++;
@ -1623,12 +1623,12 @@ Weapon_Shotgun(edict_t *ent)
{
static int pause_frames[] = {22, 28, 34, 0};
static int fire_frames[] = {8, 9, 0};
if (!ent)
{
return;
}
Weapon_Generic(ent, 7, 18, 36, 39, pause_frames,
fire_frames, weapon_shotgun_fire);
@ -1648,12 +1648,12 @@ weapon_supershotgun_fire(edict_t *ent)
vec3_t v;
int damage = 6;
int kick = 12;
if (!ent)
{
return;
}
AngleVectors(ent->client->v_angle, forward, right, NULL);
VectorScale(forward, -2, ent->client->kick_origin);
@ -1702,12 +1702,12 @@ Weapon_SuperShotgun(edict_t *ent)
Weapon_Generic(ent, 6, 17, 57, 61, pause_frames,
fire_frames, weapon_supershotgun_fire);
if (!ent)
{
return;
}
if (is_quadfire)
{
Weapon_Generic(ent, 6, 17, 57, 61, pause_frames,
@ -1725,14 +1725,14 @@ weapon_railgun_fire(edict_t *ent)
vec3_t offset;
int damage;
int kick;
if (!ent)
{
return;
}
if (deathmatch->value)
{
{
/* normal damage is too extreme in dm */
damage = 100;
kick = 200;
@ -1781,12 +1781,12 @@ Weapon_Railgun(edict_t *ent)
Weapon_Generic(ent, 3, 18, 56, 61, pause_frames,
fire_frames, weapon_railgun_fire);
if (!ent)
{
return;
}
if (is_quadfire)
{
Weapon_Generic(ent, 3, 18, 56, 61, pause_frames,
@ -1803,12 +1803,12 @@ weapon_bfg_fire(edict_t *ent)
vec3_t forward, right;
int damage;
float damage_radius = 1000;
if (!ent)
{
return;
}
if (deathmatch->value)
{
damage = 200;
@ -1873,12 +1873,12 @@ Weapon_BFG(edict_t *ent)
{
static int pause_frames[] = {39, 45, 50, 55, 0};
static int fire_frames[] = {9, 17, 0};
if (!ent)
{
return;
}
Weapon_Generic(ent, 8, 32, 55, 58, pause_frames,
fire_frames, weapon_bfg_fire);
@ -1901,12 +1901,12 @@ weapon_ionripper_fire(edict_t *ent)
vec3_t offset;
vec3_t tempang;
int damage;
if (!ent)
{
return;
}
if (deathmatch->value)
{
/* tone down for deathmatch */
@ -1962,12 +1962,12 @@ Weapon_Ionripper(edict_t *ent)
{
static int pause_frames[] = {36, 0};
static int fire_frames[] = {5, 0};
if (!ent)
{
return;
}
Weapon_Generic(ent, 4, 6, 36, 39, pause_frames,
fire_frames, weapon_ionripper_fire);
@ -1990,12 +1990,12 @@ weapon_phalanx_fire(edict_t *ent)
int damage;
float damage_radius;
int radius_damage;
if (!ent)
{
return;
}
damage = 70 + (int)(random() * 10.0);
radius_damage = 120;
damage_radius = 120;
@ -2058,12 +2058,12 @@ Weapon_Phalanx(edict_t *ent)
{
static int pause_frames[] = {29, 42, 55, 0};
static int fire_frames[] = {7, 8, 0};
if (!ent)
{
return;
}
Weapon_Generic(ent, 5, 20, 58, 63, pause_frames,
fire_frames, weapon_phalanx_fire);
@ -2086,12 +2086,12 @@ weapon_trap_fire(edict_t *ent, qboolean held)
float timer;
int speed;
float radius;
if (!ent)
{
return;
}
radius = damage + 40;
if (is_quad)
@ -2114,12 +2114,12 @@ weapon_trap_fire(edict_t *ent, qboolean held)
void
Weapon_Trap(edict_t *ent)
{
{
if (!ent)
{
return;
}
if ((ent->client->newweapon) && (ent->client->weaponstate == WEAPON_READY))
{
ChangeWeapon(ent);

View file

@ -34,22 +34,22 @@
* - If the operating system is changed internal structures
* may change in an unrepairable way.
* - If the architecture is changed pointer length and
* other internal datastructures change in an
* other internal datastructures change in an
* incompatible way.
* - If the edict_t struct is changed, savegames
* will break.
* This is not so bad as it looks since functions and
* struct won't be added and edict_t won't be changed
* struct won't be added and edict_t won't be changed
* if no big, sweeping changes are done. The operating
* system and architecture are in the hands of the user.
*/
#include "../header/local.h"
/*
/*
* When ever the savegame version
* is changed, q2 will refuse to
* load older savegames. This
* load older savegames. This
* should be bumped if the files
* in tables/ are changed, otherwise
* strange things may happen.
@ -60,7 +60,7 @@
* This macros are used to
* prohibit loading of savegames
* created on other systems or
* architectures. This will
* architectures. This will
* crash q2 in spectecular
* ways
*/
@ -95,7 +95,7 @@
* function signature with
* the corresponding pointer
*/
typedef struct
typedef struct
{
char *funcStr;
byte *funcPtr;
@ -106,7 +106,7 @@ typedef struct
* mmove_t string with the
* correspondig pointer
* */
typedef struct
typedef struct
{
char *mmoveStr;
mmove_t *mmovePtr;
@ -155,7 +155,7 @@ field_t fields[] = {
};
/*
* Level fields to
* Level fields to
* be saved
*/
field_t levelfields[] = {
@ -174,7 +174,7 @@ field_t clientfields[] = {
/*
* This will be called when the dll is first loaded,
* which only happens when a new game is started or
* which only happens when a new game is started or
* a save game is loaded.
*/
void
@ -243,7 +243,7 @@ InitGame(void)
/* initialize all clients for this game */
game.maxclients = maxclients->value;
game.clients = gi.TagMalloc (game.maxclients * sizeof(game.clients[0]), TAG_GAME);
globals.num_edicts = game.maxclients+1;
globals.num_edicts = game.maxclients+1;
}
/* ========================================================= */
@ -273,7 +273,7 @@ GetFunctionByAddress(byte *adr)
/*
* Helper function to get the
* pointer to a function by
* pointer to a function by
* it's human readable name.
* Called by WriteField1 and
* WriteField2.
@ -335,14 +335,14 @@ FindMmoveByName(char *name)
return NULL;
}
/* ========================================================= */
/*
/*
* The following two functions are
* doing the dirty work to write the
* data generated by the functions
* data generated by the functions
* below this block into files.
*/
void
@ -533,7 +533,7 @@ WriteField2(FILE *f, field_t *field, byte *base)
/* ========================================================= */
/*
/*
* This function does the dirty
* work to read the data from a
* file. The processing of the
@ -673,7 +673,7 @@ ReadField(FILE *f, field_t *field, byte *base)
/* ========================================================= */
/*
* Write the client struct into a file.
* Write the client struct into a file.
*/
void
WriteClient(FILE *f, gclient_t *client)
@ -823,13 +823,13 @@ ReadGame(const char *filename)
fclose(f);
gi.error("Savegame from an other os.\n");
}
else if (strcmp(str_arch, ARCH))
{
fclose(f);
gi.error("Savegame from an other architecure.\n");
}
g_edicts = gi.TagMalloc(game.maxentities * sizeof(g_edicts[0]), TAG_GAME);
globals.edicts = g_edicts;
@ -876,7 +876,7 @@ WriteEdict(FILE *f, edict_t *ent)
WriteField2(f, field, (byte *)ent);
}
}
/*
* Helper fcuntion to write the
* level local data into a file.
@ -906,7 +906,7 @@ WriteLevelLocals(FILE *f)
WriteField2(f, field, (byte *)&level);
}
}
/*
* Writes the current level
* into a file.
@ -951,7 +951,7 @@ WriteLevel(const char *filename)
fclose(f);
}
/* ========================================================== */
/*
@ -976,7 +976,7 @@ ReadEdict(FILE *f, edict_t *ent)
/*
* A helper function to
* read the level local
* data from a file.
* data from a file.
* Called by ReadLevel.
*/
void
@ -1016,7 +1016,7 @@ ReadLevel(const char *filename)
gi.error("Couldn't open %s", filename);
}
/* free any dynamic memory allocated by
/* free any dynamic memory allocated by
loading the level base state */
gi.FreeTags(TAG_LEVEL);

View file

@ -129,7 +129,7 @@ vec3_t monster_flash_offset[] = {
{4.6 * 1.15, -16.8 * 1.15, 7.3 * 1.15},
/* MZ2_CHICK_ROCKET_1 57 */
{24.8, -9.0, 39.0},
{24.8, -9.0, 39.0},
/* MZ2_FLYER_BLASTER_1 58 */
{12.1, 13.4, -14.5},
@ -341,7 +341,7 @@ vec3_t monster_flash_offset[] = {
{17, -62, 91},
/* MZ2_WIDOW_RAIL_RIGHT 155 */
{68, 12, 86},
/* MZ2_WIDOW_BLASTER_SWEEP1 156 */
/* MZ2_WIDOW_BLASTER_SWEEP1 156 */
{47.5, 56, 89},
/* MZ2_WIDOW_BLASTER_SWEEP2 157 */
{54, 52, 91},

View file

@ -25,7 +25,7 @@ static int j;
static uint64_t carry;
static uint64_t xs;
static uint64_t cng;
uint64_t
B64MWC(void)
{
@ -36,11 +36,11 @@ B64MWC(void)
t = (x << 28) + carry;
carry = (x >> 36) - (t < x);
return QARY[j] = t - x;
}
}
/*
* Generate a pseudorandom
* integer >0.
/*
* Generate a pseudorandom
* integer >0.
*/
int
randk(void)
@ -55,7 +55,7 @@ randk(void)
/*
* Generate a pseudorandom
* signed float between
* signed float between
* 0 and 1.
*/
float
@ -87,7 +87,7 @@ randk_seed(void)
QARY[i] = CNG + XS;
}
/* Run through several rounds
/* Run through several rounds
to warm up the state */
for (i = 0; i < 256; i++)
{