diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index b03ace897..9aadd6665 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -321,7 +321,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, break; case PLAYER_LOOGCNT: - if (bSet) ps[iPlayer].loogcnt = lValue; + if (bSet) ps[iPlayer].oloogcnt = ps[iPlayer].loogcnt = lValue; else SetGameVarID(lVar2, ps[iPlayer].loogcnt, sActor, sPlayer); break; diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 1729be5ef..af90307c8 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -61,20 +61,18 @@ inline static void hud_drawpal(double x, double y, int tilenum, int shade, int o // //--------------------------------------------------------------------------- -static void displayloogie(player_struct* p) +static void displayloogie(player_struct* p, double const smoothratio) { - double a, y; - int z; - double x; - if (p->loogcnt == 0) return; - y = (p->loogcnt << 2); + const double loogi = interpolatedvaluef(p->oloogcnt, p->loogcnt, smoothratio); + const double y = loogi * 4.; + for (int i = 0; i < p->numloogs; i++) { - a = fabs(bsinf((p->loogcnt + i) << 5, -5)); - z = 4096 + ((p->loogcnt + i) << 9); - x = -getavel(p->GetPlayerNum()) + bsinf((p->loogcnt + i) << 6, -10); + const double a = fabs(bsinf((loogi + i) * 32., -5)); + const double z = 4096. + ((loogi + i) * 512.); + const double x = -getavel(p->GetPlayerNum()) + bsinf((loogi + i) * 64., -10); hud_drawsprite((p->loogie[i].X + x), (200 + p->loogie[i].Y - y), z - (i << 8), 256 - a, LOOGIE, 0, 0, 2); } @@ -1226,7 +1224,7 @@ void displayweapon_d(int snum, double smoothratio) } } - displayloogie(p); + displayloogie(p, smoothratio); } diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index a9045df18..c08eea8b9 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -796,6 +796,7 @@ void player_struct::backupweapon() oknee_incs = knee_incs; oaccess_incs = access_incs; ofist_incs = fist_incs; + oloogcnt = loogcnt; } //--------------------------------------------------------------------------- diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 1efed09ab..ab009722f 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -2802,8 +2802,15 @@ void processinput_d(int snum) p->last_extra = pact->spr.extra; - if (p->loogcnt > 0) p->loogcnt--; - else p->loogcnt = 0; + if (p->loogcnt > 0) + { + p->oloogcnt = p->loogcnt; + p->loogcnt--; + } + else + { + p->oloogcnt = p->loogcnt = 0; + } if (p->fist_incs) { diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 4af5a343d..eafe624d9 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3520,8 +3520,15 @@ void processinput_r(int snum) p->last_extra = pact->spr.extra; - if (p->loogcnt > 0) p->loogcnt--; - else p->loogcnt = 0; + if (p->loogcnt > 0) + { + p->oloogcnt = p->loogcnt; + p->loogcnt--; + } + else + { + p->oloogcnt = p->loogcnt = 0; + } if (p->fist_incs) { diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index b78a8d9cf..df8991b1d 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -99,7 +99,7 @@ void resetplayerstats(int snum) p->pycount = 0; p->pyoff = 0; p->opyoff = 0; - p->loogcnt = 0; + p->oloogcnt = p->loogcnt = 0; p->psectlotag = 0; p->weapon_sway = 0; // p->select_dir = 0; diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 63903197f..0d316edff 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -224,7 +224,7 @@ struct player_struct short psectlotag; // From here on it is unaltered from JFDuke with the exception of a few fields that are no longer needed and were removed. - int numloogs, loogcnt; + int numloogs, oloogcnt, loogcnt; int invdisptime; int pyoff, opyoff; int last_pissed_time, truefz, truecz;