DEADSOFTWARE

Revert "network: server is weapon authority!"
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Fri, 4 Jan 2019 19:58:37 +0000 (22:58 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Fri, 4 Jan 2019 19:58:37 +0000 (22:58 +0300)
src/game/g_netmsg.pas
src/game/g_player.pas

index e9cc68c2ee55ac7fcb0067073ed725ecdedd6e9e..f235035fbda6d740146eb383d07d4e66e740948f 100644 (file)
@@ -464,7 +464,7 @@ begin
       writeln('HOST PLRPOS: got: currweap=', CurrWeap, '; curfrm=', gTime, '; netweap=', newweapon, '; oldweap=', CurrWeap);
 {$ENDIF}
       //NetForceWeap := newweapon;
-      SetWeaponHost(newweapon);
+      SetWeapon(newweapon);
     end;
     //e_WriteLog(Format('R:ws=%d', [WeaponSelect]), MSG_WARNING);
     if Direction <> TDirection(Dir) then
@@ -2150,7 +2150,7 @@ begin
     if (gTime >= NetForceWeapFIdx) then
     begin
       //NetForceWeap := newweapon;
-      SetWeaponHost(newweapon);
+      SetWeapon(newweapon);
     end;
     //SetWeapon(M.ReadByte());
 
index 9351a9d38b6937455c5f9d50233b4f0ca071cbc4..c9a640682a1d0cfea8ad3c6cfb6dcdd45a91155f 100644 (file)
@@ -280,7 +280,7 @@ type
     procedure   ReleaseKeysNoWeapon();
     procedure   SetModel(ModelName: String);
     procedure   SetColor(Color: TRGB);
-    procedure   SetWeaponHost(W: Byte);
+    procedure   SetWeapon(W: Byte);
     function    IsKeyPressed(K: Byte): Boolean;
     function    GetKeys(): Byte;
     function    PickItem(ItemType: Byte; arespawn: Boolean; var remove: Boolean): Boolean; virtual;
@@ -3908,12 +3908,9 @@ begin
   FNextWeap := $4000;
 end;
 
-// used exclusively by network layer
-procedure TPlayer.SetWeaponHost(W: Byte);
+// used by network layer
+procedure TPlayer.SetWeapon(W: Byte);
 begin
-  if (W > High(FWeapon)) then exit;
-  if (not FWeapon[W]) then exit; // server is authority!
-
   if FCurrWeap <> W then
     if (W = WEAPON_SAW) then
       FSawSoundSelect.PlayAt(FObj.X, FObj.Y);