- floatified playerisdead

This commit is contained in:
Christoph Oelckers 2022-09-14 21:25:27 +02:00
parent 4ded343aa5
commit 583a5bd0e3
4 changed files with 7 additions and 7 deletions

View file

@ -115,7 +115,7 @@ int wakeup(DDukeActor* sn, int pn);
int timedexit(int snum);
void dokneeattack(int snum, const std::initializer_list<int>& respawnlist);
int endoflevel(int snum);
void playerisdead(int snum, int psectlotag, int fz, int cz);
void playerisdead(int snum, int psectlotag, double fz, double cz);
void footprints(int snum);
int makepainsounds(int snum, int type);
void playerCrouch(int snum);

View file

@ -546,7 +546,7 @@ inline void backupplayer(player_struct* p)
p->horizon.backup();
}
void playerisdead(int snum, int psectlotag, int fz, int cz)
void playerisdead(int snum, int psectlotag, double floorz, double ceilingz)
{
auto p = &ps[snum];
auto actor = p->GetActor();
@ -604,7 +604,7 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
{
if (p->on_warping_sector == 0)
{
if (abs(p->pos.Z - fz * inttoworld) > (gs.playerheight * 0.5))
if (abs(p->pos.Z - floorz) > (gs.playerheight * 0.5))
p->pos.Z += 348/ 256.;
}
else
@ -625,8 +625,8 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
pushmove(p->pos, &p->cursector, 128, (4 << 8), (20 << 8), CLIPMASK0);
if (fz > cz + (16 << 8) && actor->spr.pal != 1)
p->angle.rotscrnang = DAngle::fromBuild(p->dead_flag + ((fz + p->player_int_pos().Z) >> 7));
if (floorz > ceilingz + 16 && actor->spr.pal != 1)
p->angle.rotscrnang = DAngle::fromBuild(p->dead_flag + ((floorz + p->pos.Z) * 2));
p->on_warping_sector = 0;

View file

@ -2855,7 +2855,7 @@ void processinput_d(int snum)
if (pact->spr.extra <= 0 && !ud.god)
{
playerisdead(snum, psectlotag, fz, cz);
playerisdead(snum, psectlotag, fz * inttoworld, cz * inttoworld);
return;
}

View file

@ -3533,7 +3533,7 @@ void processinput_r(int snum)
if (pact->spr.extra <= 0 && !ud.god)
{
playerisdead(snum, psectlotag, fz, cz);
playerisdead(snum, psectlotag, fz * inttoworld, cz * inttoworld);
return;
}