From: DeaDDooMER Date: Fri, 4 Jan 2019 19:58:37 +0000 (+0300) Subject: Revert "network: server is weapon authority!" X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=commitdiff_plain;h=54f428b595b4d7982f63a2adae9d72291b57784f Revert "network: server is weapon authority!" This reverts commit 249437fb26187bc1db9b35f59ad597e169ec9c01. --- diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index e9cc68c..f235035 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -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()); diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 9351a9d..c9a6406 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -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);