diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index e6d8c921f..1ff9ac023 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -300,7 +300,9 @@ void displayweapon_d(int snum, double smoothratio) animateknee(gs,snum); - gun_pos = 80-(p->weapon_pos*p->weapon_pos); + int opos = p->oweapon_pos * p->oweapon_pos; + int npos = p->weapon_pos * p->weapon_pos; + gun_pos = 80 - (opos + fmulscale16(npos - opos, smoothratio)); weapon_xoffset = (160)-90; weapon_xoffset -= calcSinTableValue(fmod((weapon_sway / 2.) + 512, 2048)) / (1024. + 512.); diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 60f0634ad..83165ff3f 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -253,6 +253,9 @@ void hud_input(int snum) if (p->aim_mode < i) p->return_to_center = 9; + // Backup weapon_pos here as this is the earliest occurence where weapon_pos can change. + p->oweapon_pos = p->weapon_pos; + if (isRR()) { if (PlayerInput(snum, SKB_QUICK_KICK) && p->last_pissed_time == 0) diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 6100c33ff..49ab1e7e2 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -146,7 +146,7 @@ struct player_struct short dead_flag, show_empty_weapon; // JBF 20031220: added orotscrnang short scuba_amount, jetpack_amount, steroids_amount, shield_amount; - short holoduke_on, pycount, weapon_pos, frag_ps; + short holoduke_on, pycount, weapon_pos, frag_ps, oweapon_pos; short transporter_hold, last_full_weapon, footprintshade, boot_amount; int scream_voice;