Skip to content

Commit

Permalink
SV_PushMove: preserve pusher solid field instead of overwriting with …
Browse files Browse the repository at this point in the history
…SOLID_BSP.

Fix by LordHavoc/Maddes: https://www.quake-info-pool.net/q1/qfix.htm#movetype_push
Also see: andrei-drexler#342.
  • Loading branch information
andrei-drexler authored and sezero committed Oct 6, 2024
1 parent 5698237 commit 6a8b72e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Quake/sv_phys.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ void SV_PushMove (edict_t *pusher, float movetime)
edict_t *check, *block;
vec3_t mins, maxs, move;
vec3_t entorig, pushorig;
float solid_backup;
int num_moved;
edict_t **moved_edict; //johnfitz -- dynamically allocate
vec3_t *moved_from; //johnfitz -- dynamically allocate
Expand Down Expand Up @@ -507,9 +508,16 @@ void SV_PushMove (edict_t *pusher, float movetime)
num_moved++;

// try moving the contacted entity
pusher->v.solid = SOLID_NOT;
SV_PushEntity (check, move);
pusher->v.solid = SOLID_BSP;
// https://www.quake-info-pool.net/q1/qfix.htm#movetype_push
solid_backup = pusher->v.solid;
if (solid_backup == SOLID_BSP ||
solid_backup == SOLID_BBOX ||
solid_backup == SOLID_SLIDEBOX)
{
pusher->v.solid = SOLID_NOT;
SV_PushEntity (check, move);
pusher->v.solid = solid_backup;
}

// if it is still inside the pusher, block
block = SV_TestEntityPosition (check);
Expand Down

0 comments on commit 6a8b72e

Please sign in to comment.