mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-21 11:21:18 +00:00
MOVETYPE_PUSH fix by Lord Havoc/Maddes (already present in 'newtree')
This commit is contained in:
parent
06604be734
commit
d4c5f6ead0
3 changed files with 29 additions and 8 deletions
|
@ -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 ];
|
||||
|
||||
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);
|
||||
if (size[0] < 3)
|
||||
|
|
|
@ -462,6 +462,7 @@ SV_Push ( edict_t *pusher, vec3_t move )
|
|||
int num_moved;
|
||||
edict_t *moved_edict[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++)
|
||||
{
|
||||
|
@ -488,9 +489,12 @@ SV_Push ( edict_t *pusher, vec3_t move )
|
|||
|| check->v.movetype == MOVETYPE_NOCLIP)
|
||||
continue;
|
||||
|
||||
// Don't assume SOLID_BSP ! --KB
|
||||
solid_save = pusher->v.solid;
|
||||
pusher->v.solid = SOLID_NOT;
|
||||
block = SV_TestEntityPosition (check);
|
||||
pusher->v.solid = SOLID_BSP;
|
||||
// pusher->v.solid = SOLID_BSP;
|
||||
pusher->v.solid = solid_save;
|
||||
if (block)
|
||||
{
|
||||
// Con_Printf ("blocked.. %i\n", block);
|
||||
|
|
|
@ -467,6 +467,7 @@ SV_PushMove ( edict_t *pusher, float movetime )
|
|||
int num_moved;
|
||||
edict_t *moved_edict[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])
|
||||
{
|
||||
|
@ -531,13 +532,29 @@ SV_PushMove ( edict_t *pusher, float movetime )
|
|||
moved_edict[num_moved] = check;
|
||||
num_moved++;
|
||||
|
||||
// try moving the contacted entity
|
||||
pusher->v.solid = SOLID_NOT;
|
||||
SV_PushEntity (check, move);
|
||||
pusher->v.solid = SOLID_BSP;
|
||||
// 1999-10-07 MOVETYPE_PUSH fix by Lord Havoc/Maddes start
|
||||
solid_backup = pusher->v.solid;
|
||||
if ( solid_backup == SOLID_BSP // everything that blocks: bsp models==map brushes==doors,plats,etc.
|
||||
|| 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)
|
||||
{ // fail the move
|
||||
if (check->v.mins[0] == check->v.maxs[0])
|
||||
|
|
Loading…
Reference in a new issue