Tweaked HOOK_INVENTORYMOVE for dropping caps

* before the amount was set in the dropped object only after the hook.

Edits to hook script documents.
This commit is contained in:
NovaRain
2022-10-29 11:32:25 +08:00
parent 3b8d2a4527
commit f7d94e16c9
5 changed files with 50 additions and 19 deletions
+6
View File
@@ -408,6 +408,7 @@
id: HOOK_INVENTORYMOVE
doc: |
Runs before moving items between inventory slots in dude interface. You can override the action.
What you can NOT do with this hook:
- force moving items to inappropriate slots (like gun in armor slot)
What you can do:
@@ -432,6 +433,11 @@
int ret0 - Override setting (-1 - use engine handler, any other value - prevent relocation of item/reloading weapon/picking up item)
```
Notes for the event of dropping items on the ground:
- the event is called for each item when dropping multiple items from the stack
- for ammo type items, the number of dropped ammo in a pack can be found by using the `get_weapon_ammo_count` function
- for the `PID_BOTTLE_CAPS` item, the event is called only once, and the number of dropped units can be found from the value of the `OBJ_DATA_CUR_CHARGES` object field (or with the `get_weapon_ammo_count` function)
- name: InvenWield
id: HOOK_INVENWIELD
doc: |