Infinitay / essence-pouch-tracking

BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Issue with checking and quickly filling pouches #19

Closed Infinitay closed 6 days ago

Infinitay commented 1 week ago
  1. Check a pouch
  2. Quickly fill the pouch immediately afterwards

The following steps above results in an incorrect state. Since the check chat message comes on the next game time, it will override the stored essence after filling

For example:

  1. Check a pouch that has 0 essence -> Do nothing as we are waiting for the game to return the chat message
  2. Quickly fill a pouch with 12 essence -> Set the stored essence to 12
  3. Chat message is received the next tick -> Set the stored essence to 0 because that's what the game returned

It's a race condition by the game essentially due to the check pouch taking a game tick but pouch actions happen immediately.