diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index c04cd9fb3..ada84045c 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1721,7 +1721,7 @@ static void onMotorcycle(int snum, ESyncBits &actions) if (p->MotoSpeed != 0 && p->on_ground == 1) { if (!p->VBumpNow && (krand() & 3) == 2) - p->VBumpTarget = short((p->MotoSpeed / 16.) * ((krand() & 7) - 4)); + p->VBumpTarget = p->MotoSpeed * (1. / 16.) * ((krand() & 7) - 4); if (p->vehTurnLeft || p->moto_drink < 0) { @@ -1757,14 +1757,14 @@ static void onMotorcycle(int snum, ESyncBits &actions) p->VBumpNow += p->moto_bump_fast ? 6 : 1; if (p->VBumpTarget < p->VBumpNow) p->VBumpNow = p->VBumpTarget; - horiz = p->VBumpNow / 3.; + horiz = p->VBumpNow * (1. / 3.); } else if (p->VBumpTarget < p->VBumpNow) { p->VBumpNow -= p->moto_bump_fast ? 6 : 1; if (p->VBumpTarget > p->VBumpNow) p->VBumpNow = p->VBumpTarget; - horiz = p->VBumpNow / 3.; + horiz = p->VBumpNow * (1. / 3.); } else { @@ -1991,7 +1991,7 @@ static void onBoat(int snum, ESyncBits &actions) if (p->MotoSpeed != 0 && p->on_ground == 1) { if (!p->VBumpNow && (krand() & 15) == 14) - p->VBumpTarget = short((p->MotoSpeed / 16.) * ((krand() & 3) - 2)); + p->VBumpTarget = p->MotoSpeed * (1. / 16.) * ((krand() & 3) - 2); if (p->vehTurnLeft && p->moto_drink < 0) { @@ -2025,14 +2025,14 @@ static void onBoat(int snum, ESyncBits &actions) p->VBumpNow += p->moto_bump_fast ? 6 : 1; if (p->VBumpTarget < p->VBumpNow) p->VBumpNow = p->VBumpTarget; - horiz = p->VBumpNow / 3.; + horiz = p->VBumpNow * (1. / 3.); } else if (p->VBumpTarget < p->VBumpNow) { p->VBumpNow -= p->moto_bump_fast ? 6 : 1; if (p->VBumpTarget > p->VBumpNow) p->VBumpNow = p->VBumpTarget; - horiz = p->VBumpNow / 3.; + horiz = p->VBumpNow * (1. / 3.); } else { diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index ec9d60cd6..246e8b701 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -283,7 +283,8 @@ struct player_struct short MamaEnd; // raat609 short moto_drink; float TiltStatus, oTiltStatus; - short VBumpNow, VBumpTarget, TurbCount; + double VBumpNow, VBumpTarget; + short TurbCount; short drug_stat[3]; // raat5f1..5 uint8_t DrugMode, lotag800kill; uint8_t sea_sick_stat; // raat5dd diff --git a/wadsrc/static/zscript/games/duke/dukegame.zs b/wadsrc/static/zscript/games/duke/dukegame.zs index a28297d11..5849a7d5c 100644 --- a/wadsrc/static/zscript/games/duke/dukegame.zs +++ b/wadsrc/static/zscript/games/duke/dukegame.zs @@ -229,7 +229,8 @@ struct DukePlayer native int16 MamaEnd; // raat609 native int16 moto_drink; native float TiltStatus, oTiltStatus; - native int16 VBumpNow, VBumpTarget, TurbCount; + native double VBumpNow, VBumpTarget; + native int16 TurbCount; native int16 drug_stat[3]; // raat5f1..5 native uint8 DrugMode, lotag800kill; native uint8 sea_sick_stat; // raat5dd