- handle 'zvel >' comparisons with constants.

This commit is contained in:
Christoph Oelckers 2022-09-01 01:08:54 +02:00
parent 7e8afd58da
commit 56e5388150
9 changed files with 18 additions and 18 deletions

View file

@ -2418,7 +2418,7 @@ void glasspieces(DDukeActor* actor)
makeitfall(actor);
if (actor->int_zvel() > 4096) actor->set_int_zvel(4096);
if (actor->float_zvel() > 16) actor->set_int_zvel(4096);
if (!actor->insector())
{
deletesprite(actor);
@ -4847,7 +4847,7 @@ void makeitfall(DDukeActor* actor)
if( actor->spr.pos.Z < actor->floorz - FOURSLEIGHT_F)
{
if( actor->sector()->lotag == 2 && actor->int_zvel() > 3122 )
if( actor->sector()->lotag == 2 && actor->float_zvel() > 3122/256.)
actor->set_int_zvel(3144);
if(actor->float_zvel() < 24)
actor->add_int_zvel( c);
@ -4985,7 +4985,7 @@ void alterang(int ang, DDukeActor* actor, int playernum)
aang = actor->int_ang();
actor->spr.xvel += (*moveptr - actor->spr.xvel) / 5;
if (actor->int_zvel() < 648) actor->add_int_zvel( ((*(moveptr + 1) << 4) - actor->int_zvel()) / 5);
if (actor->float_zvel() < (648/256.)) actor->add_int_zvel( ((*(moveptr + 1) << 4) - actor->int_zvel()) / 5);
if (isRRRA() && (ang & windang))
actor->set_int_ang(WindDir);
@ -5082,7 +5082,7 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
actor->add_int_zvel( c);
actor->spr.pos.Z += actor->float_zvel();
if (actor->int_zvel() > 6144) actor->set_int_zvel(6144);
if (actor->float_zvel() > 24) actor->set_int_zvel(6144);
}
else
{
@ -5091,7 +5091,7 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
if (badguy(actor) || (actor->isPlayer() && actor->GetOwner()))
{
if (actor->int_zvel() > 3084 && actor->spr.extra <= 1)
if (actor->float_zvel() > (3084/256.) && actor->spr.extra <= 1)
{
if (actor->spr.pal != 1 && actor->spr.picnum != DRONE)
{
@ -5116,7 +5116,7 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
actor->hitextra = 1;
actor->clear_zvel();
}
else if (actor->int_zvel() > 2048 && actor->sector()->lotag != 1)
else if (actor->float_zvel() > 8 && actor->sector()->lotag != 1)
{
auto sect = actor->sector();

View file

@ -773,7 +773,7 @@ void movefallers_d(void)
if (act->spr.pos.Z < sectp->floorz - 1)
{
act->add_int_zvel( x);
if (act->int_zvel() > 6144)
if (act->float_zvel() > 24)
act->set_int_zvel(6144);
act->add_int_z(act->int_zvel());
}
@ -1339,7 +1339,7 @@ static bool movefireball(DDukeActor* actor)
}
actor->temp_data[0]++;
}
if (actor->int_zvel() < 15000)
if (actor->float_zvel() < 15000./256.)
actor->add_int_zvel( 200);
return false;
}
@ -1593,7 +1593,7 @@ static void weaponcommon_d(DDukeActor* proj)
}
}
}
else if (proj->spr.picnum == SPIT) if (proj->int_zvel() < 6144)
else if (proj->spr.picnum == SPIT) if (proj->float_zvel() < 24)
proj->add_int_zvel( gs.gravity - 112);
if (coll.type != 0)
@ -2399,7 +2399,7 @@ static void greenslime(DDukeActor *actor)
actor->spr.picnum = GREENSLIME;
if (actor->spr.yrepeat < 40) actor->spr.yrepeat += 8;
if (actor->spr.xrepeat > 8) actor->spr.xrepeat -= 4;
if (actor->int_zvel() > -(2048 + 1024))
if (actor->float_zvel() > -12)
actor->add_int_zvel(- 348);
actor->spr.pos.Z += actor->float_zvel();
if (actor->spr.pos.Z < actor->ceilingz + 16)

View file

@ -691,7 +691,7 @@ void movefallers_r(void)
if (act->spr.pos.Z < sectp->floorz - 1)
{
act->add_int_zvel( x);
if (act->int_zvel() > 6144)
if (act->float_zvel() > 24)
act->set_int_zvel(6144);
act->add_int_z(act->int_zvel());
}
@ -1274,7 +1274,7 @@ static void weaponcommon_r(DDukeActor *proj)
}
}
}
else if (proj->spr.picnum == SPIT) if (proj->int_zvel() < 6144)
else if (proj->spr.picnum == SPIT) if (proj->float_zvel() < 24)
proj->add_int_zvel( gs.gravity - 112);
if (coll.type != 0)

View file

@ -301,7 +301,7 @@ void AIGrenade::Tick(RunListEvent* ev)
pActor->set_int_zvel(-(zVel >> 1));
if (pActor->int_zvel() > -1280)
if (pActor->float_zvel() > -5)
{
D3PlayFX(StaticSound[kSound5], pActor);
pActor->nCount = 0;

View file

@ -604,7 +604,7 @@ void Gravity(DExhumedActor* pActor)
else
{
pActor->add_int_zvel( 512);
if (pActor->int_zvel() > 16384) {
if (pActor->float_zvel() > 64) {
pActor->set_int_zvel(16384);
}
}

View file

@ -850,7 +850,7 @@ void AIPlayer::Tick(RunListEvent* ev)
int y = (sPlayerInput[nPlayer].yVel * 4) >> 2;
int z = (pPlayerActor->int_zvel() * 4) >> 2;
if (pPlayerActor->int_zvel() > 8192)
if (pPlayerActor->float_zvel() > 32)
pPlayerActor->set_int_zvel(8192);
if (PlayerList[nPlayer].bIsMummified)

View file

@ -799,7 +799,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
{
pActor->set_int_zvel(-(pActor->int_zvel() >> 1));
if (pActor->int_zvel() > -256)
if (pActor->float_zvel() > -1)
{
nVelShift = 100;
pActor->clear_zvel();

View file

@ -267,7 +267,7 @@ void AISet::Tick(RunListEvent* ev)
pushmove(pActor, &sect, pActor->spr.clipdist << 2, 5120, -5120, CLIPMASK0);
pActor->setsector(sect);
if (pActor->int_zvel() > 4000)
if (pActor->float_zvel() > 4000/256.)
{
if (nMov.exbits & kHitAux2)
{

View file

@ -16721,7 +16721,7 @@ int DoBubble(DSWActor* actor)
actor->spr.pos.Z -= actor->float_zvel();
actor->add_int_zvel( 32);
if (actor->int_zvel() > 768)
if (actor->float_zvel() > 3)
actor->set_int_zvel(768);
// notreallypos