Fixed "divided by zero" error when returning 0 in AMMOCOST hook

* with CheckWeaponAmmoCost=1.

Added a value check to the return value of AMMOCOST hook.
Updated hookscripts.md to reflect this change.
This commit is contained in:
NovaRain
2023-05-18 10:02:07 +08:00
parent ff1c87f0c5
commit 637de0e07d
4 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -622,7 +622,7 @@ ExplosionsEmitLight=0
;MovieTimer_artimer4=360
;Set to 1 to add proper check for ammo before attacking and proper calculation of the number of burst rounds
;By default, weapons can make attacks when at least one ammo is left, regardless of ammo cost calculations
;By default, a weapon can perform an attack with at least one ammo, regardless of ammo cost calculation
;Note that enabling this option will prevent super cattle prods and mega power fists from attacking with only one ammo left
CheckWeaponAmmoCost=0