diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index 3590bd43add3c68343b3c1535fe6d9b37cc5dee6..b7a0fdd903cc0fa4c4a1e6bae0f2a2ec333fc8f2 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
C^.Player := PID;
C^.WaitForFirstSpawn := false;
+ C^.AuthTime := 0;
g_Console_Add(Format(_lc[I_PLAYER_JOIN], [PName]), True);
e_WriteLog('NET: Client ' + PName + ' [' + IntToStr(C^.ID) +
PID: Word;
Pl: TPlayer;
I, OldFire: Integer;
+ checkWeapon: Boolean;
OldJet, Flam: Boolean;
NewTeam: Byte;
begin
NewTeam := M.ReadByte();
for I := WP_FIRST to WP_LAST do
- FWeapon[I] := (M.ReadByte() <> 0);
-
+ begin
+ checkWeapon := (M.ReadByte() <> 0);
+ if ( (gPlayer1Settings.WeaponSwitch = 0) and (gPlayer2Settings.WeaponSwitch = 0) ) or ( (I = WEAPON_KASTET) or (I = WEAPON_PISTOL) or (checkWeapon = False) or (FWeapon[I] = True) ) then
+ FWeapon[I] := checkWeapon
+ else
+ begin
+ if ((PID = gPlayer1.UID) and (gPlayer1Settings.WeaponSwitch <> 0)) or ( (gPlayer2 <> nil) and (PID = gPlayer2.UID) and (gPlayer2Settings.WeaponSwitch <> 0) ) then
+ begin
+ FWeapon[I] := True;
+ if (PID = gPlayer1.UID) then
+ if (gPlayer1Settings.WeaponSwitch = 1) or ( (gPlayer1Settings.WeaponSwitch = 2) and (gPlayer1Settings.WeaponPreferences[I] > gPlayer1Settings.WeaponPreferences[CurrWeap]) ) then
+ begin
+ gSelectWeapon[0, I] := True;
+ end
+ else
+ if (gPlayer2Settings.WeaponSwitch = 1) or ( (gPlayer2Settings.WeaponSwitch = 2) and (gPlayer2Settings.WeaponPreferences[I] > gPlayer2Settings.WeaponPreferences[CurrWeap]) ) then
+ gSelectWeapon[1, I] := True;
+ end
+ else
+ FWeapon[I] := checkWeapon;
+ end;
+ end;
for I := A_BULLETS to A_HIGH do
FAmmo[I] := M.ReadWord();
FRulez := FRulez + [R_KEY_GREEN];
if (M.ReadByte() <> 0) then
FRulez := FRulez + [R_KEY_BLUE];
- if (M.ReadByte() <> 0) then
+ checkWeapon := M.ReadByte() <> 0;
+ if (checkWeapon) then
+ begin
FRulez := FRulez + [R_BERSERK];
+ if ((gPlayer2Settings.WeaponSwitch <> 0) and (gPlayer2Settings.WeaponSwitch <> 0)) and ((PID = gPlayer1.UID) or ( (gPlayer2 <> nil) and (PID = gPlayer2.UID) )) then
+ begin
+ if (PID = gPlayer1.UID) then
+ begin
+ if (gPlayer1Settings.WeaponSwitch = 1) or ( (gPlayer1Settings.WeaponSwitch = 2) and (gPlayer1Settings.WeaponPreferences[WP_LAST+1] > gPlayer1Settings.WeaponPreferences[CurrWeap]) ) then
+ begin
+ gSelectWeapon[0, WEAPON_KASTET] := True;
+ end;
+ end
+ else
+ begin
+ if (gPlayer2Settings.WeaponSwitch = 1) or ( (gPlayer2Settings.WeaponSwitch = 2) and (gPlayer2Settings.WeaponPreferences[WP_LAST+1] > gPlayer2Settings.WeaponPreferences[CurrWeap]) ) then
+ begin
+ gSelectWeapon[0, WEAPON_KASTET] := True;
+ end;
+ end;
+ end;
+ end;
Frags := M.ReadLongInt();
Death := M.ReadLongInt();
NetOut.Write(gPlayer1Settings.Color.G);
NetOut.Write(gPlayer1Settings.Color.B);
NetOut.Write(gPlayer1Settings.Team);
-
g_Net_Client_Send(True, NET_CHAN_IMPORTANT);
end;