MSUTeam / MSU

Modding Standards and Utilities for Battle Brothers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[REQUEST] Implement way to know where the destination of a null item is in 'getItemActionCost'

Darxo opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
The MSU function getItemActionCost from the skill.nut is called with an array of items.
In Vanilla the first item is always the source item and never null. (Though this is not enforced anywhere)
The second item in this array (if it exists) is the destination but it can be null, which means that the destination is an empty slot.

Problem:
If one of the items to switch is null then it is not possible to know where this destination slot for the transfer is located.
It could be either an equipped slot, a bag slot or the ground below.

But this detail is useful for certain skills that give discounts only under specific circumstances.
E.g. when dropping items on the ground or when moving items into specific empty slots.

Describe the solution you'd like
I haven't thought about a good solution at this point

Additional context
Search for the function helper_isActionAllowed in vanilla to see how this item array is formed there.

Other mods (like for example Enduriels Extra Keybinds) may call the function helper_isActionAllowed aswell.