mirror of
https://github.com/nzp-team/glquake.git
synced 2024-11-26 05:50:51 +00:00
Add sB's re-enabled Zombie Hacks
This commit is contained in:
parent
ecff804936
commit
ac56f0b765
3 changed files with 18 additions and 12 deletions
|
@ -136,6 +136,7 @@ typedef struct client_s
|
|||
#define SOLID_BBOX 2 // touch on edge, block
|
||||
#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground
|
||||
#define SOLID_BSP 4 // bsp clip, touch on edge, block
|
||||
#define SOLID_CORPSE 5 // bsp clip, touch on edge, block
|
||||
|
||||
// edict->deadflag values
|
||||
#define DEAD_NO 0
|
||||
|
|
|
@ -135,7 +135,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
if (dz < 30)
|
||||
neworg[2] += 8;
|
||||
}
|
||||
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, neworg, false, ent);
|
||||
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, neworg, MOVE_NOMONSTERS, ent); //sB fixing zombies, was FALSE thanks blubs
|
||||
|
||||
if (trace.fraction == 1)
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
VectorCopy (neworg, end);
|
||||
end[2] -= STEPSIZE*2;
|
||||
|
||||
trace = SV_Move (neworg, ent->v.mins, ent->v.maxs, end, false, ent);
|
||||
trace = SV_Move (neworg, ent->v.mins, ent->v.maxs, end, MOVE_NOMONSTERS, ent); //sB see above
|
||||
|
||||
if (trace.allsolid)
|
||||
return false;
|
||||
|
@ -168,7 +168,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
|||
if (trace.startsolid)
|
||||
{
|
||||
neworg[2] -= STEPSIZE;
|
||||
trace = SV_Move (neworg, ent->v.mins, ent->v.maxs, end, false, ent);
|
||||
trace = SV_Move (neworg, ent->v.mins, ent->v.maxs, end, MOVE_NOMONSTERS, ent); //sB
|
||||
if (trace.allsolid || trace.startsolid)
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
|
|||
for (i=0 ; i<3 ; i++)
|
||||
end[i] = ent->v.origin[i] + time_left * ent->v.velocity[i];
|
||||
|
||||
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, end, false, ent);
|
||||
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, end, MOVE_NOMONSTERS, ent);//Editted by blubs, we do want to ignore monsters in the trace
|
||||
|
||||
if (trace.allsolid)
|
||||
{ // entity is trapped in another solid
|
||||
|
@ -1254,7 +1254,7 @@ void SV_CheckStuck_IgnoreMonsters (edict_t *ent)
|
|||
void SV_PushAwayZombies(edict_t *ent)
|
||||
{
|
||||
edict_t *other_ent;
|
||||
float rad = 23;//approx. length of bbox corner
|
||||
float rad = 64;//approx. length of bbox corner
|
||||
float *org = ent->v.origin;
|
||||
vec3_t eorg;
|
||||
int i, j;
|
||||
|
@ -1262,24 +1262,29 @@ void SV_PushAwayZombies(edict_t *ent)
|
|||
other_ent = NEXT_EDICT(sv.edicts);
|
||||
for (i=1 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(other_ent))
|
||||
{
|
||||
if (other_ent->free)
|
||||
continue;
|
||||
//if (other_ent->free)
|
||||
//continue;
|
||||
//if (ent->v.solid == SOLID_NOT)
|
||||
// continue;
|
||||
if( other_ent->v.solid != SOLID_SLIDEBOX)
|
||||
if( other_ent->v.solid != SOLID_CORPSE)
|
||||
continue;
|
||||
if( other_ent->v.movetype != MOVETYPE_WALK)
|
||||
continue;
|
||||
for (j=0 ; j<3 ; j++)
|
||||
eorg[j] = org[j] - (other_ent->v.origin[j] + (other_ent->v.mins[j] + other_ent->v.maxs[j])*0.5);
|
||||
if (Length(eorg) > rad)
|
||||
{
|
||||
Con_Printf ("Length Greater than bbox corner. \n");
|
||||
continue;
|
||||
|
||||
}
|
||||
//Process nearby zombie
|
||||
for(j = 0; j < 2; j++)//only x & y
|
||||
other_ent->v.velocity[j] += (other_ent->v.origin[j] - ent->v.origin[j]) * 0.001;//push away other zombie
|
||||
{
|
||||
Con_Printf ("Pushing Zombie \n");
|
||||
other_ent->v.velocity[j] += (other_ent->v.origin[j] - ent->v.origin[j]) * 0.01;//push away other zombie was 0.001
|
||||
//ent->v.velocity[j] += (ent->v.origin[j] - other_ent->v.origin[j]) * 0.01;//push away self
|
||||
}
|
||||
}
|
||||
}
|
||||
//=============================
|
||||
|
||||
|
@ -1299,7 +1304,7 @@ void SV_Physics_Walk(edict_t *ent)
|
|||
VectorCopy(ent->v.mins,old_mins);
|
||||
VectorCopy(ent->v.maxs,old_maxs);
|
||||
|
||||
//'-16,-16,-32', '16,16,40'
|
||||
//'-16,-16,-32', '16,16,40' sB reenabled PushAwayZombies
|
||||
ent->v.mins[0] = -16; ent->v.mins[1] = -16; ent->v.mins[2] = -32;
|
||||
ent->v.maxs[0] = 16; ent->v.maxs[1] = 16; ent->v.maxs[2] = 40;
|
||||
|
||||
|
|
Loading…
Reference in a new issue