mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Code changes to the previous commit
Changed HOOK_CANUSEWEAPON to run for both the player and NPCs. Updated gl_npcarmor script.
This commit is contained in:
Binary file not shown.
@@ -65,7 +65,7 @@ procedure check_weapon_change(variable critter, variable weapon, variable isWiel
|
||||
weaponAnimList := npc["WeaponAnims"];
|
||||
if (weaponAnimList != 0) then begin
|
||||
foreach (i in string_split(weaponAnimList, ",")) begin
|
||||
if (newWeaponAnim == atoi(i)) then return -1; // can use (engine default)
|
||||
if (newWeaponAnim == atoi(i) and not(weapon_is_unusable(weapon))) then return -1; // can use (engine default)
|
||||
end
|
||||
end
|
||||
return 0; // can't use
|
||||
@@ -226,10 +226,10 @@ end
|
||||
procedure canuseweapon_handler begin
|
||||
variable critter, canWield;
|
||||
critter := get_sfall_arg;
|
||||
//if (critter) then begin
|
||||
if (critter != dude_obj) then begin
|
||||
canWield := check_weapon_change(critter, get_sfall_arg, true);
|
||||
// override result
|
||||
set_sfall_arg(3, canWield);
|
||||
set_sfall_return(canWield);
|
||||
//end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user