CommandHelper

CommandHelper

46.5k Downloads

set_pinv() run under bind gives item error

LadyCailinBot opened this issue ยท 3 comments

commented

CMDHELPER-2703 - Reported by baeshra

When I run set_pinv() under an alias, it works as expected: http://paste.thezomg.com/9865/99124313/

When I run the same code under a bind, the item held in the hand does not change. The sprite changes, but the function is not altered. Once the item is moved around in the inventory, it begins to function again. http://paste.thezomg.com/9866/70991345/

commented

Comment by Tom.Gebbett

I have not encountered this myself, but in the past i have encountered problems with items not appearing in the inventory at all. I used a _inv_refresh() function, which changes the inventory in a small way, then changes it back. I made it add a feather to the first free slot, then removed it in a 50 or 100ms timeout. It worked at the time in most cases, but there were still problems with items not appearing. I thought the issues were fixed now, but see if that helps anyway.

commented

Comment by PseudoKnight

This doesn't happen anymore, and arguably wasn't even a CH issue.

commented

Comment by PseudoKnight

Okay, I think this is just because it's replacing an item that is being USED during the interact event when the event is not cancelled. I'm not sure why it doesn't update the texture the second time, but there doesn't appear to be anything CH can do about it as this happens after the event is fully processed. A set_timeout would work, but canceling the event when you're replacing the item is better.

If there's any other bug like this (that doesn't happen when replacing an item that's being used without canceling the event), then we can reopen this.