MOVETYPE_PUSH fix by Lord Havoc/Maddes (already present in 'newtree')

This commit is contained in:
Maddes Buecher 2000-08-16 21:15:27 +00:00
parent 06604be734
commit d4c5f6ead0
3 changed files with 29 additions and 8 deletions

View file

@ -163,7 +163,7 @@ hull_t *SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
model = sv.models[ (int)ent->v.modelindex ]; model = sv.models[ (int)ent->v.modelindex ];
if (!model || model->type != mod_brush) if (!model || model->type != mod_brush)
SV_Error ("MOVETYPE_PUSH with a non bsp model"); SV_Error ("SOLID_BSP with a non bsp model"); // 1999-10-07 MOVETYPE_PUSH fix by Lord Havoc/Maddes
VectorSubtract (maxs, mins, size); VectorSubtract (maxs, mins, size);
if (size[0] < 3) if (size[0] < 3)

View file

@ -462,6 +462,7 @@ SV_Push ( edict_t *pusher, vec3_t move )
int num_moved; int num_moved;
edict_t *moved_edict[MAX_EDICTS]; edict_t *moved_edict[MAX_EDICTS];
vec3_t moved_from[MAX_EDICTS]; vec3_t moved_from[MAX_EDICTS];
float solid_save; // for Lord Havoc's SOLID_BSP fix --KB
for (i=0 ; i<3 ; i++) for (i=0 ; i<3 ; i++)
{ {
@ -488,9 +489,12 @@ SV_Push ( edict_t *pusher, vec3_t move )
|| check->v.movetype == MOVETYPE_NOCLIP) || check->v.movetype == MOVETYPE_NOCLIP)
continue; continue;
// Don't assume SOLID_BSP ! --KB
solid_save = pusher->v.solid;
pusher->v.solid = SOLID_NOT; pusher->v.solid = SOLID_NOT;
block = SV_TestEntityPosition (check); block = SV_TestEntityPosition (check);
pusher->v.solid = SOLID_BSP; // pusher->v.solid = SOLID_BSP;
pusher->v.solid = solid_save;
if (block) if (block)
{ {
// Con_Printf ("blocked.. %i\n", block); // Con_Printf ("blocked.. %i\n", block);

View file

@ -467,6 +467,7 @@ SV_PushMove ( edict_t *pusher, float movetime )
int num_moved; int num_moved;
edict_t *moved_edict[MAX_EDICTS]; edict_t *moved_edict[MAX_EDICTS];
vec3_t moved_from[MAX_EDICTS]; vec3_t moved_from[MAX_EDICTS];
float solid_backup; // 1999-10-07 MOVETYPE_PUSH fix by Lord Havoc/Maddes
if (!pusher->v.velocity[0] && !pusher->v.velocity[1] && !pusher->v.velocity[2]) if (!pusher->v.velocity[0] && !pusher->v.velocity[1] && !pusher->v.velocity[2])
{ {
@ -531,13 +532,29 @@ SV_PushMove ( edict_t *pusher, float movetime )
moved_edict[num_moved] = check; moved_edict[num_moved] = check;
num_moved++; num_moved++;
// try moving the contacted entity // 1999-10-07 MOVETYPE_PUSH fix by Lord Havoc/Maddes start
pusher->v.solid = SOLID_NOT; solid_backup = pusher->v.solid;
SV_PushEntity (check, move); if ( solid_backup == SOLID_BSP // everything that blocks: bsp models==map brushes==doors,plats,etc.
pusher->v.solid = SOLID_BSP; || solid_backup == SOLID_BBOX // normally boxes
|| solid_backup == SOLID_SLIDEBOX ) // normally monsters
{
// 1999-10-07 MOVETYPE_PUSH fix by Lord Havoc/Maddes end
// try moving the contacted entity
pusher->v.solid = SOLID_NOT;
SV_PushEntity (check, move);
// 1999-10-07 MOVETYPE_PUSH fix by Lord Havoc/Maddes start
// pusher->v.solid = SOLID_BSP;
pusher->v.solid = solid_backup;
// 1999-10-07 MOVETYPE_PUSH fix by Lord Havoc/Maddes end
// if it is still inside the pusher, block
block = SV_TestEntityPosition (check);
// 1999-10-07 MOVETYPE_PUSH fix by Lord Havoc/Maddes start
}
else
block = NULL;
// 1999-10-07 MOVETYPE_PUSH fix by Lord Havoc/Maddes end
// if it is still inside the pusher, block
block = SV_TestEntityPosition (check);
if (block) if (block)
{ // fail the move { // fail the move
if (check->v.mins[0] == check->v.maxs[0]) if (check->v.mins[0] == check->v.maxs[0])