Fixed NPC armor appearance mod preventing other critters from using weapons due to incorrect return value in check_weapon_change() (#222)

This commit is contained in:
NovaRain
2018-12-16 08:57:38 +08:00
parent 651f23aa5b
commit f33f356b7a
2 changed files with 3 additions and 2 deletions
+3 -2
View File
@@ -53,12 +53,13 @@ procedure check_weapon_change(variable critter, variable item, variable isWield)
foreach (i in weaponAnimList) begin
if (newWeaponAnim == atoi(i)) then return -1;
end
return 0;
end else begin // anim code 0 - none/unarmed
return -1;
end
end
end
return 0;
return -1;
end
// for NPCs when they change armor/weapon themselves
@@ -76,7 +77,7 @@ procedure invenwield_handler begin
end
end
if (critter and item and (slot == INVEN_TYPE_RIGHT_HAND or slot == INVEN_TYPE_LEFT_HAND)) then begin
if (critter and item and slot == INVEN_TYPE_RIGHT_HAND) then begin
canWield := check_weapon_change(critter, item, isWorn);
set_sfall_return(canWield);
end