diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 8be6d1de3..87fcb1b4e 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1005,7 +1005,7 @@ void movetrash(DDukeActor *actor) { makeitfall(actor); if (krand() & 1) actor->add_int_zvel(- 256); - if (abs(actor->spr.xvel) < 48) + if (abs(actor->int_xvel()) < 48) actor->add_int_xvel( (krand() & 3)); } else deletesprite(actor); @@ -4984,7 +4984,7 @@ void alterang(int ang, DDukeActor* actor, int playernum) aang = actor->int_ang(); - actor->add_int_xvel( (*moveptr - actor->spr.xvel) / 5); + actor->add_int_xvel( (*moveptr - actor->int_xvel()) / 5); if (actor->float_zvel() < (648/256.)) actor->add_int_zvel( ((*(moveptr + 1) << 4) - actor->int_zvel()) / 5); if (isRRRA() && (ang & windang)) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index a387dcaf8..bbebb50b9 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -3551,7 +3551,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel) auto moveptr = &ScriptCode[actor->temp_data[1]]; - if (a & geth) actor->add_int_xvel( (*moveptr - actor->spr.xvel) >> 1); + if (a & geth) actor->add_int_xvel( (*moveptr - actor->int_xvel()) >> 1); if (a & getv) actor->add_int_zvel( ((*(moveptr + 1) << 4) - actor->int_zvel()) >> 1); if (a & dodgebullet) diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index e05e93046..546de4267 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -2595,21 +2595,21 @@ static int henstand(DDukeActor *actor) actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; if (actor->spr.picnum == BOWLINGPIN) { - actor->spr.cstat |= CSTAT_SPRITE_XFLIP & ESpriteFlags::FromInt(actor->spr.xvel); - actor->spr.cstat |= CSTAT_SPRITE_YFLIP & ESpriteFlags::FromInt(actor->spr.xvel); + actor->spr.cstat |= CSTAT_SPRITE_XFLIP & ESpriteFlags::FromInt(int(actor->float_xvel() * 16)); + actor->spr.cstat |= CSTAT_SPRITE_YFLIP & ESpriteFlags::FromInt(int(actor->float_xvel() * 16)); if (krand() & 1) actor->spr.picnum = BOWLINGPIN + 1; } else if (actor->spr.picnum == HENSTAND) { - actor->spr.cstat |= CSTAT_SPRITE_XFLIP & ESpriteFlags::FromInt(actor->spr.xvel); - actor->spr.cstat |= CSTAT_SPRITE_YFLIP & ESpriteFlags::FromInt(actor->spr.xvel); + actor->spr.cstat |= CSTAT_SPRITE_XFLIP & ESpriteFlags::FromInt(int(actor->float_xvel() * 16)); + actor->spr.cstat |= CSTAT_SPRITE_YFLIP & ESpriteFlags::FromInt(int(actor->float_xvel() * 16)); if (krand() & 1) actor->spr.picnum = HENSTAND + 1; - if (!actor->spr.xvel) + if (!actor->int_xvel()) return 2;//deletesprite(actor); still needs to run a script but should not do on a deleted object } - if (actor->spr.picnum == BOWLINGPIN || (actor->spr.picnum == BOWLINGPIN + 1 && !actor->spr.xvel)) + if (actor->spr.picnum == BOWLINGPIN || (actor->spr.picnum == BOWLINGPIN + 1 && !actor->int_xvel())) { return 2;//deletesprite(actor); still needs to run a script but should not do on a deleted object } @@ -2766,7 +2766,7 @@ void moveactors_r(void) } break; case BOWLINGBALL: - if (act->spr.xvel) + if (act->int_xvel()) { if(!S_CheckSoundPlaying(356)) S_PlayActorSound(356,act); @@ -2847,7 +2847,7 @@ void moveactors_r(void) case POWDERKEG: if (!isRRRA() || (sectp->lotag != 1 && sectp->lotag != 160)) - if (act->spr.xvel) + if (act->int_xvel()) { movesprite_ex(act, MulScale(act->int_xvel(), bcos(act->int_ang()), 14), @@ -3620,7 +3620,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel) auto moveptr = &ScriptCode[actor->temp_data[1]]; - if (a & geth) actor->add_int_xvel( (*moveptr - actor->spr.xvel) >> 1); + if (a & geth) actor->add_int_xvel( (*moveptr - actor->int_xvel()) >> 1); if (a & getv) actor->add_int_zvel( ((*(moveptr + 1) << 4) - actor->int_zvel()) >> 1); if (a & dodgebullet) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 5cf7f7a1d..eb18d08bc 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -186,7 +186,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng // WTF??? DAngle myang = (DAngle90 - (DAngle180 - fabs(fabs(VecToAngle(spos.XY() - ps[p].pos.XY()) - sang) - DAngle180))); if (ps[p].GetActor()->spr.xvel != 0) - vel = (int)((myang.Buildang() * 0.001953125f * ps[p].GetActor()->spr.xvel) + 400); + vel = (int)((myang.Buildang() * 0.001953125f * ps[p].GetActor()->int_xvel()) + 400); if (actor->sector()->lotag == 2 && (krand() % 5) == 0) spawned = spawn(actor, WATERBUBBLE); } @@ -647,7 +647,7 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, spawned->spr.shade = 0; if (actor->spr.picnum == BOSS2) { - l = spawned->spr.xvel; + l = spawned->int_xvel(); spawned->set_int_xvel(1024); ssp(spawned, CLIPMASK0); spawned->set_int_xvel(l); @@ -2827,7 +2827,7 @@ void processinput_d(int snum) if (p->GetActor()->spr.xrepeat < 40 && p->jetpack_on == 0) { p->ofistsign = p->fistsign; - p->fistsign += p->GetActor()->spr.xvel; + p->fistsign += p->GetActor()->int_xvel(); } if (p->transporter_hold > 0) @@ -2860,7 +2860,7 @@ void processinput_d(int snum) if (p->on_crane != nullptr) goto HORIZONLY; - p->playerweaponsway(pact->spr.xvel); + p->playerweaponsway(pact->int_xvel()); pact->set_int_xvel(int(clamp((p->pos.XY() - p->bobpos).Length(), 0., 32.) * worldtoint)); if (p->on_ground) p->bobcounter += p->GetActor()->int_xvel() >> 1; @@ -3054,7 +3054,7 @@ HORIZONLY: { p->pycount += 52; p->pycount &= 2047; - p->pyoff = DAngle::fromBuild(p->pycount).Sin() * pact->spr.xvel; + p->pyoff = DAngle::fromBuild(p->pycount).Sin() * pact->int_xvel(); const double factor = 64. / 1596; // What is 1596? p->pyoff = abs(pact->spr.xvel * DAngle::fromBuild(p->pycount).Sin()) * factor; diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index eac4d6049..7298d933c 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3579,7 +3579,7 @@ void processinput_r(int snum) if (p->on_crane != nullptr) goto HORIZONLY; - p->playerweaponsway(pact->spr.xvel); + p->playerweaponsway(pact->int_xvel()); pact->set_int_xvel(int(clamp((p->pos.XY() - p->bobpos).Length(), 0., 32.) * worldtoint)); if (p->on_ground) p->bobcounter += p->GetActor()->int_xvel() >> 1; diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index c769c5736..6662a3f8d 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -9274,7 +9274,7 @@ int DoMicroMini(DSWActor* actor) int SpawnExtraMicroMini(DSWActor* actor) { auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Micro[0][0], actor->sector(), - actor->spr.pos, actor->spr.angle, actor->spr.xvel); + actor->spr.pos, actor->spr.angle, actor->int_xvel()); SetOwner(GetOwner(actor), actorNew); actorNew->spr.yrepeat = actorNew->spr.xrepeat = actor->spr.xrepeat; @@ -12415,7 +12415,7 @@ int InitStar(PLAYER* pp) for (size_t i = 0; i < countof(dang); i++) { - auto actorNew2 = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, nx, ny, nz, NORM_ANGLE(actorNew->int_ang() + dang[i]), actorNew->spr.xvel); + auto actorNew2 = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector, nx, ny, nz, NORM_ANGLE(actorNew->int_ang() + dang[i]), actorNew->int_xvel()); SetOwner(GetOwner(actorNew), actorNew2); actorNew2->spr.yrepeat = actorNew2->spr.xrepeat = STAR_REPEAT;