If it's local, it must be defined (lexically) before use, i.e. move the definition above BankService.moveMyItems. Or make it BankService.findEmptySlotInBag. Global namespace is shared among all ZOS and add-on code, it's best to put as few things in there as possible.
Btw you're skipping slots with findEmptySlotInBag(BAG_BANK, emptyIndex+1, ...); drop the +1, it's added in the function.
Last edited by merlight : 09/17/15 at 04:44 PM.
|