From ef4db75afec0dcd71f0bbe75b5f0b20537c8eac1 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Fri, 4 Jan 2019 22:58:38 +0300 Subject: [PATCH] Revert "fixed weapon switching over the network; bumped protocol version" This reverts commit 7c0186b3f1e66e80377d14364f0cec949e44e615. --- src/game/g_net.pas | 2 +- src/game/g_netmsg.pas | 20 +++----------------- src/game/g_player.pas | 1 - 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/game/g_net.pas b/src/game/g_net.pas index 4eeeede..c15df2b 100644 --- a/src/game/g_net.pas +++ b/src/game/g_net.pas @@ -22,7 +22,7 @@ uses e_log, e_msg, ENet, Classes, MAPDEF{$IFDEF USE_MINIUPNPC}, miniupnpc;{$ELSE};{$ENDIF} const - NET_PROTOCOL_VER = 175; + NET_PROTOCOL_VER = 174; NET_MAXCLIENTS = 24; NET_CHANS = 11; diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 01dcc3c..a7ff31a 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -2759,9 +2759,6 @@ begin end; gPlayer1.ReleaseKeys; - gPlayer1.weaponSwitchKeysStateChange(-1, isKeyPressed(KeyNextWeapon, KeyNextWeapon2)); - gPlayer1.weaponSwitchKeysStateChange(-2, isKeyPressed(KeyPrevWeapon, KeyPrevWeapon2)); - if P1MoveButton = 1 then begin kByte := kByte or NET_KEY_LEFT; @@ -2789,20 +2786,11 @@ begin end; if isKeyPressed(KeyFire, KeyFire2) then kByte := kByte or NET_KEY_FIRE; if isKeyPressed(KeyOpen, KeyOpen2) then kByte := kByte or NET_KEY_OPEN; - if isKeyPressed(KeyNextWeapon, KeyNextWeapon2) and gPlayer1.isWeaponSwitchKeyReleased(-1) then kByte := kByte or NET_KEY_NW; - if isKeyPressed(KeyPrevWeapon, KeyPrevWeapon2) and gPlayer1.isWeaponSwitchKeyReleased(-2) then kByte := kByte or NET_KEY_PW; + if isKeyPressed(KeyNextWeapon, KeyNextWeapon2) then kByte := kByte or NET_KEY_NW; + if isKeyPressed(KeyPrevWeapon, KeyPrevWeapon2) then kByte := kByte or NET_KEY_PW; for I := 0 to High(KeyWeapon) do - begin if isKeyPressed(KeyWeapon[I], KeyWeapon2[I]) then - begin - gPlayer1.weaponSwitchKeysStateChange(i, true); - if gPlayer1.isWeaponSwitchKeyReleased(i) then WeaponSelect := WeaponSelect or Word(1 shl I); - end - else - begin - gPlayer1.weaponSwitchKeysStateChange(i, false); - end; - end; + WeaponSelect := WeaponSelect or Word(1 shl I); end; // fix movebutton state P1MoveButton := P1MoveButton or (strafeDir shl 4); @@ -2810,8 +2798,6 @@ begin else kByte := NET_KEY_CHAT; - gPlayer1.weaponSwitchKeysShiftNewStates(); - NetOut.Write(Byte(NET_MSG_PLRPOS)); NetOut.Write(gTime); NetOut.Write(kByte); diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 0921b78..f770a8c 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -4251,7 +4251,6 @@ begin Result := True; remove := True; FFireTime := 0; - //k8:do we need it? if g_Game_IsNet and g_Game_IsServer then MH_SEND_PlayerStats(FUID); end; if FHealth < PLAYER_HP_SOFT then begin -- 2.29.2