DEADSOFTWARE

cosmetic fix in weapon queue updating (for bots, mostly)
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Sun, 6 Aug 2017 12:53:27 +0000 (15:53 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Sun, 6 Aug 2017 12:54:21 +0000 (15:54 +0300)
src/game/g_player.pas

index bfba263a40cf6fb9dbd08781f419d92a7b0b1f9d..5430ba709c848c985c8d6c5ffedafe296143c09d 100644 (file)
@@ -1272,9 +1272,16 @@ begin
   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();
+      if gPlayers[i] is TPlayer then
+      begin
+        gPlayers[i].Update();
+        gPlayers[i].RealizeCurrentWeapon(); // WARNING! DO NOT MOVE THIS INTO `Update()`!
+      end
+      else
+      begin
+        // bot updates weapons in `UpdateCombat()`
+        TBot(gPlayers[i]).Update();
+      end;
     end;
 end;
 
@@ -6526,6 +6533,10 @@ begin
     begin
       UpdateMove();
       UpdateCombat();
+    end
+    else
+    begin
+      RealizeCurrentWeapon();
     end;
   end;