Code edits to gl_npcarmor script

This commit is contained in:
NovaRain
2022-05-26 22:55:08 +08:00
parent e8652ca17b
commit 73ec85b01d
2 changed files with 6 additions and 5 deletions
Binary file not shown.
+6 -5
View File
@@ -224,12 +224,13 @@ procedure update_armor_apperance begin
end
procedure canuseweapon_handler begin
variable critter, canWield;
variable critter, canUse;
critter := get_sfall_arg;
if (critter != dude_obj and get_sfall_arg_at(3)) then begin
canWield := check_weapon_change(critter, get_sfall_arg, true);
// override result
set_sfall_arg(3, canWield);
set_sfall_return(canWield);
canUse := check_weapon_change(critter, get_sfall_arg, true);
if (canUse == false) then begin
set_sfall_arg(3, 0);
set_sfall_return(0); // overrides the result of engine function. Any non-zero value allows using the weapon
end
end
end