Einige Dateien aufgeraemunt

This commit is contained in:
Yamagi Burmeister 2009-04-10 15:13:00 +00:00
parent 2590b35e2a
commit 096c3faa1c
6 changed files with 166 additions and 357 deletions

View file

@ -519,8 +519,6 @@ qboolean FindTarget (edict_t *self)
if (r == RANGE_FAR) if (r == RANGE_FAR)
return false; return false;
// this is where we would check invisibility
// is client in an spot too dark to be seen? // is client in an spot too dark to be seen?
if (client->light_level <= 5) if (client->light_level <= 5)
return false; return false;
@ -756,7 +754,7 @@ void ai_run_missile(edict_t *self)
self->monsterinfo.attack (self); self->monsterinfo.attack (self);
self->monsterinfo.attack_state = AS_STRAIGHT; self->monsterinfo.attack_state = AS_STRAIGHT;
} }
}; }
/* /*
@ -834,11 +832,12 @@ qboolean ai_checkattack (edict_t *self, float dist)
{ {
if ((level.time - self->enemy->teleport_time) > 5.0) if ((level.time - self->enemy->teleport_time) > 5.0)
{ {
if (self->goalentity == self->enemy) if (self->goalentity == self->enemy) {
if (self->movetarget) if (self->movetarget)
self->goalentity = self->movetarget; self->goalentity = self->movetarget;
else else
self->goalentity = NULL; self->goalentity = NULL;
}
self->monsterinfo.aiflags &= ~AI_SOUND_TARGET; self->monsterinfo.aiflags &= ~AI_SOUND_TARGET;
if (self->monsterinfo.aiflags & AI_TEMP_STAND_GROUND) if (self->monsterinfo.aiflags & AI_TEMP_STAND_GROUND)
self->monsterinfo.aiflags &= ~(AI_STAND_GROUND | AI_TEMP_STAND_GROUND); self->monsterinfo.aiflags &= ~(AI_STAND_GROUND | AI_TEMP_STAND_GROUND);
@ -921,20 +920,12 @@ qboolean ai_checkattack (edict_t *self, float dist)
VectorCopy (self->enemy->s.origin, self->monsterinfo.last_sighting); VectorCopy (self->enemy->s.origin, self->monsterinfo.last_sighting);
} }
// look for other coop players here
// if (coop && self->monsterinfo.search_time < level.time)
// {
// if (FindTarget (self))
// return true;
// }
enemy_infront = infront(self, self->enemy); enemy_infront = infront(self, self->enemy);
enemy_range = range(self, self->enemy); enemy_range = range(self, self->enemy);
VectorSubtract (self->enemy->s.origin, self->s.origin, temp); VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
enemy_yaw = vectoyaw(temp); enemy_yaw = vectoyaw(temp);
// JDC self->ideal_yaw = enemy_yaw;
if (self->monsterinfo.attack_state == AS_MISSILE) if (self->monsterinfo.attack_state == AS_MISSILE)
{ {
ai_run_missile (self); ai_run_missile (self);
@ -1004,16 +995,10 @@ void ai_run (edict_t *self, float dist)
} }
if (self->monsterinfo.attack_state == AS_FLY_STRAFE) if (self->monsterinfo.attack_state == AS_FLY_STRAFE)
{
if (self->monsterinfo.flyStrafeTimeout < level.time)
self->monsterinfo.attack_state == AS_STRAIGHT;
else
{ {
ai_fly_strafe(self, dist); ai_fly_strafe(self, dist);
//if (random() < 0.5)
return; return;
} }
}
if (ai_checkattack (self, dist)) if (ai_checkattack (self, dist))
return; return;
@ -1026,8 +1011,6 @@ void ai_run (edict_t *self, float dist)
if (enemy_vis) if (enemy_vis)
{ {
// if (self.aiflags & AI_LOST_SIGHT)
// dprint("regained sight\n");
M_MoveToGoal (self, dist); M_MoveToGoal (self, dist);
self->monsterinfo.aiflags &= ~AI_LOST_SIGHT; self->monsterinfo.aiflags &= ~AI_LOST_SIGHT;
VectorCopy (self->enemy->s.origin, self->monsterinfo.last_sighting); VectorCopy (self->enemy->s.origin, self->monsterinfo.last_sighting);
@ -1035,18 +1018,10 @@ void ai_run (edict_t *self, float dist)
return; return;
} }
// coop will change to another enemy if visible
if (coop->value)
{ // FIXME: insane guys get mad with this, which causes crashes!
if (FindTarget (self))
return;
}
if ((self->monsterinfo.search_time) && (level.time > (self->monsterinfo.search_time + 20))) if ((self->monsterinfo.search_time) && (level.time > (self->monsterinfo.search_time + 20)))
{ {
M_MoveToGoal (self, dist); M_MoveToGoal (self, dist);
self->monsterinfo.search_time = 0; self->monsterinfo.search_time = 0;
// dprint("search timeout\n");
return; return;
} }
@ -1059,7 +1034,6 @@ void ai_run (edict_t *self, float dist)
if (!(self->monsterinfo.aiflags & AI_LOST_SIGHT)) if (!(self->monsterinfo.aiflags & AI_LOST_SIGHT))
{ {
// just lost sight of the player, decide where to go first // just lost sight of the player, decide where to go first
// dprint("lost sight of player, last seen at "); dprint(vtos(self.last_sighting)); dprint("\n");
self->monsterinfo.aiflags |= (AI_LOST_SIGHT | AI_PURSUIT_LAST_SEEN); self->monsterinfo.aiflags |= (AI_LOST_SIGHT | AI_PURSUIT_LAST_SEEN);
self->monsterinfo.aiflags &= ~(AI_PURSUE_NEXT | AI_PURSUE_TEMP); self->monsterinfo.aiflags &= ~(AI_PURSUE_NEXT | AI_PURSUE_TEMP);
new = true; new = true;
@ -1068,14 +1042,12 @@ void ai_run (edict_t *self, float dist)
if (self->monsterinfo.aiflags & AI_PURSUE_NEXT) if (self->monsterinfo.aiflags & AI_PURSUE_NEXT)
{ {
self->monsterinfo.aiflags &= ~AI_PURSUE_NEXT; self->monsterinfo.aiflags &= ~AI_PURSUE_NEXT;
// dprint("reached current goal: "); dprint(vtos(self.origin)); dprint(" "); dprint(vtos(self.last_sighting)); dprint(" "); dprint(ftos(vlen(self.origin - self.last_sighting))); dprint("\n");
// give ourself more time since we got this far // give ourself more time since we got this far
self->monsterinfo.search_time = level.time + 5; self->monsterinfo.search_time = level.time + 5;
if (self->monsterinfo.aiflags & AI_PURSUE_TEMP) if (self->monsterinfo.aiflags & AI_PURSUE_TEMP)
{ {
// dprint("was temp goal; retrying original\n");
self->monsterinfo.aiflags &= ~AI_PURSUE_TEMP; self->monsterinfo.aiflags &= ~AI_PURSUE_TEMP;
marker = NULL; marker = NULL;
VectorCopy (self->monsterinfo.saved_goal, self->monsterinfo.last_sighting); VectorCopy (self->monsterinfo.saved_goal, self->monsterinfo.last_sighting);
@ -1096,9 +1068,6 @@ void ai_run (edict_t *self, float dist)
VectorCopy (marker->s.origin, self->monsterinfo.last_sighting); VectorCopy (marker->s.origin, self->monsterinfo.last_sighting);
self->monsterinfo.trail_time = marker->timestamp; self->monsterinfo.trail_time = marker->timestamp;
self->s.angles[YAW] = self->ideal_yaw = marker->s.angles[YAW]; self->s.angles[YAW] = self->ideal_yaw = marker->s.angles[YAW];
// dprint("heading is "); dprint(ftos(self.ideal_yaw)); dprint("\n");
// debug_drawline(self.origin, self.last_sighting, 52);
new = true; new = true;
} }
} }
@ -1115,8 +1084,6 @@ void ai_run (edict_t *self, float dist)
if (new) if (new)
{ {
// gi.dprintf("checking for course correction\n");
tr = gi.trace(self->s.origin, self->mins, self->maxs, self->monsterinfo.last_sighting, self, MASK_PLAYERSOLID); tr = gi.trace(self->s.origin, self->mins, self->maxs, self->monsterinfo.last_sighting, self, MASK_PLAYERSOLID);
if (tr.fraction < 1) if (tr.fraction < 1)
{ {
@ -1144,7 +1111,6 @@ void ai_run (edict_t *self, float dist)
{ {
VectorSet(v, d2 * left * 0.5, -16, 0); VectorSet(v, d2 * left * 0.5, -16, 0);
G_ProjectSource (self->s.origin, v, v_forward, v_right, left_target); G_ProjectSource (self->s.origin, v, v_forward, v_right, left_target);
// gi.dprintf("incomplete path, go part way and adjust again\n");
} }
VectorCopy (self->monsterinfo.last_sighting, self->monsterinfo.saved_goal); VectorCopy (self->monsterinfo.last_sighting, self->monsterinfo.saved_goal);
self->monsterinfo.aiflags |= AI_PURSUE_TEMP; self->monsterinfo.aiflags |= AI_PURSUE_TEMP;
@ -1152,8 +1118,6 @@ void ai_run (edict_t *self, float dist)
VectorCopy (left_target, self->monsterinfo.last_sighting); VectorCopy (left_target, self->monsterinfo.last_sighting);
VectorSubtract (self->goalentity->s.origin, self->s.origin, v); VectorSubtract (self->goalentity->s.origin, self->s.origin, v);
self->s.angles[YAW] = self->ideal_yaw = vectoyaw(v); self->s.angles[YAW] = self->ideal_yaw = vectoyaw(v);
// gi.dprintf("adjusted left\n");
// debug_drawline(self.origin, self.last_sighting, 152);
} }
else if (right >= center && right > left) else if (right >= center && right > left)
{ {
@ -1161,7 +1125,6 @@ void ai_run (edict_t *self, float dist)
{ {
VectorSet(v, d2 * right * 0.5, 16, 0); VectorSet(v, d2 * right * 0.5, 16, 0);
G_ProjectSource (self->s.origin, v, v_forward, v_right, right_target); G_ProjectSource (self->s.origin, v, v_forward, v_right, right_target);
// gi.dprintf("incomplete path, go part way and adjust again\n");
} }
VectorCopy (self->monsterinfo.last_sighting, self->monsterinfo.saved_goal); VectorCopy (self->monsterinfo.last_sighting, self->monsterinfo.saved_goal);
self->monsterinfo.aiflags |= AI_PURSUE_TEMP; self->monsterinfo.aiflags |= AI_PURSUE_TEMP;
@ -1169,11 +1132,8 @@ void ai_run (edict_t *self, float dist)
VectorCopy (right_target, self->monsterinfo.last_sighting); VectorCopy (right_target, self->monsterinfo.last_sighting);
VectorSubtract (self->goalentity->s.origin, self->s.origin, v); VectorSubtract (self->goalentity->s.origin, self->s.origin, v);
self->s.angles[YAW] = self->ideal_yaw = vectoyaw(v); self->s.angles[YAW] = self->ideal_yaw = vectoyaw(v);
// gi.dprintf("adjusted right\n");
// debug_drawline(self.origin, self.last_sighting, 152);
} }
} }
// else gi.dprintf("course was fine\n");
} }
M_MoveToGoal (self, dist); M_MoveToGoal (self, dist);
@ -1183,3 +1143,4 @@ void ai_run (edict_t *self, float dist)
if (self) if (self)
self->goalentity = save; self->goalentity = save;
} }

View file

@ -1,6 +1,7 @@
#include "g_local.h" #include "g_local.h"
#include "m_player.h" #include "m_player.h"
char *ClientTeam (edict_t *ent) char *ClientTeam (edict_t *ent)
{ {
char *p; char *p;
@ -22,7 +23,6 @@ char *ClientTeam (edict_t *ent)
return value; return value;
} }
// if ((int)(dmflags->value) & DF_SKINTEAMS)
return ++p; return ++p;
} }
@ -314,7 +314,7 @@ void Cmd_God_f (edict_t *ent)
{ {
char *msg; char *msg;
if (deathmatch->value && !sv_cheats->value) if ((deathmatch->value || coop->value) && !sv_cheats->value)
{ {
gi.cprintf (ent, PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); gi.cprintf (ent, PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n");
return; return;
@ -343,7 +343,7 @@ void Cmd_Notarget_f (edict_t *ent)
{ {
char *msg; char *msg;
if (deathmatch->value && !sv_cheats->value) if ((deathmatch->value || coop->value) && !sv_cheats->value)
{ {
gi.cprintf (ent, PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); gi.cprintf (ent, PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n");
return; return;
@ -370,7 +370,7 @@ void Cmd_Noclip_f (edict_t *ent)
{ {
char *msg; char *msg;
if (deathmatch->value && !sv_cheats->value) if ((deathmatch->value || coop->value) && !sv_cheats->value)
{ {
gi.cprintf (ent, PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); gi.cprintf (ent, PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n");
return; return;
@ -398,16 +398,16 @@ struct altsel_s
} alternates[] = } alternates[] =
{ {
{0}, // filler {0}, // filler
{2,"Blaster", "Flare Gun"}, {2,{"Blaster", "Flare Gun"}},
{1,"Shotgun"}, {1,{"Shotgun"}},
{1,"Super Shotgun"}, {1,{"Super Shotgun"}},
{1,"Machinegun"}, {1,{"Machinegun"}},
{1,"Chaingun"}, {1,{"Chaingun"}},
{1,"Grenade Launcher"}, {1,{"Grenade Launcher"}},
{1,"Rocket Launcher"}, {1,{"Rocket Launcher"}},
{1,"HyperBlaster"}, {1,{"HyperBlaster"}},
{2,"Railgun", "Sniper Rifle"}, {2,{"Railgun", "Sniper Rifle"}},
{2,"BFG10K", "Sonic Cannon"} {2,{"BFG10K", "Sonic Cannon"}}
}; };
qboolean tryUse(edict_t *ent, char *s) qboolean tryUse(edict_t *ent, char *s)
@ -455,7 +455,6 @@ void findNext(edict_t *ent, struct altsel_s *ptr, int offset)
void altSelect(edict_t *ent, int num) void altSelect(edict_t *ent, int num)
{ {
int index = 0;
int offset = -1; int offset = -1;
int i = 0; int i = 0;
struct altsel_s *ptr = NULL; struct altsel_s *ptr = NULL;
@ -485,7 +484,7 @@ void altSelect(edict_t *ent, int num)
offset = 0; offset = 0;
else else
{ {
offset = ((++offset) % ptr->num); offset = ((offset + 1) % (ptr->num));
} }
// now select this offset // now select this offset
@ -539,8 +538,6 @@ void Cmd_Use_f (edict_t *ent)
} }
/* /*
================== ==================
Cmd_Drop_f Cmd_Drop_f
@ -556,7 +553,6 @@ void Cmd_Drop_f (edict_t *ent)
s = gi.args(); s = gi.args();
it = FindItem (s); it = FindItem (s);
if (!it) if (!it)
{ {
gi.cprintf (ent, PRINT_HIGH, "unknown item: %s\n", s); gi.cprintf (ent, PRINT_HIGH, "unknown item: %s\n", s);
@ -665,7 +661,6 @@ void Cmd_WeapPrev_f (edict_t *ent)
for (i=1 ; i<=MAX_ITEMS ; i++) for (i=1 ; i<=MAX_ITEMS ; i++)
{ {
index = (selected_weapon + MAX_ITEMS - i)%MAX_ITEMS; index = (selected_weapon + MAX_ITEMS - i)%MAX_ITEMS;
// index = (selected_weapon + i)%MAX_ITEMS;
if (!cl->pers.inventory[index]) if (!cl->pers.inventory[index])
continue; continue;
it = &itemlist[index]; it = &itemlist[index];
@ -676,7 +671,6 @@ void Cmd_WeapPrev_f (edict_t *ent)
if (! (it->flags & IT_WEAPON) ) if (! (it->flags & IT_WEAPON) )
continue; continue;
it->use (ent, it); it->use (ent, it);
// if (cl->pers.weapon == it)
if (cl->newweapon == it) if (cl->newweapon == it)
return; // successful return; // successful
} }
@ -705,7 +699,6 @@ void Cmd_WeapNext_f (edict_t *ent)
for (i=1 ; i<=MAX_ITEMS ; i++) for (i=1 ; i<=MAX_ITEMS ; i++)
{ {
index = (selected_weapon + i)%MAX_ITEMS; index = (selected_weapon + i)%MAX_ITEMS;
// index = (selected_weapon + MAX_ITEMS - i)%MAX_ITEMS;
if (!cl->pers.inventory[index]) if (!cl->pers.inventory[index])
continue; continue;
it = &itemlist[index]; it = &itemlist[index];
@ -716,7 +709,6 @@ void Cmd_WeapNext_f (edict_t *ent)
if (! (it->flags & IT_WEAPON) ) if (! (it->flags & IT_WEAPON) )
continue; continue;
it->use (ent, it); it->use (ent, it);
// if (cl->pers.weapon == it)
if (cl->newweapon == it) if (cl->newweapon == it)
return; // successful return; // successful
} }
@ -1128,3 +1120,4 @@ void ClientCommand (edict_t *ent)
else // anything that doesn't match a command will be a chat else // anything that doesn't match a command will be a chat
Cmd_Say_f (ent, false, true); Cmd_Say_f (ent, false, true);
} }

View file

@ -79,11 +79,9 @@ void Killed (edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, v
if ((targ->svflags & SVF_MONSTER) && (targ->deadflag != DEAD_DEAD)) if ((targ->svflags & SVF_MONSTER) && (targ->deadflag != DEAD_DEAD))
{ {
// targ->svflags |= SVF_DEADMONSTER; // now treat as a different content type
if (!(targ->monsterinfo.aiflags & AI_GOOD_GUY) && !(targ->spawnflags & 16)) if (!(targ->monsterinfo.aiflags & AI_GOOD_GUY) && !(targ->spawnflags & 16))
{ {
level.killed_monsters++; level.killed_monsters++;
if (coop->value && attacker->client) if (coop->value && attacker->client)
attacker->client->resp.score++; attacker->client->resp.score++;
// medics won't heal monsters that they kill themselves // medics won't heal monsters that they kill themselves
@ -119,7 +117,6 @@ void SpawnDamage (int type, vec3_t origin, vec3_t normal, int damage)
damage = 255; damage = 255;
gi.WriteByte (svc_temp_entity); gi.WriteByte (svc_temp_entity);
gi.WriteByte (type); gi.WriteByte (type);
// gi.WriteByte (damage);
gi.WritePosition (origin); gi.WritePosition (origin);
gi.WriteDir (normal); gi.WriteDir (normal);
gi.multicast (origin, MULTICAST_PVS); gi.multicast (origin, MULTICAST_PVS);
@ -156,7 +153,7 @@ static int CheckPowerArmor (edict_t *ent, vec3_t point, vec3_t normal, int damag
gclient_t *client; gclient_t *client;
int save; int save;
int power_armor_type; int power_armor_type;
int index; int index = 0;
int damagePerCell; int damagePerCell;
int pa_te_type; int pa_te_type;
int power; int power;
@ -255,7 +252,7 @@ static int CheckPowerArmor (edict_t *ent, vec3_t point, vec3_t normal, int damag
if (client) if (client)
client->pers.inventory[index] -= power_used; client->pers.inventory[index] -= power_used;
else if (ent->svflags & SVF_MONSTER) else
ent->monsterinfo.power_armor_power -= power_used; ent->monsterinfo.power_armor_power -= power_used;
return save; return save;
} }
@ -355,18 +352,16 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
(strcmp(attacker->classname, "monster_jorg") != 0) && (strcmp(attacker->classname, "monster_jorg") != 0) &&
(!(attacker->mteam && targ->mteam && strcmp(attacker->mteam, targ->mteam) == 0))) (!(attacker->mteam && targ->mteam && strcmp(attacker->mteam, targ->mteam) == 0)))
{ {
if (targ->enemy) if (targ->enemy && targ->enemy->client)
if (targ->enemy->client)
targ->oldenemy = targ->enemy; targ->oldenemy = targ->enemy;
targ->enemy = attacker; targ->enemy = attacker;
if (!(targ->monsterinfo.aiflags & AI_DUCKED)) if (!(targ->monsterinfo.aiflags & AI_DUCKED))
FoundTarget (targ); FoundTarget (targ);
} }
else if(attacker->enemy) // otherwise get mad at whoever they are mad at (help our buddy) unless it is us!
// otherwise get mad at whoever they are mad at (help our buddy) else if (attacker->enemy && attacker->enemy != targ)
{ {
if (targ->enemy) if (targ->enemy && targ->enemy->client)
if (targ->enemy->client)
targ->oldenemy = targ->enemy; targ->oldenemy = targ->enemy;
targ->enemy = attacker->enemy; targ->enemy = attacker->enemy;
if (!(targ->monsterinfo.aiflags & AI_DUCKED)) if (!(targ->monsterinfo.aiflags & AI_DUCKED))
@ -526,10 +521,8 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
SpawnDamage (te_sparks, point, normal, take); SpawnDamage (te_sparks, point, normal, take);
if (targ->takedamage != DAMAGE_IMMORTAL)
targ->health = targ->health - take; targ->health = targ->health - take;
// kill the entity
if (targ->health <= 0) if (targ->health <= 0)
{ {
if ((targ->svflags & SVF_MONSTER) || (client)) if ((targ->svflags & SVF_MONSTER) || (client))
@ -647,3 +640,4 @@ void T_RadiusDamagePosition (vec3_t origin, edict_t *inflictor, edict_t *attacke
} }
} }
} }

View file

@ -146,8 +146,6 @@ void Move_Calc (edict_t *ent, vec3_t dest, void(*func)(edict_t*), int smoothSpee
} }
// smooth speed change // smooth speed change
// ent->think = Think_SmoothAccelMove;
// ent->nextthink = level.time + FRAMETIME;
Think_SmoothAccelMove(ent); Think_SmoothAccelMove(ent);
} }
else if (ent->moveinfo.speed == ent->moveinfo.accel && ent->moveinfo.speed == ent->moveinfo.decel) else if (ent->moveinfo.speed == ent->moveinfo.accel && ent->moveinfo.speed == ent->moveinfo.decel)
@ -291,7 +289,7 @@ void plat_CalcAcceleratedMove(moveinfo_t *moveinfo)
} }
moveinfo->decel_distance = decel_dist; moveinfo->decel_distance = decel_dist;
}; }
void plat_Accelerate (moveinfo_t *moveinfo) void plat_Accelerate (moveinfo_t *moveinfo)
{ {
@ -362,7 +360,7 @@ void plat_Accelerate (moveinfo_t *moveinfo)
// we are at constant velocity (move_speed) // we are at constant velocity (move_speed)
return; return;
}; }
void Think_AccelMove (edict_t *ent) void Think_AccelMove (edict_t *ent)
{ {
@ -430,8 +428,6 @@ void Think_SmoothAccelMove (edict_t *ent)
ent->think = Think_SmoothAccelMove; ent->think = Think_SmoothAccelMove;
} }
void plat_go_down (edict_t *ent); void plat_go_down (edict_t *ent);
void plat_hit_top (edict_t *ent) void plat_hit_top (edict_t *ent)
@ -514,7 +510,6 @@ void Use_Plat (edict_t *ent, edict_t *other, edict_t *activator)
void Touch_Plat_Center (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) void Touch_Plat_Center (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{ {
edict_t *trigger = ent;
if (!other->client) if (!other->client)
return; return;
@ -794,8 +789,6 @@ void SP_func_rotating (edict_t *ent)
if (!ent->dmg) if (!ent->dmg)
ent->dmg = 2; ent->dmg = 2;
// ent->moveinfo.sound_middle = "doors/hydro1.wav";
ent->use = rotating_use; ent->use = rotating_use;
if (ent->dmg) if (ent->dmg)
ent->blocked = rotating_blocked; ent->blocked = rotating_blocked;
@ -1495,8 +1488,6 @@ void SP_func_door_rotating (edict_t *ent)
if (!ent->wait) if (!ent->wait)
ent->wait = 3; ent->wait = 3;
//if (!ent->dmg)
// ent->dmg = 2;
if (ent->sounds != 1) if (ent->sounds != 1)
{ {
@ -1734,7 +1725,6 @@ void train_next (edict_t *self)
again: again:
if (!self->target) if (!self->target)
{ {
// gi.dprintf ("train_next: no next target\n");
return; return;
} }

View file

@ -46,16 +46,6 @@ void Action_Push(edict_t *ent);
void Use_PlasmaShield (edict_t *ent, gitem_t *item); void Use_PlasmaShield (edict_t *ent, gitem_t *item);
#if defined(_DEBUG) && defined(_Z_TESTMODE)
void Weapon_LineDraw (edict_t *ent);
void Weapon_Test (edict_t *ent);
qboolean Pickup_TestItem (edict_t *ent, edict_t *other);
void Drop_TestItem (edict_t *ent, gitem_t *item);
#endif
//====================================================================== //======================================================================
/* /*
@ -435,8 +425,6 @@ void Use_Breather (edict_t *ent, gitem_t *item)
ent->client->breather_framenum += 300; ent->client->breather_framenum += 300;
else else
ent->client->breather_framenum = level.framenum + 300; ent->client->breather_framenum = level.framenum + 300;
// gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
} }
//====================================================================== //======================================================================
@ -450,8 +438,6 @@ void Use_Envirosuit (edict_t *ent, gitem_t *item)
ent->client->enviro_framenum += 300; ent->client->enviro_framenum += 300;
else else
ent->client->enviro_framenum = level.framenum + 300; ent->client->enviro_framenum = level.framenum + 300;
// gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
} }
//====================================================================== //======================================================================
@ -476,8 +462,6 @@ void Use_Silencer (edict_t *ent, gitem_t *item)
ent->client->pers.inventory[ITEM_INDEX(item)]--; ent->client->pers.inventory[ITEM_INDEX(item)]--;
ValidateSelectedItem (ent); ValidateSelectedItem (ent);
ent->client->silencer_shots += 30; ent->client->silencer_shots += 30;
// gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
} }
//====================================================================== //======================================================================
@ -527,7 +511,6 @@ qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count)
max = ent->client->pers.max_cells; max = ent->client->pers.max_cells;
else if (item->tag == AMMO_SLUGS) else if (item->tag == AMMO_SLUGS)
max = ent->client->pers.max_slugs; max = ent->client->pers.max_slugs;
// [evolve
else if (item->tag == AMMO_LASERTRIPBOMB) else if (item->tag == AMMO_LASERTRIPBOMB)
max = ent->client->pers.max_tbombs; max = ent->client->pers.max_tbombs;
else if (item->tag == AMMO_FLARES) else if (item->tag == AMMO_FLARES)
@ -538,7 +521,6 @@ qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count)
max = ent->client->pers.max_a2k; max = ent->client->pers.max_a2k;
else if (item->tag == AMMO_PLASMASHIELD) else if (item->tag == AMMO_PLASMASHIELD)
max = ent->client->pers.max_plasmashield; max = ent->client->pers.max_plasmashield;
// evolve]
else else
return false; return false;
@ -973,7 +955,7 @@ void 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) static void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{ {
if (other == ent->owner) if (other == ent->owner)
return; return;
@ -981,7 +963,7 @@ void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t
Touch_Item (ent, other, plane, surf); Touch_Item (ent, other, plane, surf);
} }
void drop_make_touchable (edict_t *ent) static void drop_make_touchable (edict_t *ent)
{ {
ent->touch = Touch_Item; ent->touch = Touch_Item;
if (deathmatch->value) if (deathmatch->value)
@ -1600,7 +1582,6 @@ always owned, never in the world
/* pickup */ "Grenades", /* pickup */ "Grenades",
/* width */ 3, /* width */ 3,
5, 5,
// "grenades",
"Grenades", "Grenades",
IT_AMMO|IT_WEAPON, IT_AMMO|IT_WEAPON,
NULL, NULL,
@ -1984,8 +1965,6 @@ always owned, never in the world
/* precache */ "items/empnuke/emp_trg.wav" //items/empnuke/emp_act.wav items/empnuke/emp_spin.wav items/empnuke/emp_idle.wav /* precache */ "items/empnuke/emp_trg.wav" //items/empnuke/emp_act.wav items/empnuke/emp_spin.wav items/empnuke/emp_idle.wav
}, },
// EVOLVE]
// //
// POWERUP ITEMS // POWERUP ITEMS
// //
@ -2602,80 +2581,6 @@ security pass for the security level
/* precache */ "" /* precache */ ""
}, },
#if defined(_DEBUG) && defined(_Z_TESTMODE)
/* weapon_ldraw (.3 .3 1) (-16 -16 -16) (16 16 16)
always owned, never in the world
*/
{
"weapon_linedraw",
NULL,
Use_Weapon,
NULL,
Weapon_LineDraw,
"misc/w_pkup.wav",
NULL, 0,
"models/weapons/v_blast/tris.md2",
/* icon */ "w_blaster",
/* pickup */ "Line Draw",
0,
0,
NULL,
IT_WEAPON,
NULL,
0,
/* precache */ "weapons/blastf1a.wav misc/lasfly.wav"
},
/* weapon_testweapon (.3 .3 1) (-16 -16 -16) (16 16 16)
loaded from weapon.cfg
*/
{
"weapon_test",
Pickup_Weapon,
Use_Weapon,
Drop_Weapon,
Weapon_Test,
"misc/w_pkup.wav",
"models/weapons/v_blast/tris.md2", EF_ROTATE,
"models/weapons/v_blast/tris.md2",
/* icon */ "w_blaster",
/* pickup */ "Test",
0,
0,
"Shells",
IT_WEAPON,
NULL,
0,
/* precache */ "weapons/blastf1a.wav misc/lasfly.wav"
},
/* weapon_testitem (.3 .3 1) (-16 -16 -16) (16 16 16)
loaded from item.cfg
*/
{
"item_test",
Pickup_TestItem,
NULL,
Drop_TestItem,
NULL,
"misc/w_pkup.wav",
"models/weapons/v_blast/tris.md2", 0,
"models/weapons/v_blast/tris.md2",
/* icon */ "w_blaster",
/* pickup */ "Test",
0,
0,
NULL,
0,
NULL,
0,
/* precache */ "weapons/blastf1a.wav misc/lasfly.wav"
},
#endif
// end of list marker // end of list marker
{NULL} {NULL}
}; };
@ -2779,3 +2684,4 @@ void SetItemNames (void)
power_screen_index = ITEM_INDEX(FindItem("Power Screen")); power_screen_index = ITEM_INDEX(FindItem("Power Screen"));
power_shield_index = ITEM_INDEX(FindItem("Power Shield")); power_shield_index = ITEM_INDEX(FindItem("Power Shield"));
} }

View file

@ -1,6 +1,7 @@
// g_local.h -- local definitions for game module // g_local.h -- local definitions for game module
#include "q_shared.h" #include "q_shared.h"
#include "z_anim.h"
// define GAME_INCLUDE so that game.h does not define the // define GAME_INCLUDE so that game.h does not define the
// short, server-visible gclient_t and edict_t structures, // short, server-visible gclient_t and edict_t structures,
@ -24,9 +25,6 @@
// Zaero includes // Zaero includes
#include "z_debug.h" #include "z_debug.h"
#ifdef CACHE_SOUND
#include "z_list.h"
#endif
// the "gamename" client command will print this plus compile date // the "gamename" client command will print this plus compile date
#define GAMEVERSION "Zaero 1.1" #define GAMEVERSION "Zaero 1.1"
@ -600,9 +598,6 @@ extern cvar_t *gamedir;
extern cvar_t *grenadeammotype; extern cvar_t *grenadeammotype;
extern cvar_t *grenadeammo; extern cvar_t *grenadeammo;
extern cvar_t *bettyammo; extern cvar_t *bettyammo;
#ifdef CACHE_SOUND
extern cvar_t *printSoundRejects;
#endif
#define world (&g_edicts[0]) #define world (&g_edicts[0])
@ -803,7 +798,6 @@ edict_t *PlayerTrail_PickFirst (edict_t *self);
edict_t *PlayerTrail_PickNext (edict_t *self); edict_t *PlayerTrail_PickNext (edict_t *self);
edict_t *PlayerTrail_LastSpot (void); edict_t *PlayerTrail_LastSpot (void);
// //
// g_client.c // g_client.c
// //
@ -825,6 +819,7 @@ void player_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag
// g_svcmds.c // g_svcmds.c
// //
void ServerCommand (void); void ServerCommand (void);
qboolean SV_FilterPacket (char *from);
// //
// p_view.c // p_view.c
@ -863,24 +858,6 @@ void G_RunEntity (edict_t *ent);
void SaveClientData (void); void SaveClientData (void);
void FetchClientEntData (edict_t *ent); void FetchClientEntData (edict_t *ent);
#if defined(_DEBUG) && defined(_Z_TESTMODE)
//
// z_mtest.c
//
void Cmd_TestItem (edict_t *ent);
#endif
//
// z_trigger.c
//
#ifdef CACHE_SOUND
void printSoundNum();
void initSoundList();
#endif
// //
// z_item.c // z_item.c
// //
@ -1050,10 +1027,6 @@ struct gclient_s
float respawn_time; // can respawn when time > this float respawn_time; // can respawn when time > this
#if defined(_DEBUG) && defined(_Z_TESTMODE)
struct edict_s *lineDraw;
#endif
// used for blinding // used for blinding
int flashTime; int flashTime;
int flashBase; int flashBase;
@ -1239,11 +1212,6 @@ struct edict_s
float weaponsound_time; float weaponsound_time;
#if defined(_DEBUG) && defined(_Z_TESTMODE)
//can't teach an old dog new tricks
void *extra_data;
#endif
// schooling info // schooling info
edict_t *zRaduisList, *zSchoolChain; edict_t *zRaduisList, *zSchoolChain;
float zDistance; float zDistance;
@ -1272,10 +1240,7 @@ struct edict_s
int bossFireCount; int bossFireCount;
}; };
//zaero debug includes (need type info)
#include "z_frames.h"
#include "z_anim.h"
// Zaero dmflags // Zaero dmflags
#define ZDM_NO_GL_POLYBLEND_DAMAGE 1 #define ZDM_NO_GL_POLYBLEND_DAMAGE 1
#define ZDM_ZAERO_ITEMS 2 #define ZDM_ZAERO_ITEMS 2