X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=caddc0d9e7612dfa230b9676b010a95373bb6cbb;hp=f2a98ff8aedc6f6f86c10b39ed904677955781fc;hb=7cd1c130359bef86087eaefe317526775e8ad4f8;hpb=681c1fa10d6cc9999d4cd0a284723fa0a8f4dec6 diff --git a/src/game/g_player.pas b/src/game/g_player.pas index f2a98ff..caddc0d 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -287,6 +287,7 @@ type procedure NetFire(Wpn: Byte; X, Y, AX, AY: Integer; WID: Integer = -1); procedure DoLerp(Level: Integer = 2); procedure SetLerp(XTo, YTo: Integer); + procedure ForceWeapon(Weapon: Byte); procedure JetpackOn; procedure JetpackOff; @@ -3250,6 +3251,30 @@ begin 150, 0, 0); end; +procedure TPlayer.ForceWeapon(Weapon: Byte); +var + i: Byte; +begin + if g_Game_IsClient then Exit; + if Weapon > High(FWeapon) then Exit; + if FBFGFireCounter <> -1 then Exit; + + if FTime[T_SWITCH] > gTime then Exit; + + for i := WEAPON_KASTET to WEAPON_SUPERPULEMET do + if FReloading[i] > 0 then Exit; + + if FWeapon[Weapon] then + begin + FCurrWeap := Weapon; + FTime[T_SWITCH] := gTime+156; + if FCurrWeap = WEAPON_SAW then + FSawSoundSelect.PlayAt(FObj.X, FObj.Y); + FModel.SetWeapon(FCurrWeap); + if g_Game_IsNet then MH_SEND_PlayerStats(FUID); + end; +end; + procedure TPlayer.NextWeapon(); var i: Byte;