diff --git a/source/server.h b/source/server.h index b555a57..2681754 100644 --- a/source/server.h +++ b/source/server.h @@ -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 diff --git a/source/sv_move.c b/source/sv_move.c index 837e440..7e24895 100644 --- a/source/sv_move.c +++ b/source/sv_move.c @@ -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; } diff --git a/source/sv_phys.c b/source/sv_phys.c index b3c7a98..7da5537 100644 --- a/source/sv_phys.c +++ b/source/sv_phys.c @@ -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,31 +1254,36 @@ 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; other_ent = NEXT_EDICT(sv.edicts); for (i=1 ; ifree) - 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;