So because caninsert() allways returns true if at least some of the given itemstack can be inserted. My question is, is there a workaround to check if the given itemstack can be inserted completly?
I was thinking about a function that needs same parameter than caninsert(), but returns true if the whole given stack can be inserted, otherwise it return the amount of items that can be inserted.
caninsert() function
Re: caninsert() function
Workaround would be. Get item count, try to insert the itemstack, get item count again, check difference between counts, remove inserted items and return value. Minor problem is that character has no remove method so you need to get all individual inventories and make the subtraction yourself.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Re: caninsert() function
Thanks that might work.
I found
in the scenariopack, some time ago
Actually that is not a problem.rk84 wrote:Minor problem is that character has no remove method so you need to get all individual inventories and make the subtraction yourself.
I found
Code: Select all
game.player.controller.removeitem{name,count}