mirror of
https://github.com/nzp-team/glquake.git
synced 2024-11-22 12:01:11 +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_BBOX 2 // touch on edge, block
|
||||||
#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground
|
#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground
|
||||||
#define SOLID_BSP 4 // bsp clip, touch on edge, block
|
#define SOLID_BSP 4 // bsp clip, touch on edge, block
|
||||||
|
#define SOLID_CORPSE 5 // bsp clip, touch on edge, block
|
||||||
|
|
||||||
// edict->deadflag values
|
// edict->deadflag values
|
||||||
#define DEAD_NO 0
|
#define DEAD_NO 0
|
||||||
|
|
|
@ -135,7 +135,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
||||||
if (dz < 30)
|
if (dz < 30)
|
||||||
neworg[2] += 8;
|
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)
|
if (trace.fraction == 1)
|
||||||
{
|
{
|
||||||
|
@ -160,7 +160,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
||||||
VectorCopy (neworg, end);
|
VectorCopy (neworg, end);
|
||||||
end[2] -= STEPSIZE*2;
|
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)
|
if (trace.allsolid)
|
||||||
return false;
|
return false;
|
||||||
|
@ -168,7 +168,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
|
||||||
if (trace.startsolid)
|
if (trace.startsolid)
|
||||||
{
|
{
|
||||||
neworg[2] -= STEPSIZE;
|
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)
|
if (trace.allsolid || trace.startsolid)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,7 +257,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
|
||||||
for (i=0 ; i<3 ; i++)
|
for (i=0 ; i<3 ; i++)
|
||||||
end[i] = ent->v.origin[i] + time_left * ent->v.velocity[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)
|
if (trace.allsolid)
|
||||||
{ // entity is trapped in another solid
|
{ // entity is trapped in another solid
|
||||||
|
@ -1254,31 +1254,36 @@ void SV_CheckStuck_IgnoreMonsters (edict_t *ent)
|
||||||
void SV_PushAwayZombies(edict_t *ent)
|
void SV_PushAwayZombies(edict_t *ent)
|
||||||
{
|
{
|
||||||
edict_t *other_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;
|
float *org = ent->v.origin;
|
||||||
vec3_t eorg;
|
vec3_t eorg;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
other_ent = NEXT_EDICT(sv.edicts);
|
other_ent = NEXT_EDICT(sv.edicts);
|
||||||
for (i=1 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(other_ent))
|
for (i=1 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(other_ent))
|
||||||
{
|
{
|
||||||
if (other_ent->free)
|
//if (other_ent->free)
|
||||||
continue;
|
//continue;
|
||||||
//if (ent->v.solid == SOLID_NOT)
|
//if (ent->v.solid == SOLID_NOT)
|
||||||
// continue;
|
// continue;
|
||||||
if( other_ent->v.solid != SOLID_SLIDEBOX)
|
if( other_ent->v.solid != SOLID_CORPSE)
|
||||||
continue;
|
continue;
|
||||||
if( other_ent->v.movetype != MOVETYPE_WALK)
|
if( other_ent->v.movetype != MOVETYPE_WALK)
|
||||||
continue;
|
continue;
|
||||||
for (j=0 ; j<3 ; j++)
|
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);
|
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)
|
if (Length(eorg) > rad)
|
||||||
|
{
|
||||||
|
Con_Printf ("Length Greater than bbox corner. \n");
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
//Process nearby zombie
|
//Process nearby zombie
|
||||||
for(j = 0; j < 2; j++)//only x & y
|
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
|
//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.mins,old_mins);
|
||||||
VectorCopy(ent->v.maxs,old_maxs);
|
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.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;
|
ent->v.maxs[0] = 16; ent->v.maxs[1] = 16; ent->v.maxs[2] = 40;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue