diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index a79719da3..e227737a9 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1718,7 +1718,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p if (l <= 1524) { a = actor->int_ang(); - actor->spr.xvel >>= 1; + actor->mul_int_xvel(0.5); } else a = getangle(Owner->spr.pos.XY() - actor->spr.pos.XY()); diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 80ca96191..3f2fdb120 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -2634,7 +2634,7 @@ static void heavyhbomb(DDukeActor *actor) if(actor->float_xvel() < 0) actor->clear_xvel(); - if (actor->spr.xvel & 8) actor->spr.cstat ^= CSTAT_SPRITE_XFLIP; + if (int(actor->float_xvel() * 16) & 8) actor->spr.cstat ^= CSTAT_SPRITE_XFLIP; } if (coll.type== kHitWall) @@ -2645,7 +2645,7 @@ static void heavyhbomb(DDukeActor *actor) int k = getangle(wal->delta()); actor->set_int_ang(((k << 1) - actor->int_ang()) & 2047); - actor->spr.xvel >>= 1; + actor->mul_int_xvel(0.5); } DETONATEB: diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index f3b552ede..111bde68b 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -2422,7 +2422,7 @@ static void heavyhbomb(DDukeActor *actor) if(actor->float_xvel() < 0) actor->clear_xvel(); - if (actor->spr.xvel & 8) actor->spr.cstat ^= CSTAT_SPRITE_XFLIP; + if (int(actor->float_xvel() * 16) & 8) actor->spr.cstat ^= CSTAT_SPRITE_XFLIP; } if (coll.type == kHitWall) diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index 9ebc02671..e88979828 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -364,7 +364,7 @@ void AILion::Tick(RunListEvent* ev) if (nMov.exbits & kHitAux2) { - pActor->spr.xvel >>= 1; + pActor->mul_int_xvel(0.5); pActor->spr.yvel >>= 1; } diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index e9a92cac9..95b6ea0c5 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -1320,7 +1320,7 @@ DExhumedActor* BuildCreatureChunk(DExhumedActor* pSrc, int nPic, bool bSpecial) if (bSpecial) { - pActor->spr.xvel *= 4; + pActor->mul_int_xvel(4); pActor->spr.yvel *= 4; pActor->mul_int_zvel(2); } @@ -1379,7 +1379,7 @@ void AICreatureChunk::Tick(RunListEvent* ev) { if (nVal.exbits & kHitAux1) { - pActor->spr.xvel >>= 1; + pActor->mul_int_xvel(0.5); pActor->spr.yvel >>= 1; pActor->set_int_zvel(-pActor->int_zvel()); return; diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index 1bb02568a..7a799c45f 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -373,7 +373,7 @@ void AIMummy::Tick(RunListEvent* ev) { if (nMov.exbits) { - pActor->spr.xvel >>= 1; + pActor->mul_int_xvel(0.5); pActor->spr.yvel >>= 1; } diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index a433e3215..8139e83fa 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -2037,7 +2037,7 @@ void AIObject::RadialDamage(RunListEvent* ev) } else if (pActor->spr.statnum != kStatAnubisDrum) { - pActor->spr.xvel >>= 1; + pActor->mul_int_xvel(0.5); pActor->spr.yvel >>= 1; pActor->mul_int_zvel(0.5); } diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 35186d70c..a71c520b9 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -969,7 +969,7 @@ void AIPlayer::Tick(RunListEvent* ev) if (zVel >= 6500) { - pPlayerActor->spr.xvel >>= 2; + pPlayerActor->mul_int_xvel(0.25); pPlayerActor->spr.yvel >>= 2; runlist_DamageEnemy(pPlayerActor, nullptr, ((zVel - 6500) >> 7) + 10); diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index 02faa43c2..5c85c73c8 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -394,7 +394,7 @@ void AISet::Tick(RunListEvent* ev) if (pActor->nIndex2) { - pActor->spr.xvel *= 2; + pActor->mul_int_xvel(2); pActor->spr.yvel *= 2; } @@ -546,7 +546,7 @@ void AISet::Tick(RunListEvent* ev) case 9: { - pActor->spr.xvel >>= 1; + pActor->mul_int_xvel(0.5); pActor->spr.yvel >>= 1; if (bVal) diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index 93b780630..e1fc911af 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -125,7 +125,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) case COOLIE_RUN_R0: ChangeState(actor, actor->user.StateEnd); actor->user.RotNum = 0; - actor->spr.xvel <<= 1; + actor->mul_int_xvel(2); actor->user.ActorActionFunc = nullptr; actor->spr.angle += DAngle180; break; @@ -199,7 +199,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) // Rippers still gotta jump or they fall off walls weird if (actor->user.ID == RIPPER_RUN_R0 || actor->user.ID == RIPPER2_RUN_R0) { - actor->spr.xvel <<= 1; + actor->mul_int_xvel(2); actor->user.jump_speed = -100 - RandomRange(250); DoActorBeginJump(actor); } diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 73f5ccf93..6e72058fd 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -3186,7 +3186,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) if (actor->user.ActorActionSet->DeathJump) { actor->user.Flags |= (SPR_DEAD); - actor->spr.xvel <<= 1; + actor->mul_int_xvel(2); actor->user.jump_speed = -495; DoActorBeginJump(actor); NewStateGroup(actor, actor->user.ActorActionSet->DeathJump); diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 0ea4a968a..0cb203dcb 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -3910,7 +3910,7 @@ int DoShrapDamage(DSWActor* actor) { actor->user.Flags |= (SPR_BOUNCE); actor->user.jump_speed = -300; - actor->spr.xvel >>= 2; + actor->mul_int_xvel(0.25); DoBeginJump(actor); return 0; }