mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Erster Teil des Game-Cleanup
This commit is contained in:
parent
4dbc8439a2
commit
6e1348ca8b
16 changed files with 96 additions and 201 deletions
|
@ -418,7 +418,6 @@ qboolean FindTarget (edict_t *self)
|
|||
return false;
|
||||
}
|
||||
|
||||
//FIXME look for monsters?
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -426,12 +425,12 @@ qboolean FindTarget (edict_t *self)
|
|||
if (self->monsterinfo.aiflags & AI_COMBAT_POINT)
|
||||
return false;
|
||||
|
||||
// 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
|
||||
// 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
|
||||
|
||||
// revised behavior so they will wake up if they "see" a player make a noise
|
||||
// but not weapon impact/explosion noises
|
||||
// revised behavior so they will wake up if they "see" a player make a noise
|
||||
// but not weapon impact/explosion noises
|
||||
|
||||
heardit = false;
|
||||
if ((level.sight_entity_framenum >= (level.framenum - 1)) && !(self->spawnflags & 1) )
|
||||
|
@ -493,8 +492,6 @@ qboolean FindTarget (edict_t *self)
|
|||
if (r == RANGE_FAR)
|
||||
return false;
|
||||
|
||||
// this is where we would check invisibility
|
||||
|
||||
// is client in an spot too dark to be seen?
|
||||
if (client->light_level <= 5)
|
||||
return false;
|
||||
|
@ -571,9 +568,9 @@ qboolean FindTarget (edict_t *self)
|
|||
self->enemy = client;
|
||||
}
|
||||
|
||||
//
|
||||
// got one
|
||||
//
|
||||
//
|
||||
// got one
|
||||
//
|
||||
FoundTarget (self);
|
||||
|
||||
if (!(self->monsterinfo.aiflags & AI_SOUND_TARGET) && (self->monsterinfo.sight))
|
||||
|
@ -638,7 +635,7 @@ qboolean M_CheckAttack (edict_t *self)
|
|||
return true;
|
||||
}
|
||||
|
||||
// missile attack
|
||||
// missile attack
|
||||
if (!self->monsterinfo.attack)
|
||||
return false;
|
||||
|
||||
|
@ -803,7 +800,7 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
|
||||
enemy_vis = false;
|
||||
|
||||
// see if the enemy is dead
|
||||
// see if the enemy is dead
|
||||
hesDeadJim = false;
|
||||
if ((!self->enemy) || (!self->enemy->inuse))
|
||||
{
|
||||
|
@ -834,7 +831,7 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
if (hesDeadJim)
|
||||
{
|
||||
self->enemy = NULL;
|
||||
// FIXME: look all around for other targets
|
||||
// FIXME: look all around for other targets
|
||||
if (self->oldenemy && self->oldenemy->health > 0)
|
||||
{
|
||||
self->enemy = self->oldenemy;
|
||||
|
@ -863,7 +860,7 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
|
||||
self->show_hostile = level.time + 1; // wake up other monsters
|
||||
|
||||
// check knowledge of enemy
|
||||
// check knowledge of enemy
|
||||
enemy_vis = visible(self, self->enemy);
|
||||
if (enemy_vis)
|
||||
{
|
||||
|
@ -871,12 +868,11 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
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;
|
||||
// }
|
||||
if (coop && self->monsterinfo.search_time < level.time)
|
||||
{
|
||||
if (FindTarget (self))
|
||||
return true;
|
||||
}
|
||||
|
||||
enemy_infront = infront(self, self->enemy);
|
||||
enemy_range = range(self, self->enemy);
|
||||
|
@ -884,8 +880,6 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
enemy_yaw = vectoyaw(temp);
|
||||
|
||||
|
||||
// JDC self->ideal_yaw = enemy_yaw;
|
||||
|
||||
if (self->monsterinfo.attack_state == AS_MISSILE)
|
||||
{
|
||||
ai_run_missile (self);
|
||||
|
@ -904,7 +898,6 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
return self->monsterinfo.checkattack (self);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
ai_run
|
||||
|
@ -959,8 +952,6 @@ void ai_run (edict_t *self, float dist)
|
|||
|
||||
if (enemy_vis)
|
||||
{
|
||||
// if (self.aiflags & AI_LOST_SIGHT)
|
||||
// dprint("regained sight\n");
|
||||
M_MoveToGoal (self, dist);
|
||||
self->monsterinfo.aiflags &= ~AI_LOST_SIGHT;
|
||||
VectorCopy (self->enemy->s.origin, self->monsterinfo.last_sighting);
|
||||
|
@ -968,18 +959,10 @@ void ai_run (edict_t *self, float dist)
|
|||
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)))
|
||||
{
|
||||
M_MoveToGoal (self, dist);
|
||||
self->monsterinfo.search_time = 0;
|
||||
// dprint("search timeout\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -992,7 +975,6 @@ void ai_run (edict_t *self, float dist)
|
|||
if (!(self->monsterinfo.aiflags & AI_LOST_SIGHT))
|
||||
{
|
||||
// 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_PURSUE_NEXT | AI_PURSUE_TEMP);
|
||||
new = true;
|
||||
|
@ -1001,14 +983,12 @@ void ai_run (edict_t *self, float dist)
|
|||
if (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
|
||||
self->monsterinfo.search_time = level.time + 5;
|
||||
|
||||
if (self->monsterinfo.aiflags & AI_PURSUE_TEMP)
|
||||
{
|
||||
// dprint("was temp goal; retrying original\n");
|
||||
self->monsterinfo.aiflags &= ~AI_PURSUE_TEMP;
|
||||
marker = NULL;
|
||||
VectorCopy (self->monsterinfo.saved_goal, self->monsterinfo.last_sighting);
|
||||
|
@ -1029,9 +1009,6 @@ void ai_run (edict_t *self, float dist)
|
|||
VectorCopy (marker->s.origin, self->monsterinfo.last_sighting);
|
||||
self->monsterinfo.trail_time = marker->timestamp;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -1048,8 +1025,6 @@ void ai_run (edict_t *self, float dist)
|
|||
|
||||
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);
|
||||
if (tr.fraction < 1)
|
||||
{
|
||||
|
@ -1077,7 +1052,6 @@ void ai_run (edict_t *self, float dist)
|
|||
{
|
||||
VectorSet(v, d2 * left * 0.5, -16, 0);
|
||||
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);
|
||||
self->monsterinfo.aiflags |= AI_PURSUE_TEMP;
|
||||
|
@ -1085,8 +1059,6 @@ void ai_run (edict_t *self, float dist)
|
|||
VectorCopy (left_target, self->monsterinfo.last_sighting);
|
||||
VectorSubtract (self->goalentity->s.origin, self->s.origin, 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)
|
||||
{
|
||||
|
@ -1094,7 +1066,6 @@ void ai_run (edict_t *self, float dist)
|
|||
{
|
||||
VectorSet(v, d2 * right * 0.5, 16, 0);
|
||||
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);
|
||||
self->monsterinfo.aiflags |= AI_PURSUE_TEMP;
|
||||
|
@ -1102,11 +1073,8 @@ void ai_run (edict_t *self, float dist)
|
|||
VectorCopy (right_target, self->monsterinfo.last_sighting);
|
||||
VectorSubtract (self->goalentity->s.origin, self->s.origin, 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);
|
||||
|
@ -1116,3 +1084,4 @@ void ai_run (edict_t *self, float dist)
|
|||
if (self)
|
||||
self->goalentity = save;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ char *ClientTeam (edict_t *ent)
|
|||
return value;
|
||||
}
|
||||
|
||||
// if ((int)(dmflags->value) & DF_SKINTEAMS)
|
||||
return ++p;
|
||||
}
|
||||
|
||||
|
@ -991,3 +990,4 @@ void ClientCommand (edict_t *ent)
|
|||
else // anything that doesn't match a command will be a chat
|
||||
Cmd_Say_f (ent, false, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ qboolean CanDamage (edict_t *targ, edict_t *inflictor)
|
|||
vec3_t dest;
|
||||
trace_t trace;
|
||||
|
||||
// bmodels need special checking because their origin is 0,0,0
|
||||
// bmodels need special checking because their origin is 0,0,0
|
||||
if (targ->movetype == MOVETYPE_PUSH)
|
||||
{
|
||||
VectorAdd (targ->absmin, targ->absmax, dest);
|
||||
|
@ -98,7 +98,6 @@ void Killed (edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, v
|
|||
|
||||
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))
|
||||
{
|
||||
level.killed_monsters++;
|
||||
|
@ -137,7 +136,6 @@ void SpawnDamage (int type, vec3_t origin, vec3_t normal, int damage)
|
|||
damage = 255;
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
gi.WriteByte (type);
|
||||
// gi.WriteByte (damage);
|
||||
gi.WritePosition (origin);
|
||||
gi.WriteDir (normal);
|
||||
gi.multicast (origin, MULTICAST_PVS);
|
||||
|
@ -419,14 +417,14 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
|
|||
|
||||
VectorNormalize(dir);
|
||||
|
||||
// bonus damage for suprising a monster
|
||||
// bonus damage for suprising a monster
|
||||
if (!(dflags & DAMAGE_RADIUS) && (targ->svflags & SVF_MONSTER) && (attacker->client) && (!targ->enemy) && (targ->health > 0))
|
||||
damage *= 2;
|
||||
|
||||
if (targ->flags & FL_NO_KNOCKBACK)
|
||||
knockback = 0;
|
||||
|
||||
// figure momentum add
|
||||
// figure momentum add
|
||||
if (!(dflags & DAMAGE_NO_KNOCKBACK))
|
||||
{
|
||||
if ((knockback) && (targ->movetype != MOVETYPE_NONE) && (targ->movetype != MOVETYPE_BOUNCE) && (targ->movetype != MOVETYPE_PUSH) && (targ->movetype != MOVETYPE_STOP))
|
||||
|
@ -484,7 +482,7 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
|
|||
if (!(dflags & DAMAGE_NO_PROTECTION) && CheckTeamDamage (targ, attacker))
|
||||
return;
|
||||
|
||||
// do the damage
|
||||
// do the damage
|
||||
if (take)
|
||||
{
|
||||
if ((targ->svflags & SVF_MONSTER) || (client))
|
||||
|
@ -575,3 +573,4 @@ void T_RadiusDamage (edict_t *inflictor, edict_t *attacker, float damage, edict_
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -453,9 +453,9 @@ void plat_spawn_inside_trigger (edict_t *ent)
|
|||
edict_t *trigger;
|
||||
vec3_t tmin, tmax;
|
||||
|
||||
//
|
||||
// middle trigger
|
||||
//
|
||||
//
|
||||
// middle trigger
|
||||
//
|
||||
trigger = G_Spawn();
|
||||
trigger->touch = Touch_Plat_Center;
|
||||
trigger->movetype = MOVETYPE_NONE;
|
||||
|
@ -646,8 +646,6 @@ void SP_func_rotating (edict_t *ent)
|
|||
if (!ent->dmg)
|
||||
ent->dmg = 2;
|
||||
|
||||
// ent->moveinfo.sound_middle = "doors/hydro1.wav";
|
||||
|
||||
ent->use = rotating_use;
|
||||
if (ent->dmg)
|
||||
ent->blocked = rotating_blocked;
|
||||
|
@ -1093,8 +1091,8 @@ void door_blocked (edict_t *self, edict_t *other)
|
|||
return;
|
||||
|
||||
|
||||
// if a door has a negative wait, it would never come back if blocked,
|
||||
// so let it just squash the object to death real fast
|
||||
// if a door has a negative wait, it would never come back if blocked,
|
||||
// so let it just squash the object to death real fast
|
||||
if (self->moveinfo.wait >= 0)
|
||||
{
|
||||
if (self->moveinfo.state == STATE_DOWN)
|
||||
|
@ -1536,7 +1534,6 @@ void train_next (edict_t *self)
|
|||
again:
|
||||
if (!self->target)
|
||||
{
|
||||
// gi.dprintf ("train_next: no next target\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1702,7 +1699,6 @@ void trigger_elevator_use (edict_t *self, edict_t *other, edict_t *activator)
|
|||
|
||||
if (self->movetarget->nextthink)
|
||||
{
|
||||
// gi.dprintf("elevator busy\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -372,8 +372,6 @@ void Use_Breather (edict_t *ent, gitem_t *item)
|
|||
ent->client->breather_framenum += 300;
|
||||
else
|
||||
ent->client->breather_framenum = level.framenum + 300;
|
||||
|
||||
// gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
@ -387,8 +385,6 @@ void Use_Envirosuit (edict_t *ent, gitem_t *item)
|
|||
ent->client->enviro_framenum += 300;
|
||||
else
|
||||
ent->client->enviro_framenum = level.framenum + 300;
|
||||
|
||||
// gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
@ -413,8 +409,6 @@ void Use_Silencer (edict_t *ent, gitem_t *item)
|
|||
ent->client->pers.inventory[ITEM_INDEX(item)]--;
|
||||
ValidateSelectedItem (ent);
|
||||
ent->client->silencer_shots += 30;
|
||||
|
||||
// gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
@ -2188,8 +2182,6 @@ void InitItems (void)
|
|||
game.num_items = sizeof(itemlist)/sizeof(itemlist[0]) - 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
SetItemNames
|
||||
|
@ -2214,3 +2206,4 @@ void SetItemNames (void)
|
|||
power_screen_index = ITEM_INDEX(FindItem("Power Screen"));
|
||||
power_shield_index = ITEM_INDEX(FindItem("Power Shield"));
|
||||
}
|
||||
|
||||
|
|
|
@ -165,7 +165,6 @@ void Com_Printf (char *msg, ...)
|
|||
|
||||
gi.dprintf ("%s", text);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//======================================================================
|
||||
|
|
|
@ -630,7 +630,6 @@ void SP_func_wall (edict_t *self)
|
|||
// it must be TRIGGER_SPAWN
|
||||
if (!(self->spawnflags & 1))
|
||||
{
|
||||
// gi.dprintf("func_wall missing TRIGGER_SPAWN\n");
|
||||
self->spawnflags |= 1;
|
||||
}
|
||||
|
||||
|
@ -1870,7 +1869,6 @@ void SP_misc_teleporter_dest (edict_t *ent)
|
|||
gi.setmodel (ent, "models/objects/dmspot/tris.md2");
|
||||
ent->s.skinnum = 0;
|
||||
ent->solid = SOLID_BBOX;
|
||||
// ent->s.effects |= EF_FLIES;
|
||||
VectorSet (ent->mins, -32, -32, -24);
|
||||
VectorSet (ent->maxs, 32, 32, -16);
|
||||
gi.linkentity (ent);
|
||||
|
|
|
@ -152,7 +152,7 @@ void M_CheckGround (edict_t *ent)
|
|||
return;
|
||||
}
|
||||
|
||||
// if the hull point one-quarter unit down is solid the entity is on ground
|
||||
// if the hull point one-quarter unit down is solid the entity is on ground
|
||||
point[0] = ent->s.origin[0];
|
||||
point[1] = ent->s.origin[1];
|
||||
point[2] = ent->s.origin[2] - 0.25;
|
||||
|
@ -166,10 +166,6 @@ void M_CheckGround (edict_t *ent)
|
|||
return;
|
||||
}
|
||||
|
||||
// ent->groundentity = trace.ent;
|
||||
// ent->groundentity_linkcount = trace.ent->linkcount;
|
||||
// if (!trace.startsolid && !trace.allsolid)
|
||||
// VectorCopy (trace.endpos, ent->s.origin);
|
||||
if (!trace.startsolid && !trace.allsolid)
|
||||
{
|
||||
VectorCopy (trace.endpos, ent->s.origin);
|
||||
|
@ -185,9 +181,9 @@ void M_CatagorizePosition (edict_t *ent)
|
|||
vec3_t point;
|
||||
int cont;
|
||||
|
||||
//
|
||||
// get waterlevel
|
||||
//
|
||||
//
|
||||
// get waterlevel
|
||||
//
|
||||
point[0] = ent->s.origin[0];
|
||||
point[1] = ent->s.origin[1];
|
||||
point[2] = ent->s.origin[2] + ent->mins[2] + 1;
|
||||
|
@ -448,7 +444,7 @@ void monster_use (edict_t *self, edict_t *other, edict_t *activator)
|
|||
if (!(activator->client) && !(activator->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
return;
|
||||
|
||||
// delay reaction so if the monster is teleported, its sound is still heard
|
||||
// delay reaction so if the monster is teleported, its sound is still heard
|
||||
self->enemy = activator;
|
||||
FoundTarget (self);
|
||||
}
|
||||
|
@ -543,7 +539,6 @@ qboolean monster_start (edict_t *self)
|
|||
{
|
||||
self->spawnflags &= ~4;
|
||||
self->spawnflags |= 1;
|
||||
// gi.dprintf("fixed spawnflags on %s at %s\n", self->classname, vtos(self->s.origin));
|
||||
}
|
||||
|
||||
if (!(self->monsterinfo.aiflags & AI_GOOD_GUY))
|
||||
|
@ -738,3 +733,4 @@ void swimmonster_start (edict_t *self)
|
|||
self->think = swimmonster_start_go;
|
||||
monster_start (self);
|
||||
}
|
||||
|
||||
|
|
|
@ -73,9 +73,9 @@ void SV_CheckVelocity (edict_t *ent)
|
|||
{
|
||||
int i;
|
||||
|
||||
//
|
||||
// bound velocity
|
||||
//
|
||||
//
|
||||
// bound velocity
|
||||
//
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
if (ent->velocity[i] > sv_maxvelocity->value)
|
||||
|
@ -120,7 +120,6 @@ Two entities have touched, so run their touch functions
|
|||
void SV_Impact (edict_t *e1, trace_t *trace)
|
||||
{
|
||||
edict_t *e2;
|
||||
// cplane_t backplane;
|
||||
|
||||
e2 = trace->ent;
|
||||
|
||||
|
@ -244,9 +243,9 @@ int SV_FlyMove (edict_t *ent, float time, int mask)
|
|||
blocked |= 2; // step
|
||||
}
|
||||
|
||||
//
|
||||
// run the impact function
|
||||
//
|
||||
//
|
||||
// run the impact function
|
||||
//
|
||||
SV_Impact (ent, &trace);
|
||||
if (!ent->inuse)
|
||||
break; // removed by the impact function
|
||||
|
@ -254,7 +253,7 @@ int SV_FlyMove (edict_t *ent, float time, int mask)
|
|||
|
||||
time_left -= time_left * trace.fraction;
|
||||
|
||||
// cliped to another plane
|
||||
// cliped to another plane
|
||||
if (numplanes >= MAX_CLIP_PLANES)
|
||||
{ // this shouldn't really happen
|
||||
VectorCopy (vec3_origin, ent->velocity);
|
||||
|
@ -264,9 +263,9 @@ int SV_FlyMove (edict_t *ent, float time, int mask)
|
|||
VectorCopy (trace.plane.normal, planes[numplanes]);
|
||||
numplanes++;
|
||||
|
||||
//
|
||||
// modify original_velocity so it parallels all of the clip planes
|
||||
//
|
||||
//
|
||||
// modify original_velocity so it parallels all of the clip planes
|
||||
//
|
||||
for (i=0 ; i<numplanes ; i++)
|
||||
{
|
||||
ClipVelocity (original_velocity, planes[i], new_velocity, 1);
|
||||
|
@ -289,7 +288,6 @@ int SV_FlyMove (edict_t *ent, float time, int mask)
|
|||
{ // go along the crease
|
||||
if (numplanes != 2)
|
||||
{
|
||||
// gi.dprintf ("clip velocity, numplanes == %i\n",numplanes);
|
||||
VectorCopy (vec3_origin, ent->velocity);
|
||||
return 7;
|
||||
}
|
||||
|
@ -298,10 +296,10 @@ int SV_FlyMove (edict_t *ent, float time, int mask)
|
|||
VectorScale (dir, d, ent->velocity);
|
||||
}
|
||||
|
||||
//
|
||||
// if original velocity is against the original velocity, stop dead
|
||||
// to avoid tiny occilations in sloping corners
|
||||
//
|
||||
//
|
||||
// if original velocity is against the original velocity, stop dead
|
||||
// to avoid tiny occilations in sloping corners
|
||||
//
|
||||
if (DotProduct (ent->velocity, primal_velocity) <= 0)
|
||||
{
|
||||
VectorCopy (vec3_origin, ent->velocity);
|
||||
|
@ -428,11 +426,11 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
maxs[i] = pusher->absmax[i] + move[i];
|
||||
}
|
||||
|
||||
// we need this for pushing things later
|
||||
// we need this for pushing things later
|
||||
VectorSubtract (vec3_origin, amove, org);
|
||||
AngleVectors (org, forward, right, up);
|
||||
|
||||
// save the pusher's original position
|
||||
// save the pusher's original position
|
||||
pushed_p->ent = pusher;
|
||||
VectorCopy (pusher->s.origin, pushed_p->origin);
|
||||
VectorCopy (pusher->s.angles, pushed_p->angles);
|
||||
|
@ -440,12 +438,12 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
pushed_p->deltayaw = pusher->client->ps.pmove.delta_angles[YAW];
|
||||
pushed_p++;
|
||||
|
||||
// move the pusher to it's final position
|
||||
// move the pusher to it's final position
|
||||
VectorAdd (pusher->s.origin, move, pusher->s.origin);
|
||||
VectorAdd (pusher->s.angles, amove, pusher->s.angles);
|
||||
gi.linkentity (pusher);
|
||||
|
||||
// see if any solid entities are inside the final position
|
||||
// see if any solid entities are inside the final position
|
||||
check = g_edicts+1;
|
||||
for (e = 1; e < globals.num_edicts; e++, check++)
|
||||
{
|
||||
|
@ -460,7 +458,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
if (!check->area.prev)
|
||||
continue; // not linked in anywhere
|
||||
|
||||
// if the entity is standing on the pusher, it will definitely be moved
|
||||
// if the entity is standing on the pusher, it will definitely be moved
|
||||
if (check->groundentity != pusher)
|
||||
{
|
||||
// see if the ent needs to be tested
|
||||
|
@ -543,7 +541,6 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove)
|
|||
return false;
|
||||
}
|
||||
|
||||
//FIXME: is there a better way to handle this?
|
||||
// see if anything we moved has touched a trigger
|
||||
for (p=pushed_p-1 ; p>=pushed ; p--)
|
||||
G_TouchTriggers (p->ent);
|
||||
|
@ -571,7 +568,6 @@ void SV_Physics_Pusher (edict_t *ent)
|
|||
// 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
|
||||
//retry:
|
||||
pushed_p = pushed;
|
||||
for (part = ent ; part ; part=part->teamchain)
|
||||
{
|
||||
|
@ -602,11 +598,6 @@ void SV_Physics_Pusher (edict_t *ent)
|
|||
// otherwise, just stay in place until the obstacle is gone
|
||||
if (part->blocked)
|
||||
part->blocked (part, obstacle);
|
||||
#if 0
|
||||
// if the pushed entity went away and the pusher is still there
|
||||
if (!obstacle->inuse && part->inuse)
|
||||
goto retry;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -629,7 +620,7 @@ Non moving objects can only think
|
|||
*/
|
||||
void SV_Physics_None (edict_t *ent)
|
||||
{
|
||||
// regular thinking
|
||||
// regular thinking
|
||||
SV_RunThink (ent);
|
||||
}
|
||||
|
||||
|
@ -642,7 +633,7 @@ A moving object that doesn't obey physics
|
|||
*/
|
||||
void SV_Physics_Noclip (edict_t *ent)
|
||||
{
|
||||
// regular thinking
|
||||
// regular thinking
|
||||
if (!SV_RunThink (ent))
|
||||
return;
|
||||
|
||||
|
@ -677,7 +668,7 @@ void SV_Physics_Toss (edict_t *ent)
|
|||
qboolean isinwater;
|
||||
vec3_t old_origin;
|
||||
|
||||
// regular thinking
|
||||
// regular thinking
|
||||
SV_RunThink (ent);
|
||||
|
||||
// if not a team captain, so movement will be handled elsewhere
|
||||
|
@ -687,12 +678,12 @@ void SV_Physics_Toss (edict_t *ent)
|
|||
if (ent->velocity[2] > 0)
|
||||
ent->groundentity = NULL;
|
||||
|
||||
// check for the groundentity going away
|
||||
// check for the groundentity going away
|
||||
if (ent->groundentity)
|
||||
if (!ent->groundentity->inuse)
|
||||
ent->groundentity = NULL;
|
||||
|
||||
// if onground, return without moving
|
||||
// if onground, return without moving
|
||||
if ( ent->groundentity )
|
||||
return;
|
||||
|
||||
|
@ -700,15 +691,15 @@ void SV_Physics_Toss (edict_t *ent)
|
|||
|
||||
SV_CheckVelocity (ent);
|
||||
|
||||
// add gravity
|
||||
// add gravity
|
||||
if (ent->movetype != MOVETYPE_FLY
|
||||
&& ent->movetype != MOVETYPE_FLYMISSILE)
|
||||
SV_AddGravity (ent);
|
||||
|
||||
// move angles
|
||||
// move angles
|
||||
VectorMA (ent->s.angles, FRAMETIME, ent->avelocity, ent->s.angles);
|
||||
|
||||
// move origin
|
||||
// move origin
|
||||
VectorScale (ent->velocity, FRAMETIME, move);
|
||||
trace = SV_PushEntity (ent, move);
|
||||
if (!ent->inuse)
|
||||
|
@ -723,7 +714,7 @@ void SV_Physics_Toss (edict_t *ent)
|
|||
|
||||
ClipVelocity (ent->velocity, trace.plane.normal, ent->velocity, backoff);
|
||||
|
||||
// stop if on ground
|
||||
// stop if on ground
|
||||
if (trace.plane.normal[2] > 0.7)
|
||||
{
|
||||
if (ent->velocity[2] < 60 || ent->movetype != MOVETYPE_BOUNCE )
|
||||
|
@ -734,12 +725,9 @@ void SV_Physics_Toss (edict_t *ent)
|
|||
VectorCopy (vec3_origin, ent->avelocity);
|
||||
}
|
||||
}
|
||||
|
||||
// if (ent->touch)
|
||||
// ent->touch (ent, trace.ent, &trace.plane, trace.surface);
|
||||
}
|
||||
|
||||
// check for water transition
|
||||
// check for water transition
|
||||
wasinwater = (ent->watertype & MASK_WATER);
|
||||
ent->watertype = gi.pointcontents (ent->s.origin);
|
||||
isinwater = ent->watertype & MASK_WATER;
|
||||
|
@ -754,7 +742,7 @@ void SV_Physics_Toss (edict_t *ent)
|
|||
else if (wasinwater && !isinwater)
|
||||
gi.positioned_sound (ent->s.origin, g_edicts, CHAN_AUTO, gi.soundindex("misc/h2ohit1.wav"), 1, 1, 0);
|
||||
|
||||
// move teamslaves
|
||||
// move teamslaves
|
||||
for (slave = ent->teamchain; slave; slave = slave->teamchain)
|
||||
{
|
||||
VectorCopy (ent->s.origin, slave->s.origin);
|
||||
|
@ -918,7 +906,7 @@ void SV_Physics_Step (edict_t *ent)
|
|||
gi.sound (ent, 0, gi.soundindex("world/land.wav"), 1, 1, 0);
|
||||
}
|
||||
|
||||
// regular thinking
|
||||
// regular thinking
|
||||
SV_RunThink (ent);
|
||||
}
|
||||
|
||||
|
@ -959,3 +947,4 @@ void G_RunEntity (edict_t *ent)
|
|||
gi.error ("SV_Physics: bad movetype %i", (int)ent->movetype);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ field_t fields[] = {
|
|||
{"pausetime", STOFS(pausetime), F_FLOAT, FFL_SPAWNTEMP},
|
||||
{"item", STOFS(item), F_LSTRING, FFL_SPAWNTEMP},
|
||||
|
||||
//need for item field in edict struct, FFL_SPAWNTEMP item will be skipped on saves
|
||||
// need for item field in edict struct, FFL_SPAWNTEMP item will be skipped on saves
|
||||
{"item", FOFS(item), F_ITEM},
|
||||
|
||||
{"gravity", STOFS(gravity), F_LSTRING, FFL_SPAWNTEMP},
|
||||
|
@ -716,15 +716,7 @@ void ReadLevel (char *filename)
|
|||
|
||||
// check function pointer base address
|
||||
fread (&base, sizeof(base), 1, f);
|
||||
#ifdef _WIN32
|
||||
if (base != (void *)InitGame)
|
||||
{
|
||||
fclose (f);
|
||||
gi.error ("ReadLevel: function pointers have moved");
|
||||
}
|
||||
#else
|
||||
gi.dprintf("Function offsets %d\n", ((byte *)base) - ((byte *)InitGame));
|
||||
#endif
|
||||
|
||||
// load the level locals
|
||||
ReadLevelLocals (f);
|
||||
|
@ -774,3 +766,4 @@ void ReadLevel (char *filename)
|
|||
ent->nextthink = level.time + ent->delay;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -344,9 +344,6 @@ char *ED_NewString (char *string)
|
|||
return newb;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
ED_ParseField
|
||||
|
@ -422,10 +419,10 @@ char *ED_ParseEdict (char *data, edict_t *ent)
|
|||
init = false;
|
||||
memset (&st, 0, sizeof(st));
|
||||
|
||||
// go through all the dictionary pairs
|
||||
// go through all the dictionary pairs
|
||||
while (1)
|
||||
{
|
||||
// parse key
|
||||
// parse key
|
||||
com_token = COM_Parse (&data);
|
||||
if (com_token[0] == '}')
|
||||
break;
|
||||
|
@ -434,7 +431,7 @@ char *ED_ParseEdict (char *data, edict_t *ent)
|
|||
|
||||
strncpy (keyname, com_token, sizeof(keyname)-1);
|
||||
|
||||
// parse value
|
||||
// parse value
|
||||
com_token = COM_Parse (&data);
|
||||
if (!data)
|
||||
gi.error ("ED_ParseEntity: EOF without closing brace");
|
||||
|
@ -444,8 +441,8 @@ char *ED_ParseEdict (char *data, edict_t *ent)
|
|||
|
||||
init = true;
|
||||
|
||||
// keynames with a leading underscore are used for utility comments,
|
||||
// and are immediately discarded by quake
|
||||
// keynames with a leading underscore are used for utility comments,
|
||||
// and are immediately discarded by quake
|
||||
if (keyname[0] == '_')
|
||||
continue;
|
||||
|
||||
|
@ -552,7 +549,7 @@ void SpawnEntities (char *mapname, char *entities, char *spawnpoint)
|
|||
ent = NULL;
|
||||
inhibit = 0;
|
||||
|
||||
// parse ents
|
||||
// parse ents
|
||||
while (1)
|
||||
{
|
||||
// parse the opening brace
|
||||
|
@ -606,16 +603,6 @@ void SpawnEntities (char *mapname, char *entities, char *spawnpoint)
|
|||
|
||||
gi.dprintf ("%i entities inhibited\n", inhibit);
|
||||
|
||||
#ifdef DEBUG
|
||||
i = 1;
|
||||
ent = EDICT_NUM(i);
|
||||
while (i < globals.num_edicts) {
|
||||
if (ent->inuse != 0 || ent->inuse != 1)
|
||||
Com_DPrintf("Invalid entity %d\n", i);
|
||||
i++, ent++;
|
||||
}
|
||||
#endif
|
||||
|
||||
G_FindTeams ();
|
||||
|
||||
PlayerTrail_Init ();
|
||||
|
@ -624,29 +611,6 @@ void SpawnEntities (char *mapname, char *entities, char *spawnpoint)
|
|||
|
||||
//===================================================================
|
||||
|
||||
#if 0
|
||||
// cursor positioning
|
||||
xl <value>
|
||||
xr <value>
|
||||
yb <value>
|
||||
yt <value>
|
||||
xv <value>
|
||||
yv <value>
|
||||
|
||||
// drawing
|
||||
statpic <name>
|
||||
pic <stat>
|
||||
num <fieldwidth> <stat>
|
||||
string <stat>
|
||||
|
||||
// control
|
||||
if <stat>
|
||||
ifeq <stat> <value>
|
||||
ifbit <stat> <value>
|
||||
endif
|
||||
|
||||
#endif
|
||||
|
||||
char *single_statusbar =
|
||||
"yb -24 "
|
||||
|
||||
|
@ -938,9 +902,9 @@ void SP_worldspawn (edict_t *ent)
|
|||
gi.modelindex ("models/objects/gibs/skull/tris.md2");
|
||||
gi.modelindex ("models/objects/gibs/head2/tris.md2");
|
||||
|
||||
//
|
||||
// Setup light animation tables. 'a' is total darkness, 'z' is doublebright.
|
||||
//
|
||||
//
|
||||
// Setup light animation tables. 'a' is total darkness, 'z' is doublebright.
|
||||
//
|
||||
|
||||
// 0 normal
|
||||
gi.configstring(CS_LIGHTS+0, "m");
|
||||
|
|
|
@ -807,3 +807,4 @@ void SP_target_earthquake (edict_t *self)
|
|||
|
||||
self->noise_index = gi.soundindex ("world/quake.wav");
|
||||
}
|
||||
|
||||
|
|
|
@ -572,7 +572,7 @@ void trigger_monsterjump_touch (edict_t *self, edict_t *other, cplane_t *plane,
|
|||
if ( !(other->svflags & SVF_MONSTER))
|
||||
return;
|
||||
|
||||
// set XY even if not on ground, so the jump will clear lips
|
||||
// set XY even if not on ground, so the jump will clear lips
|
||||
other->velocity[0] = self->movedir[0] * self->speed;
|
||||
other->velocity[1] = self->movedir[1] * self->speed;
|
||||
|
||||
|
|
|
@ -430,3 +430,4 @@ void SP_turret_driver (edict_t *self)
|
|||
|
||||
gi.linkentity (self);
|
||||
}
|
||||
|
||||
|
|
|
@ -174,9 +174,9 @@ void G_UseTargets (edict_t *ent, edict_t *activator)
|
|||
{
|
||||
edict_t *t;
|
||||
|
||||
//
|
||||
// check for a delay
|
||||
//
|
||||
//
|
||||
// check for a delay
|
||||
//
|
||||
if (ent->delay)
|
||||
{
|
||||
// create a temp object to fire at a later time
|
||||
|
@ -194,9 +194,9 @@ void G_UseTargets (edict_t *ent, edict_t *activator)
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// print the message
|
||||
//
|
||||
//
|
||||
// print the message
|
||||
//
|
||||
if ((ent->message) && !(activator->svflags & SVF_MONSTER))
|
||||
{
|
||||
gi.centerprintf (activator, "%s", ent->message);
|
||||
|
@ -206,9 +206,9 @@ void G_UseTargets (edict_t *ent, edict_t *activator)
|
|||
gi.sound (activator, CHAN_AUTO, gi.soundindex ("misc/talk1.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
//
|
||||
// kill killtargets
|
||||
//
|
||||
//
|
||||
// kill killtargets
|
||||
//
|
||||
if (ent->killtarget)
|
||||
{
|
||||
t = NULL;
|
||||
|
@ -223,9 +223,9 @@ void G_UseTargets (edict_t *ent, edict_t *activator)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// fire targets
|
||||
//
|
||||
//
|
||||
// fire targets
|
||||
//
|
||||
if (ent->target)
|
||||
{
|
||||
t = NULL;
|
||||
|
@ -455,7 +455,6 @@ void G_FreeEdict (edict_t *ed)
|
|||
|
||||
if ((ed - g_edicts) <= (maxclients->value + BODY_QUEUE_SIZE))
|
||||
{
|
||||
// gi.dprintf("tried to free special edict\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -527,9 +526,6 @@ void G_TouchSolids (edict_t *ent)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
|
@ -566,3 +562,4 @@ qboolean KillBox (edict_t *ent)
|
|||
|
||||
return true; // all clear
|
||||
}
|
||||
|
||||
|
|
|
@ -699,7 +699,6 @@ void fire_rail (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick
|
|||
gi.WritePosition (start);
|
||||
gi.WritePosition (tr.endpos);
|
||||
gi.multicast (self->s.origin, MULTICAST_PHS);
|
||||
// gi.multicast (start, MULTICAST_PHS);
|
||||
if (water)
|
||||
{
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
|
@ -915,3 +914,4 @@ void fire_bfg (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, f
|
|||
|
||||
gi.linkentity (bfg);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue