Fixed a bug in CheckWeaponAmmoCost (from Mr.Stalin)

It caused NPCs to not switch to other weapons when there is not enough
ammo to shoot.
Moved CheckWeaponAmmoCost code from Inventory.cpp to Combat.cpp.
Now the debug editor starts at the center of the screen.
Updated the previous fix in NPC combat control mod.
This commit is contained in:
NovaRain
2019-04-07 10:59:02 +08:00
parent d946850af4
commit 143f6895a4
6 changed files with 91 additions and 69 deletions
Binary file not shown.
+2 -2
View File
@@ -109,8 +109,8 @@ procedure invenwield_handler begin
event := get_sfall_arg;
// Fix weapon duplication when equipping in combat
if (event and AllowControl(obj_pid(critter))) then begin
set_flags(item, get_flags(item) bwand bwnot(FLAG_LEFT_HAND bwor FLAG_RIGHT_HAND));
if (event and slot == INVEN_TYPE_RIGHT_HAND and AllowControl(obj_pid(critter))) then begin
set_flags(item, get_flags(item) bwand bwnot(FLAG_LEFT_HAND));
end
end