- more zvel wrapping

This commit is contained in:
Christoph Oelckers 2022-08-31 23:55:21 +02:00
parent 3f7b423a4a
commit a9d96864d3
19 changed files with 115 additions and 115 deletions

View file

@ -490,7 +490,7 @@ void moveplayers(void)
act->spr.yrepeat = 36;
if (act->sector()->lotag != ST_2_UNDERWATER)
makeitfall(act);
if (act->spr.zvel == 0 && act->sector()->lotag == ST_1_ABOVE_WATER)
if (act->int_zvel() == 0 && act->sector()->lotag == ST_1_ABOVE_WATER)
act->spr.pos.Z += 32;
}
@ -1031,7 +1031,7 @@ void movewaterdrip(DDukeActor *actor, int drip)
ssp(actor, CLIPMASK0);
if (actor->spr.xvel > 0) actor->spr.xvel -= 2;
if (actor->spr.zvel == 0)
if (actor->int_zvel() == 0)
{
actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
@ -1324,7 +1324,7 @@ void movetongue(DDukeActor *actor, int tongue, int jaw)
auto q = EGS(actor->sector(),
actor->int_pos().X + MulScale(k, bcos(actor->int_ang()), 9),
actor->int_pos().Y + MulScale(k, bsin(actor->int_ang()), 9),
actor->int_pos().Z + ((k * Sgn(actor->spr.zvel)) * abs(actor->spr.zvel / 12)), tongue, -40 + (k << 1),
actor->int_pos().Z + ((k * Sgn(actor->int_zvel())) * abs(actor->spr.zvel / 12)), tongue, -40 + (k << 1),
8, 8, 0, 0, 0, actor, 5);
if (q)
{
@ -1336,7 +1336,7 @@ void movetongue(DDukeActor *actor, int tongue, int jaw)
auto spawned = EGS(actor->sector(),
actor->int_pos().X + MulScale(k, bcos(actor->int_ang()), 9),
actor->int_pos().Y + MulScale(k, bsin(actor->int_ang()), 9),
actor->int_pos().Z + ((k * Sgn(actor->spr.zvel)) * abs(actor->spr.zvel / 12)), jaw, -40,
actor->int_pos().Z + ((k * Sgn(actor->int_zvel())) * abs(actor->spr.zvel / 12)), jaw, -40,
32, 32, 0, 0, 0, actor, 5);
if (spawned)
{
@ -1365,7 +1365,7 @@ void rpgexplode(DDukeActor *actor, int hit, const DVector3 &pos, int EXPLOSION2,
}
else if (hit == kHitSector)
{
if (actor->spr.zvel > 0 && EXPLOSION2BOT >= 0)
if (actor->int_zvel() > 0 && EXPLOSION2BOT >= 0)
spawn(actor, EXPLOSION2BOT);
else
{
@ -1567,7 +1567,7 @@ void forcesphere(DDukeActor* actor, int forcesphere)
if (actor->temp_data[3] > 0)
{
if (actor->spr.zvel < 6144)
if (actor->int_zvel() < 6144)
actor->spr.zvel += 192;
actor->spr.pos.Z += actor->spr.zvel * inttoworld;
if (actor->spr.pos.Z > sectp->floorz)
@ -2101,11 +2101,11 @@ bool money(DDukeActor* actor, int BLOODPOOL)
{
if (sectp->lotag == 2)
{
if (actor->spr.zvel < 64)
if (actor->int_zvel() < 64)
actor->spr.zvel += (gs.gravity >> 5) + (krand() & 7);
}
else
if (actor->spr.zvel < 144)
if (actor->int_zvel() < 144)
actor->spr.zvel += (gs.gravity >> 5) + (krand() & 7);
}
@ -2166,7 +2166,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
}
}
if (actor->spr.zvel > 1024 && actor->spr.zvel < 1280)
if (actor->int_zvel() > 1024 && actor->int_zvel() < 1280)
{
SetActor(actor, actor->spr.pos);
sectp = actor->sector();
@ -2208,11 +2208,11 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
}
}
if (actor->spr.zvel < 6144)
if (actor->int_zvel() < 6144)
{
if (sectp->lotag == 2)
{
if (actor->spr.zvel < 1024)
if (actor->int_zvel() < 1024)
actor->spr.zvel += 48;
else actor->spr.zvel = 1024;
}
@ -2220,7 +2220,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
}
actor->add_int_pos({ MulScale(actor->spr.xvel, bcos(actor->int_ang()), 14), MulScale(actor->spr.xvel, bsin(actor->int_ang()), 14), 0 });
actor->add_int_z(actor->spr.zvel);
actor->add_int_z(actor->int_zvel());
if (floorcheck && actor->spr.pos.Z >= actor->sector()->floorz)
{
@ -2381,7 +2381,7 @@ void shell(DDukeActor* actor, bool morecheck)
actor->temp_data[0]++;
actor->temp_data[0] &= 3;
}
if (actor->spr.zvel < 128) actor->spr.zvel += (gs.gravity / 13); // 8
if (actor->int_zvel() < 128) actor->spr.zvel += (gs.gravity / 13); // 8
else actor->spr.zvel -= 64;
if (actor->spr.xvel > 0)
actor->spr.xvel -= 4;
@ -2396,7 +2396,7 @@ void shell(DDukeActor* actor, bool morecheck)
actor->temp_data[0]++;
actor->temp_data[0] &= 3;
}
if (actor->spr.zvel < 512) actor->spr.zvel += (gs.gravity / 3); // 52;
if (actor->int_zvel() < 512) actor->spr.zvel += (gs.gravity / 3); // 52;
if (actor->spr.xvel > 0)
actor->spr.xvel--;
else
@ -2418,7 +2418,7 @@ void glasspieces(DDukeActor* actor)
makeitfall(actor);
if (actor->spr.zvel > 4096) actor->spr.zvel = 4096;
if (actor->int_zvel() > 4096) actor->spr.zvel = 4096;
if (!actor->insector())
{
deletesprite(actor);
@ -2467,7 +2467,7 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6)
actor->spr.xvel--;
else actor->spr.xvel = 0;
if (actor->spr.zvel > 1024 && actor->spr.zvel < 1280)
if (actor->int_zvel() > 1024 && actor->int_zvel() < 1280)
{
SetActor(actor, actor->spr.pos);
sectp = actor->sector();
@ -2493,7 +2493,7 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6)
else actor->temp_data[0]++;
}
}
if (actor->spr.zvel < 4096) actor->spr.zvel += gs.gravity - 50;
if (actor->int_zvel() < 4096) actor->spr.zvel += gs.gravity - 50;
actor->add_int_pos({ MulScale(actor->spr.xvel, bcos(actor->int_ang()), 14), MulScale(actor->spr.xvel, bsin(actor->int_ang()), 14), actor->spr.zvel });
}
else
@ -3357,9 +3357,9 @@ void handle_se05(DDukeActor* actor, int FIRELASER)
}
}
actor->add_int_z(actor->spr.zvel);
sc->add_int_ceilingz(actor->spr.zvel);
sector[actor->temp_data[0]].add_int_ceilingz(actor->spr.zvel);
actor->add_int_z(actor->int_zvel());
sc->add_int_ceilingz(actor->int_zvel());
sector[actor->temp_data[0]].add_int_ceilingz(actor->int_zvel());
ms(actor);
//SetActor(actor, actor->spr.pos);
}
@ -3926,7 +3926,7 @@ void handle_se18(DDukeActor *actor, bool morecheck)
{
if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].pos.Z += extra;
}
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE)
if (a2->int_zvel() == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE)
{
a2->spr.pos.Z += extra;
a2->floorz = sc->floorz;
@ -3965,7 +3965,7 @@ void handle_se18(DDukeActor *actor, bool morecheck)
{
if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].pos.Z -= extra;
}
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE)
if (a2->int_zvel() == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE)
{
a2->spr.pos.Z -= extra;
a2->floorz = sc->floorz;
@ -4136,7 +4136,7 @@ void handle_se20(DDukeActor* actor)
DukeSectIterator it(actor->sector());
while (auto a2 = it.Next())
{
if (a2->spr.statnum != 3 && a2->spr.zvel == 0)
if (a2->spr.statnum != 3 && a2->int_zvel() == 0)
{
a2->add_int_pos({ x, l, 0 });
if (a2->sector()->floorstat & CSTAT_SECTOR_SLOPE)
@ -4657,7 +4657,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1)
ps[a2->PlayerIndex()].player_add_int_z(l);
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
if (a2->int_zvel() == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{
a2->add_int_z(l);
a2->floorz = sec->floorz;
@ -4686,7 +4686,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1)
ps[a2->PlayerIndex()].player_add_int_z(l);
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
if (a2->int_zvel() == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{
a2->add_int_z(l);
a2->floorz = sec->floorz;
@ -4717,7 +4717,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1)
ps[a2->PlayerIndex()].player_add_int_z(l);
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
if (a2->int_zvel() == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{
a2->add_int_z(l);
a2->floorz = sec->floorz;
@ -4745,7 +4745,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
if (a2->isPlayer() && a2->GetOwner())
if (ps[a2->PlayerIndex()].on_ground == 1)
ps[a2->PlayerIndex()].player_add_int_z(-l);
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
if (a2->int_zvel() == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{
a2->add_int_z(-l);
a2->floorz = sec->floorz;
@ -4847,12 +4847,12 @@ void makeitfall(DDukeActor* actor)
if( actor->spr.pos.Z < actor->floorz - FOURSLEIGHT_F)
{
if( actor->sector()->lotag == 2 && actor->spr.zvel > 3122 )
if( actor->sector()->lotag == 2 && actor->int_zvel() > 3122 )
actor->spr.zvel = 3144;
if(actor->spr.zvel < 6144)
if(actor->int_zvel() < 6144)
actor->spr.zvel += c;
else actor->spr.zvel = 6144;
actor->add_int_z(actor->spr.zvel);
actor->add_int_z(actor->int_zvel());
}
if (actor->spr.pos.Z >= actor->floorz - FOURSLEIGHT_F)
{
@ -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->spr.zvel < 648) actor->spr.zvel += ((*(moveptr + 1) << 4) - actor->spr.zvel) / 5;
if (actor->int_zvel() < 648) actor->spr.zvel += ((*(moveptr + 1) << 4) - actor->int_zvel()) / 5;
if (isRRRA() && (ang & windang))
actor->set_int_ang(WindDir);
@ -5080,9 +5080,9 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
if (actor->spr.pos.Z < actor->floorz - FOURSLEIGHT_F)
{
actor->spr.zvel += c;
actor->add_int_z(actor->spr.zvel);
actor->add_int_z(actor->int_zvel());
if (actor->spr.zvel > 6144) actor->spr.zvel = 6144;
if (actor->int_zvel() > 6144) actor->spr.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->spr.zvel > 3084 && actor->spr.extra <= 1)
if (actor->int_zvel() > 3084 && 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->spr.zvel = 0;
}
else if (actor->spr.zvel > 2048 && actor->sector()->lotag != 1)
else if (actor->int_zvel() > 2048 && actor->sector()->lotag != 1)
{
auto sect = actor->sector();

View file

@ -473,7 +473,7 @@ int movesprite_ex_d(DDukeActor* actor, int xchange, int ychange, int zchange, un
((actor->actorstayput != nullptr && actor->actorstayput != dasectp) ||
((actor->spr.picnum == BOSS2) && actor->spr.pal == 0 && dasectp->lotag != 3) ||
((actor->spr.picnum == BOSS1 || actor->spr.picnum == BOSS2) && dasectp->lotag == ST_1_ABOVE_WATER) ||
(dasectp->lotag == ST_1_ABOVE_WATER && (actor->spr.picnum == LIZMAN || (actor->spr.picnum == LIZTROOP && actor->spr.zvel == 0)))
(dasectp->lotag == ST_1_ABOVE_WATER && (actor->spr.picnum == LIZMAN || (actor->spr.picnum == LIZTROOP && actor->int_zvel() == 0)))
))
)
{
@ -773,9 +773,9 @@ void movefallers_d(void)
if (act->spr.pos.Z < sectp->floorz - 1)
{
act->spr.zvel += x;
if (act->spr.zvel > 6144)
if (act->int_zvel() > 6144)
act->spr.zvel = 6144;
act->add_int_z(act->spr.zvel);
act->add_int_z(act->int_zvel());
}
if ((sectp->floorz - act->spr.pos.Z) < 16)
{
@ -1004,7 +1004,7 @@ static void movefireext(DDukeActor* actor)
for (int k = 0; k < 16; k++)
{
auto spawned = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->spr.zvel >> 2), actor, 5);
auto spawned = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->int_zvel() >> 2), actor, 5);
if(spawned) spawned->spr.pal = 2;
}
@ -1339,7 +1339,7 @@ static bool movefireball(DDukeActor* actor)
}
actor->temp_data[0]++;
}
if (actor->spr.zvel < 15000)
if (actor->int_zvel() < 15000)
actor->spr.zvel += 200;
return false;
}
@ -1455,7 +1455,7 @@ static bool weaponhitsector(DDukeActor* proj, const DVector3& oldpos, bool fireb
{
SetActor(proj, oldpos);
if (proj->spr.zvel < 0)
if (proj->int_zvel() < 0)
{
if (proj->sector()->ceilingstat & CSTAT_SECTOR_SKY)
if (proj->sector()->ceilingpal == 0)
@ -1512,7 +1512,7 @@ static void weaponcommon_d(DDukeActor* proj)
if (proj->spr.picnum == RPG && proj->sector()->lotag == 2)
{
k = proj->spr.xvel >> 1;
ll = proj->spr.zvel >> 1;
ll = proj->int_zvel() >> 1;
}
else
{
@ -1576,7 +1576,7 @@ static void weaponcommon_d(DDukeActor* proj)
vec3_t offset = {
MulScale(k, bcos(proj->int_ang()), 9),
MulScale(k, bsin(proj->int_ang()), 9),
(k * Sgn(proj->spr.zvel)) * abs(proj->spr.zvel / 24)
(k * Sgn(proj->int_zvel())) * abs(proj->spr.zvel / 24)
};
auto spawned = EGS(proj->sector(),
@ -1593,7 +1593,7 @@ static void weaponcommon_d(DDukeActor* proj)
}
}
}
else if (proj->spr.picnum == SPIT) if (proj->spr.zvel < 6144)
else if (proj->spr.picnum == SPIT) if (proj->int_zvel() < 6144)
proj->spr.zvel += gs.gravity - 112;
if (coll.type != 0)
@ -1644,7 +1644,7 @@ static void weaponcommon_d(DDukeActor* proj)
spawned->spr.xrepeat = spawned->spr.yrepeat = proj->spr.xrepeat >> 1;
if (coll.type == kHitSector)
{
if (proj->spr.zvel < 0)
if (proj->int_zvel() < 0)
{
spawned->spr.cstat |= CSTAT_SPRITE_YFLIP;
spawned->spr.pos.Z += 72;
@ -1706,7 +1706,7 @@ void moveweapons_d(void)
continue;
case FREEZEBLAST:
if (act->spr.yvel < 1 || act->spr.extra < 2 || (act->spr.xvel|act->spr.zvel) == 0)
if (act->spr.yvel < 1 || act->spr.extra < 2 || (act->spr.xvel|act->int_zvel()) == 0)
{
auto spawned = spawn(act,TRANSPORTERSTAR);
if (spawned)
@ -1934,7 +1934,7 @@ void movetransports_d(void)
case STAT_FALLER:
case STAT_DUMMYPLAYER:
ll = abs(act2->spr.zvel) * zinttoworld;
ll = abs(act2->int_zvel()) * zinttoworld;
{
warpspriteto = 0;
@ -2154,7 +2154,7 @@ static void greenslime(DDukeActor *actor)
{
for (x = 0; x < 8; x++)
{
auto spawned = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->spr.zvel >> 2), actor, 5);
auto spawned = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->int_zvel() >> 2), actor, 5);
spawned->spr.pal = 6;
}
@ -2262,7 +2262,7 @@ static void greenslime(DDukeActor *actor)
for (x = 0; x < 8; x++)
{
auto spawned = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->spr.zvel >> 2), actor, 5);
auto spawned = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->int_zvel() >> 2), actor, 5);
if (spawned) spawned->spr.pal = 6;
}
actor->temp_data[0] = -3;
@ -2399,9 +2399,9 @@ 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->spr.zvel > -(2048 + 1024))
if (actor->int_zvel() > -(2048 + 1024))
actor->spr.zvel -= 348;
actor->add_int_z(actor->spr.zvel);
actor->add_int_z(actor->int_zvel());
if (actor->spr.pos.Z < actor->ceilingz + 16)
{
actor->spr.pos.Z = actor->ceilingz + 16;
@ -2516,7 +2516,7 @@ static void flamethrowerflame(DDukeActor *actor)
else if (coll.type == kHitSector)
{
SetActor(actor, dapos);
if (actor->spr.zvel < 0)
if (actor->int_zvel() < 0)
fi.checkhitceiling(actor->sector());
}
@ -2601,7 +2601,7 @@ static void heavyhbomb(DDukeActor *actor)
MulScale(actor->spr.xvel, bsin(actor->int_ang()), 14),
actor->int_zvel(), CLIPMASK0, coll);
if (actor->sector()->lotag == 1 && actor->spr.zvel == 0)
if (actor->sector()->lotag == 1 && actor->int_zvel() == 0)
{
actor->spr.pos.Z += 32;
if (actor->temp_data[5] == 0)
@ -2675,7 +2675,7 @@ DETONATEB:
fi.hitradius(actor, m, x >> 2, x >> 1, x - (x >> 2), x);
spawn(actor, EXPLOSION2);
if (actor->spr.zvel == 0) spawn(actor, EXPLOSION2BOT);
if (actor->int_zvel() == 0) spawn(actor, EXPLOSION2BOT);
S_PlayActorSound(PIPEBOMB_EXPLODE, actor);
for (x = 0; x < 8; x++)
RANDOMSCRAP(actor);
@ -2835,7 +2835,7 @@ void moveactors_d(void)
case HELECOPT:
case DUKECAR:
act->add_int_z(act->spr.zvel);
act->add_int_z(act->int_zvel());
act->temp_data[0]++;
if (act->temp_data[0] == 4) S_PlayActorSound(WAR_AMBIENCE2, act);
@ -3551,7 +3551,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
auto moveptr = &ScriptCode[actor->temp_data[1]];
if (a & geth) actor->spr.xvel += (*moveptr - actor->spr.xvel) >> 1;
if (a & getv) actor->spr.zvel += ((*(moveptr + 1) << 4) - actor->spr.zvel) >> 1;
if (a & getv) actor->spr.zvel += ((*(moveptr + 1) << 4) - actor->int_zvel()) >> 1;
if (a & dodgebullet)
dodge(actor);
@ -3563,7 +3563,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
a = badguy(actor);
if (actor->spr.xvel || actor->spr.zvel)
if (actor->spr.xvel || actor->int_zvel())
{
if (a && actor->spr.picnum != ROTATEGUN)
{
@ -3590,7 +3590,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
}
else
{
if (actor->spr.zvel > 0)
if (actor->int_zvel() > 0)
{
double f = getflorzofslopeptrf(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y);
actor->floorz = f;
@ -3611,9 +3611,9 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
}
else if (actor->spr.picnum != ORGANTIC)
{
if (actor->spr.zvel > 0 && actor->floorz < actor->spr.pos.Z)
if (actor->int_zvel() > 0 && actor->floorz < actor->spr.pos.Z)
actor->spr.pos.Z = actor->floorz;
if (actor->spr.zvel < 0)
if (actor->int_zvel() < 0)
{
double c = getceilzofslopeptrf(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y);
if (actor->spr.pos.Z < c + 66)

View file

@ -691,9 +691,9 @@ void movefallers_r(void)
if (act->spr.pos.Z < sectp->floorz - 1)
{
act->spr.zvel += x;
if (act->spr.zvel > 6144)
if (act->int_zvel() > 6144)
act->spr.zvel = 6144;
act->add_int_z(act->spr.zvel);
act->add_int_z(act->int_zvel());
}
if ((sectp->floorz - act->spr.pos.Z) < 16)
{
@ -1135,7 +1135,7 @@ bool weaponhitsector(DDukeActor *proj, const DVector3& oldpos)
guts_r(proj, RABBITJIBC, 2, myconnectindex);
}
if (proj->spr.zvel < 0)
if (proj->int_zvel() < 0)
{
if (proj->sector()->ceilingstat & CSTAT_SECTOR_SKY)
if (proj->sector()->ceilingpal == 0)
@ -1178,12 +1178,12 @@ static void weaponcommon_r(DDukeActor *proj)
if (proj->spr.picnum == RPG && proj->sector()->lotag == 2)
{
k = proj->spr.xvel >> 1;
ll = proj->spr.zvel >> 1;
ll = proj->int_zvel() >> 1;
}
else if (isRRRA() && proj->spr.picnum == RPG2 && proj->sector()->lotag == 2)
{
k = proj->spr.xvel >> 1;
ll = proj->spr.zvel >> 1;
ll = proj->int_zvel() >> 1;
}
else
{
@ -1264,7 +1264,7 @@ static void weaponcommon_r(DDukeActor *proj)
auto x = EGS(proj->sector(),
proj->int_pos().X + MulScale(k, bcos(proj->int_ang()), 9),
proj->int_pos().Y + MulScale(k, bsin(proj->int_ang()), 9),
proj->int_pos().Z + ((k * Sgn(proj->spr.zvel)) * abs(proj->spr.zvel / 24)), FIRELASER, -40 + (k << 2),
proj->int_pos().Z + ((k * Sgn(proj->int_zvel())) * abs(proj->spr.zvel / 24)), FIRELASER, -40 + (k << 2),
proj->spr.xrepeat, proj->spr.yrepeat, 0, 0, 0, proj->GetOwner(), 5);
if (x)
@ -1274,7 +1274,7 @@ static void weaponcommon_r(DDukeActor *proj)
}
}
}
else if (proj->spr.picnum == SPIT) if (proj->spr.zvel < 6144)
else if (proj->spr.picnum == SPIT) if (proj->int_zvel() < 6144)
proj->spr.zvel += gs.gravity - 112;
if (coll.type != 0)
@ -1305,7 +1305,7 @@ static void weaponcommon_r(DDukeActor *proj)
spawned->spr.xrepeat = spawned->spr.yrepeat = proj->spr.xrepeat >> 1;
if (coll.type == kHitSector)
{
if (proj->spr.zvel < 0)
if (proj->int_zvel() < 0)
{
spawned->spr.cstat |= CSTAT_SPRITE_YFLIP;
spawned->spr.pos.Z += 72;
@ -1349,7 +1349,7 @@ void moveweapons_r(void)
continue;
case FREEZEBLAST:
if (proj->spr.yvel < 1 || proj->spr.extra < 2 || (proj->spr.xvel | proj->spr.zvel) == 0)
if (proj->spr.yvel < 1 || proj->spr.extra < 2 || (proj->spr.xvel | proj->int_zvel()) == 0)
{
auto star = spawn(proj, TRANSPORTERSTAR);
if (star)
@ -1579,7 +1579,7 @@ void movetransports_r(void)
case STAT_MISC:
case STAT_DUMMYPLAYER:
ll = abs(act2->spr.zvel) * zinttoworld;
ll = abs(act2->int_zvel()) * zinttoworld;
if (isRRRA())
{
if (act2->spr.zvel >= 0)
@ -2379,7 +2379,7 @@ static void heavyhbomb(DDukeActor *actor)
MulScale(actor->spr.xvel, bsin(actor->int_ang()), 14),
actor->int_zvel(), CLIPMASK0, coll);
if (actor->sector()->lotag == 1 && actor->spr.zvel == 0)
if (actor->sector()->lotag == 1 && actor->int_zvel() == 0)
{
actor->spr.pos.Z += 32;
if (actor->temp_data[5] == 0)
@ -3621,7 +3621,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
auto moveptr = &ScriptCode[actor->temp_data[1]];
if (a & geth) actor->spr.xvel += (*moveptr - actor->spr.xvel) >> 1;
if (a & getv) actor->spr.zvel += ((*(moveptr + 1) << 4) - actor->spr.zvel) >> 1;
if (a & getv) actor->spr.zvel += ((*(moveptr + 1) << 4) - actor->int_zvel()) >> 1;
if (a & dodgebullet)
dodge(actor);
@ -3633,13 +3633,13 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
a = badguy(actor);
if (actor->spr.xvel || actor->spr.zvel)
if (actor->spr.xvel || actor->int_zvel())
{
if (a)
{
if (actor->spr.picnum == DRONE && actor->spr.extra > 0)
{
if (actor->spr.zvel > 0)
if (actor->int_zvel() > 0)
{
double dist = isRRRA() ? 28 : 30;
double f = getflorzofslopeptrf(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y);
@ -3658,9 +3658,9 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
}
}
}
if (actor->spr.zvel > 0 && actor->floorz < actor->spr.pos.Z)
if (actor->int_zvel() > 0 && actor->floorz < actor->spr.pos.Z)
actor->spr.pos.Z = actor->floorz;
if (actor->spr.zvel < 0)
if (actor->int_zvel() < 0)
{
double c = getceilzofslopeptrf(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y);
if (actor->spr.pos.Z < c + 66)

View file

@ -1081,7 +1081,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
{
for (k = 0; k < 64; k++)
{
auto spawned = EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->spr.zvel >> 2), targ, 5);
auto spawned = EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
spawned->spr.pal = 8;
}
@ -1094,7 +1094,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
case HANGLIGHT:
case GENERICPOLE2:
for (k = 0; k < 6; k++)
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (8 << 8), SCRAP1 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->spr.zvel >> 2), targ, 5);
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (8 << 8), SCRAP1 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
deletesprite(targ);
break;

View file

@ -2060,7 +2060,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
lotsofglass(targ, nullptr, 10);
targ->spr.picnum++;
for (k = 0; k < 6; k++)
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (8 << 8), SCRAP6 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->spr.zvel >> 2), targ, 5);
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (8 << 8), SCRAP6 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
break;
case BOWLINGBALL:
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
@ -2127,7 +2127,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
{
for (k = 0; k < 64; k++)
{
auto spawned = EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (krand() % (48 << 8)), SCRAP6 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->spr.zvel >> 2), targ, 5);
auto spawned = EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (krand() % (48 << 8)), SCRAP6 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
if (spawned) spawned->spr.pal = 8;
}

View file

@ -87,7 +87,7 @@ void AIBubble::Tick(RunListEvent* ev)
pActor->nFrame = 0;
}
pActor->add_int_z(pActor->spr.zvel);
pActor->add_int_z(pActor->int_zvel());
auto pSector = pActor->sector();

View file

@ -415,7 +415,7 @@ void AIFish::Tick(RunListEvent* ev)
auto pSector =pActor->sector();
// loc_2EF54
Collision coll = movesprite(pActor, pActor->spr.xvel << 13, pActor->spr.yvel << 13, pActor->spr.zvel << 2, 0, 0, CLIPMASK0);
Collision coll = movesprite(pActor, pActor->spr.xvel << 13, pActor->spr.yvel << 13, pActor->int_zvel() << 2, 0, 0, CLIPMASK0);
if (!(pActor->sector()->Flag & kSectUnderwater))
{

View file

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

View file

@ -574,7 +574,7 @@ void Gravity(DExhumedActor* pActor)
{
if (pActor->spr.zvel <= 1024)
{
if (pActor->spr.zvel < 2048) {
if (pActor->int_zvel() < 2048) {
pActor->spr.zvel += 512;
}
}
@ -585,17 +585,17 @@ void Gravity(DExhumedActor* pActor)
}
else
{
if (pActor->spr.zvel > 0)
if (pActor->int_zvel() > 0)
{
pActor->spr.zvel -= 64;
if (pActor->spr.zvel < 0) {
if (pActor->int_zvel() < 0) {
pActor->spr.zvel = 0;
}
}
else if (pActor->spr.zvel < 0)
else if (pActor->int_zvel() < 0)
{
pActor->spr.zvel += 64;
if (pActor->spr.zvel > 0) {
if (pActor->int_zvel() > 0) {
pActor->spr.zvel = 0;
}
}
@ -604,7 +604,7 @@ void Gravity(DExhumedActor* pActor)
else
{
pActor->spr.zvel += 512;
if (pActor->spr.zvel > 16384) {
if (pActor->int_zvel() > 16384) {
pActor->spr.zvel = 16384;
}
}
@ -1152,12 +1152,12 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int
nAngle = (nAngDelta + pActor->int_ang()) & kAngleMask;
int nAngDeltaD = AngleDelta(pActor->int_zvel(), var_18, 24);
pActor->spr.zvel = (pActor->spr.zvel + nAngDeltaD) & kAngleMask;
pActor->spr.zvel = (pActor->int_zvel() + nAngDeltaD) & kAngleMask;
}
pActor->set_int_ang(nAngle);
int eax = abs(bcos(pActor->spr.zvel));
int eax = abs(bcos(pActor->int_zvel()));
int x = ((bcos(nAngle) * ebx) >> 14) * eax;
int y = ((bsin(nAngle) * ebx) >> 14) * eax;
@ -1173,7 +1173,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int
sqrtNum = INT_MAX;
}
int z = bsin(pActor->spr.zvel) * ksqrt(sqrtNum);
int z = bsin(pActor->int_zvel()) * ksqrt(sqrtNum);
return movesprite(pActor, x >> 2, y >> 2, (z >> 13) + bsin(ecx, -5), 0, 0, nClipType);
}

View file

@ -850,7 +850,7 @@ void AIPlayer::Tick(RunListEvent* ev)
int y = (sPlayerInput[nPlayer].yVel * 4) >> 2;
int z = (pPlayerActor->spr.zvel * 4) >> 2;
if (pPlayerActor->spr.zvel > 8192)
if (pPlayerActor->int_zvel() > 8192)
pPlayerActor->spr.zvel = 8192;
if (PlayerList[nPlayer].bIsMummified)
@ -895,7 +895,7 @@ void AIPlayer::Tick(RunListEvent* ev)
pPlayerActor->spr.pos.XY() = spr_pos.XY();
if (zVel < pPlayerActor->spr.zvel) {
if (zVel < pPlayerActor->int_zvel()) {
pPlayerActor->spr.zvel = zVel;
}
}

View file

@ -325,7 +325,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int val
nAngle = (nAngDelta + pActor->int_ang()) & kAngleMask;
pActor->spr.zvel = (AngleDelta(pActor->int_zvel(), var_14, 24) + pActor->spr.zvel) & kAngleMask;
pActor->spr.zvel = (AngleDelta(pActor->int_zvel(), var_14, 24) + pActor->int_zvel()) & kAngleMask;
}
pActor->set_int_ang(nAngle);
@ -620,7 +620,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
if (nMov.exbits & kHitAux2)
{
pActor->spr.zvel = -(pActor->spr.zvel - 256);
if (pActor->spr.zvel < -512)
if (pActor->int_zvel() < -512)
{
pActor->spr.zvel = 0;
}
@ -797,9 +797,9 @@ void AIQueenHead::Tick(RunListEvent* ev)
}
else if (nMov.exbits == kHitAux2)
{
pActor->spr.zvel = -(pActor->spr.zvel >> 1);
pActor->spr.zvel = -(pActor->int_zvel() >> 1);
if (pActor->spr.zvel > -256)
if (pActor->int_zvel() > -256)
{
nVelShift = 100;
pActor->spr.zvel = 0;
@ -819,7 +819,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
if (pActor->spr.zvel == 0)
if (pActor->int_zvel() == 0)
{
QueenHead.nIndex = 120;
}

View file

@ -305,7 +305,7 @@ void AIRat::Tick(RunListEvent* ev)
}
case 2:
{
if (pActor->spr.xvel || pActor->spr.yvel || pActor->spr.zvel) {
if (pActor->spr.xvel || pActor->spr.yvel || pActor->int_zvel()) {
MoveCreature(pActor);
}

View file

@ -1659,7 +1659,7 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
pActor->spr.yvel += (edi * bsin(nAngle)) >> 3;
pActor->spr.zvel -= edi * 24;
if (pActor->spr.zvel < -3584) {
if (pActor->int_zvel() < -3584) {
pActor->spr.zvel = -3584;
}
}

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->spr.zvel > 4000)
if (pActor->int_zvel() > 4000)
{
if (nMov.exbits & kHitAux2)
{

View file

@ -281,7 +281,7 @@ void AISpider::Tick(RunListEvent* ev)
return;
if (nMov.exbits & kHitAux1
&& spp->spr.zvel < 0
&& spp->int_zvel() < 0
&& hiHit.type != kHitSprite
&& !((spp->sector()->ceilingstat) & CSTAT_SECTOR_SKY))
{

View file

@ -332,7 +332,7 @@ void AIWasp::Tick(RunListEvent* ev)
{
auto pSector =pActor->sector();
pActor->add_int_z(pActor->spr.zvel);
pActor->add_int_z(pActor->int_zvel());
if (pActor->int_pos().Z >= pSector->int_floorz())
{

View file

@ -265,18 +265,18 @@ int DoWallBloodDrip(DSWActor* actor)
if (actor->spr.pos.Z > actor->user.pos.Y && actor->spr.pos.Z < actor->user.pos.Z)
{
actor->spr.zvel += 300;
actor->add_int_z(actor->spr.zvel);
actor->add_int_z(actor->int_zvel());
}
else
{
actor->spr.zvel = (300+RandomRange(2300)) >> 1;
actor->add_int_z(actor->spr.zvel);
actor->add_int_z(actor->int_zvel());
}
}
else
{
actor->spr.zvel = (300+RandomRange(2300)) >> 1;
actor->add_int_z(actor->spr.zvel);
actor->add_int_z(actor->int_zvel());
}
if (actor->spr.pos.Z >= actor->user.loz)
@ -1188,7 +1188,7 @@ int SpawnRadiationCloud(DSWActor* actor)
int DoRadiationCloud(DSWActor* actor)
{
actor->spr.pos.XY() += actor->user.change;
actor->add_int_z(-actor->spr.zvel);
actor->add_int_z(-actor->int_zvel());
if (actor->user.ID)
{

View file

@ -3490,7 +3490,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
vec.XY() = actor->spr.angle.ToVector() * actor->spr.xvel * inttoworld;
}
if (actor->spr.zvel)
if (actor->int_zvel())
vec.Z = actor->spr.zvel * locktics * zinttoworld;
}

View file

@ -9367,7 +9367,7 @@ int DoUziBullet(DSWActor* actor)
for (i = 0; i < 2; i++)
{
auto vec = MOVExy((actor->spr.xvel >> 1), actor->spr.angle);
double daz = (actor->spr.zvel >> 1) * zinttoworld;
double daz = (actor->int_zvel() >> 1) * zinttoworld;
sx = actor->int_pos().X;
sy = actor->int_pos().Y;
@ -14042,7 +14042,7 @@ int InitEnemyRail(DSWActor* actor)
UpdateChange(actorNew);
if (TestMissileSetPos(actorNew, DoRailStart, 600, actorNew->spr.zvel))
if (TestMissileSetPos(actorNew, DoRailStart, 600, actorNew->int_zvel()))
{
KillActor(actorNew);
return 0;
@ -16656,13 +16656,13 @@ DSWActor* SpawnBubble(DSWActor* actor)
int DoVehicleSmoke(DSWActor* actor)
{
actor->spr.pos.XY() += actor->user.change.XY();
actor->add_int_z(-actor->spr.zvel);
actor->add_int_z(-actor->int_zvel());
return false;
}
int DoWaterSmoke(DSWActor* actor)
{
actor->add_int_z(-actor->spr.zvel);
actor->add_int_z(-actor->int_zvel());
return false;
}
@ -16720,10 +16720,10 @@ int SpawnSmokePuff(DSWActor* actor)
int DoBubble(DSWActor* actor)
{
actor->add_int_z(-actor->spr.zvel);
actor->add_int_z(-actor->int_zvel());
actor->spr.zvel += 32;
if (actor->spr.zvel > 768)
if (actor->int_zvel() > 768)
actor->spr.zvel = 768;
// notreallypos