Thedragon005 / Archipelago-Ape-Escape

Archipelago Multi-Game Randomizer and Server
https://archipelago.gg
Other
0 stars 0 forks source link

Bug: Coin detection fails il you reset the game without closing Bizhawk #20

Closed Thedragon005 closed 1 week ago

Thedragon005 commented 1 week ago

What happened?

This is a minor fix but it could arise when reseting the game. When you disconnect and reconnect to Bizhawk it does not reset the coin lookup address,which means it could be offset and not work as intended unless you close completely Bizhawk and reopen it

What were the expected results?

Players should at least have a way to disconnect/reconnect to ensure coins track properly Check when the client is disconnected and change the address back to starting one if you reconnect

Software

While playing

Thedragon005 commented 1 week ago

Commit b004b5ba41bbdb003145fb9234f312897a88a81b fixed it.

Added code to detect if client is connected or not, to send nothing to AP when not connected. On connection it will trigger a custom init function only once : initialize_client()

This function currently reset the lookup address for the coins back to the starting one, so it can detect all the coins again if needed

We can add more to the initialize_client() function if we need to reset variables on AP connection