powbot / issues

1 stars 0 forks source link

[BUG] API callbacks break when in a 'Loading' state. #209

Closed Protoprize closed 1 year ago

Protoprize commented 1 year ago

Describe the bug Started when the game state changes were added to the client. API will return broken/incorrect values if called when in that state. This ideally should just used the last cached values until the loading state is over. This is especially apparent on slower devices, seems to be fine on bluestacks with 2c/2gb

To Reproduce/Line of code causing issue Have item on torso, and poll Equipment.itemAt(Equipment.Slot.TORSO).valid()

Normally of course this returns true, but seems when it's in the loading state, it will return false.

constt commented 1 year ago

@Protoprize It's not really possible to "return the last cached values" as it would mean caching every single entity.

I've added a block to development which should make it wait until state == 30

Protoprize commented 1 year ago

Seems to be fixed now :)