mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
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:
@@ -296,9 +296,11 @@
|
||||
id: HOOK_AMMOCOST
|
||||
doc: |
|
||||
Runs when calculating ammo cost for a weapon. Doesn't affect damage, only how much ammo is spent.<br>
|
||||
By default, weapons can make attacks when at least 1 ammo is left, regardless of ammo cost calculations.<br>
|
||||
By default, a weapon can perform an attack with at least one ammo, regardless of ammo cost calculation.<br>
|
||||
To add proper check for ammo before attacking and proper calculation of the number of burst rounds (hook type 1 and 2 in `arg3`), set **CheckWeaponAmmoCost=1** in **Misc** section of ddraw.ini.
|
||||
|
||||
__NOTE:__ The return value must be greater than or equal to 0 to be valid.
|
||||
|
||||
```
|
||||
Item arg0 - The weapon
|
||||
int arg1 - Number of bullets in burst or 1 for single shots
|
||||
|
||||
Reference in New Issue
Block a user