summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d171935)
raw | patch | inline | side by side (parent: d171935)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 6 Aug 2017 12:31:39 +0000 (15:31 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 6 Aug 2017 12:32:27 +0000 (15:32 +0300) |
src/game/g_player.pas | patch | blob | history |
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index d7f305e68757bfb287d836b28dab9d398497155b..bfba263a40cf6fb9dbd08781f419d92a7b0b1f9d 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
for i := 0 to High(gPlayers) do
if gPlayers[i] <> nil then
+ begin
+ gPlayers[i].RealizeCurrentWeapon();
if gPlayers[i] is TPlayer then gPlayers[i].Update()
else TBot(gPlayers[i]).Update();
+ end;
end;
procedure g_Player_DrawAll();
var
i, cwi: Integer;
begin
- if dir < 0 then dir := 1 else if dir > 0 then dir := 1 else exit;
+ if dir < 0 then dir := -1 else if dir > 0 then dir := 1 else exit;
cwi := FCurrWeap;
for i := 0 to High(FWeapon) do
begin
- cwi := cwi+dir;
- if cwi < 0 then cwi += length(FWeapon)
- else if cwi > High(FWeapon) then cwi := cwi-length(FWeapon);
+ cwi := (cwi+length(FWeapon)+dir) mod length(FWeapon);
if FWeapon[cwi] then
begin
QueueWeaponSwitch(Byte(cwi));