X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_netmsg.pas;h=3701038e76d8f3063378d92364612cdbab798973;hb=86d45dd42fd3cf9c183883e4ab1abe5b607e1779;hp=3590bd43add3c68343b3c1535fe6d9b37cc5dee6;hpb=1ff17b72a3780a18e413d0d30ed4f3393c826aeb;p=d2df-sdl.git diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 3590bd4..3701038 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -455,6 +455,7 @@ begin 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) + @@ -2446,6 +2447,7 @@ var PID: Word; Pl: TPlayer; I, OldFire: Integer; + checkWeapon: Boolean; OldJet, Flam: Boolean; NewTeam: Byte; begin @@ -2467,8 +2469,19 @@ begin NewTeam := M.ReadByte(); for I := WP_FIRST to WP_LAST do - FWeapon[I] := (M.ReadByte() <> 0); - + begin + checkWeapon := (M.ReadByte() <> 0); + if ( ((PID = gPlayer1.UID) or ( (gPlayer2 <> nil) and (PID = gPlayer2.UID))) and (I <> WEAPON_PISTOL) and (I <> WEAPON_KASTET ) and (gWeaponAutoswitch = True)) then + begin + if ( (checkWeapon = True) and (FWeapon[I] = False) ) then + begin + FWeapon[I] := True; + if (PID = gPlayer1.UID) then gSelectWeapon[0, I] := True + else gSelectWeapon[1, I] := True; + end; + end; + FWeapon[I] := checkWeapon; + end; for I := A_BULLETS to A_HIGH do FAmmo[I] := M.ReadWord();