- do the remaining clipmove calls.

This commit is contained in:
Christoph Oelckers 2021-11-26 16:41:49 +01:00
parent bdbb3b4004
commit ef6bc9db56
2 changed files with 28 additions and 10 deletions

View file

@ -132,7 +132,7 @@ short MultiClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist)
int x,y;
short ang;
int xvect, yvect;
int cursectnum = pp->cursectnum;
auto cursect = pp->cursector();
for (i = 0; i < sop->clipbox_num; i++)
{
@ -144,11 +144,12 @@ short MultiClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist)
yvect = sop->clipbox_vdist[i] * bsin(ang);
// move the box
ret = clipmove(&pos, &cursectnum, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER);
Collision coll;
clipmove(pos, &cursect, xvect, yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER, coll);
ASSERT(cursectnum >= 0);
ASSERT(cursect);
if (ret)
if (coll.type != kHitNone)
{
// attempt to move a bit when turning against a wall
//ang = NORM_ANGLE(ang + 1024);

View file

@ -1943,7 +1943,12 @@ void DoPlayerSlide(PLAYERp pp)
}
return;
}
clipmove(&pp->pos, &pp->cursectnum, pp->slide_xvect, pp->slide_yvect, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
Collision coll;
#pragma message(__FILE__ "remove workaround");
sectortype* cursect = pp->cursector();
clipmove(pp->pos, &cursect, pp->slide_xvect, pp->slide_yvect, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
pp->setcursector(cursect);
PlayerCheckValidMove(pp);
push_ret = pushmove(&pp->pos, &pp->cursectnum, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
if (push_ret < 0)
@ -2115,8 +2120,13 @@ void DoPlayerMove(PLAYERp pp)
save_cstat = sp->cstat;
RESET(sp->cstat, CSTAT_SPRITE_BLOCK);
updatesector(pp->posx, pp->posy, &pp->cursectnum);
clipmove(&pp->pos, &pp->cursectnum, pp->xvect, pp->yvect, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
Collision coll;
#pragma message(__FILE__ "remove workaround");
sectortype* cursect = pp->cursector();
updatesector(pp->posx, pp->posy, &cursect);
clipmove(pp->pos, &cursect, pp->xvect, pp->yvect, ((int)sp->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
pp->setcursector(cursect);
sp->cstat = save_cstat;
PlayerCheckValidMove(pp);
@ -2715,8 +2725,10 @@ void DoPlayerMoveVehicle(PLAYERp pp)
if (pp->sop->clipdist)
{
vec3_t clippos = { pp->posx, pp->posy, z };
int cm= clipmove(&clippos, &pp->cursectnum, pp->xvect, pp->yvect, (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER);
u->coll.setFromEngine(cm);
Collision coll;
#pragma message(__FILE__ "remove workaround");
sectortype* cursect = pp->cursector();
clipmove(clippos, &cursect, pp->xvect, pp->yvect, (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER, u->coll);
pp->pos.vec2 = clippos.vec2;
}
else
@ -4651,7 +4663,12 @@ void DoPlayerCurrent(PLAYERp pp)
}
return;
}
clipmove(&pp->pos, &pp->cursectnum, xvect, yvect, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
Collision coll;
#pragma message(__FILE__ "remove workaround");
sectortype* cursect = pp->cursector();
clipmove(pp->pos, &cursect, xvect, yvect, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
pp->setcursector(cursect);
PlayerCheckValidMove(pp);
pushmove(&pp->pos, &pp->cursectnum, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
if (push_ret < 0)