DEADSOFTWARE

fix: we can have more priorities than "real" weapons (consider berserk knuckles and...
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Sat, 29 Sep 2018 20:37:06 +0000 (23:37 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Sat, 29 Sep 2018 20:39:07 +0000 (23:39 +0300)
src/game/g_player.pas

index da7e6d2eea8f7a52fac7bb5dcdc366e3e20e50d9..e0a04f5354833be34d1bbe88fdeb8877a5237820 100644 (file)
@@ -3709,14 +3709,14 @@ begin
 
   // find next weapon to switch onto
   cwi := curlidx;
-  for i := 0 to High(FWeapon) do
+  for i := 0 to High(weaponOrder) do
   begin
-    cwi := (cwi+length(FWeapon)+1) mod length(FWeapon);
+    cwi := (cwi+length(weaponOrder)+1) mod length(weaponOrder);
     if (cwi = curlidx) then continue; // skip current weapon
     if not wantThisWeapon[cwi] then continue;
     rwidx := weaponOrder[cwi];
     if (rwidx < 0) then continue;
-    //e_WriteLog(Format('  trying logical %d (real %d)', [cwi, rwidx]), TMsgType.Warning);
+    //e_WriteLog(Format('  trying logical %d (real %d); has=%d, hasammo=%d', [cwi, rwidx, Integer(FWeapon[rwidx]), Integer(hasAmmoForWeapon(rwidx))]), TMsgType.Warning);
     if FWeapon[rwidx] and ((wwc = 1) or hasAmmoForWeapon(rwidx)) then
     begin
       //e_WriteLog('    I FOUND HER!', TMsgType.Warning);