Skip to content

Commit

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

Fix by LadyHavoc/Maddes
(see https://www.quake-info-pool.net/q1/qfix.htm#movetype_push)
  • Loading branch information
andrei-drexler committed Oct 6, 2024
1 parent 38c2dc7 commit bbda318
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 @@ -437,6 +437,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 @@ -513,9 +514,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 bbda318

Please sign in to comment.