diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 738ef27dd..cb8e1c9d6 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -41,7 +41,7 @@ source as it is released. BEGIN_DUKE_NS void fireweapon_ww(int snum); -void operateweapon_ww(int snum, ESyncBits actions, int psect); +void operateweapon_ww(int snum, ESyncBits actions, int psect, int ticker); //--------------------------------------------------------------------------- // @@ -2077,7 +2077,7 @@ static void fireweapon(int snum) // //--------------------------------------------------------------------------- -static void operateweapon(int snum, ESyncBits actions, int psect) +static void operateweapon(int snum, ESyncBits actions, int psect, int ticker) { auto p = &ps[snum]; int pi = p->i; @@ -2181,7 +2181,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) { fi.shoot(pi, SHOTSPARK1); S_PlayActorSound(PISTOL_FIRE, pi); - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; } @@ -2240,7 +2240,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) S_PlayActorSound(SHOTGUN_FIRE, pi); - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; } @@ -2293,7 +2293,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) S_PlayActorSound(CHAINGUN_FIRE, pi); fi.shoot(pi, CHAINGUN); - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; checkavailweapon(p); @@ -2344,7 +2344,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) { // make them visible if not set... p->visibility = 0; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; } checkavailweapon(p); //#endif @@ -2358,7 +2358,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) { // make them visible if not set... p->visibility = 0; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; } checkavailweapon(p); } @@ -2377,7 +2377,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) { p->visibility = 0; //flashColor = 176 + (252 << 8) + (120 << 16); - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; checkavailweapon(p); } } @@ -2403,7 +2403,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) (p->kickback_pic & 1)) { p->visibility = 0; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; fi.shoot(pi, RPG); p->ammo_amount[DEVISTATOR_WEAPON]--; checkavailweapon(p); @@ -2413,7 +2413,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) else if (p->kickback_pic & 1) { p->visibility = 0; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; fi.shoot(pi, RPG); p->ammo_amount[DEVISTATOR_WEAPON]--; checkavailweapon(p); @@ -2433,7 +2433,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) p->ammo_amount[p->curr_weapon]--; p->visibility = 0; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; fi.shoot(pi, FREEZEBLAST); checkavailweapon(p); } @@ -2516,7 +2516,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) if (p->kickback_pic == 4) { p->ammo_amount[RPG_WEAPON]--; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; fi.shoot(pi, RPG); checkavailweapon(p); @@ -2625,8 +2625,8 @@ static void processweapon(int snum, ESyncBits actions, int psect) } else if (p->kickback_pic) { - if (!isWW2GI()) operateweapon(snum, actions, psect); - else operateweapon_ww(snum, actions, psect); + if (!isWW2GI()) operateweapon(snum, actions, psect, gameclock); + else operateweapon_ww(snum, actions, psect, gameclock); } } //--------------------------------------------------------------------------- diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index dc35de734..14e33ac5b 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -2771,7 +2771,7 @@ static void fireweapon(int snum) // //--------------------------------------------------------------------------- -static void operateweapon(int snum, ESyncBits actions, int psect) +static void operateweapon(int snum, ESyncBits actions, int psect, int ticker) { auto p = &ps[snum]; int pi = p->i; @@ -2882,7 +2882,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) p->noise_radius = 8192; madenoise(snum); - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; if (psectlotag != 857) { @@ -2961,7 +2961,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) p->noise_radius = 8192; madenoise(snum); - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; } @@ -3072,7 +3072,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) fi.shoot(pi, CHAINGUN); p->noise_radius = 8192; madenoise(snum); - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; if (psectlotag != 857) @@ -3128,7 +3128,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) if (p->kickback_pic == 2 || p->kickback_pic == 4) { p->visibility = 0; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; S_PlayActorSound(CHAINGUN_FIRE, pi); fi.shoot(pi, SHOTSPARK1); p->noise_radius = 16384; @@ -3155,7 +3155,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) if (p->kickback_pic == 2 || p->kickback_pic == 4) { p->visibility = 0; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; S_PlayActorSound(CHAINGUN_FIRE, pi); fi.shoot(pi, CHAINGUN); p->noise_radius = 16384; @@ -3213,7 +3213,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) { p->ammo_amount[ALIENBLASTER_WEAPON]--; p->visibility = 0; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; checkavailweapon(p); } else if (p->kickback_pic == 12) @@ -3322,7 +3322,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) p->ammo_amount[CROSSBOW_WEAPON]--; if (p->ammo_amount[DYNAMITE_WEAPON]) p->ammo_amount[DYNAMITE_WEAPON]--; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; fi.shoot(pi, RPG); p->noise_radius = 32768; @@ -3340,7 +3340,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect) if (p->kickback_pic == 4) { p->ammo_amount[CHICKEN_WEAPON]--; - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; fi.shoot(pi, RPG2); p->noise_radius = 32768; @@ -3414,7 +3414,7 @@ static void processweapon(int snum, ESyncBits actions, int psect) } else if (p->kickback_pic) { - operateweapon(snum, actions, psect); + operateweapon(snum, actions, psect, gameclock); } } diff --git a/source/games/duke/src/player_w.cpp b/source/games/duke/src/player_w.cpp index 08e7beed0..3740b22f4 100644 --- a/source/games/duke/src/player_w.cpp +++ b/source/games/duke/src/player_w.cpp @@ -306,7 +306,7 @@ void fireweapon_ww(int snum) // //--------------------------------------------------------------------------- -void operateweapon_ww(int snum, ESyncBits actions, int psect) +void operateweapon_ww(int snum, ESyncBits actions, int psect, int ticker) { auto p = &ps[snum]; int pi = p->i; @@ -400,7 +400,7 @@ void operateweapon_ww(int snum, ESyncBits actions, int psect) if (!(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_NOVISIBLE)) { // make them visible if not set... - lastvisinc = gameclock + 32; + lastvisinc = ticker + 32; p->visibility = 0; } SetGameVarID(g_iWeaponVarID, p->curr_weapon, p->i, snum);