Pokemon RB: Client: Send bounce messages with current map ID (#5121)

This commit is contained in:
James White
2025-06-20 21:52:54 +01:00
committed by GitHub
parent e0ae3359f1
commit c34e29c712

View File

@@ -23,6 +23,7 @@ DATA_LOCATIONS = {
"DexSanityFlag": (0x1A71, 19), "DexSanityFlag": (0x1A71, 19),
"GameStatus": (0x1A84, 0x01), "GameStatus": (0x1A84, 0x01),
"Money": (0x141F, 3), "Money": (0x141F, 3),
"CurrentMap": (0x1436, 1),
"ResetCheck": (0x0100, 4), "ResetCheck": (0x0100, 4),
# First and second Vermilion Gym trash can selection. Second is not used, so should always be 0. # First and second Vermilion Gym trash can selection. Second is not used, so should always be 0.
# First should never be above 0x0F. This is just before Event Flags. # First should never be above 0x0F. This is just before Event Flags.
@@ -65,6 +66,7 @@ class PokemonRBClient(BizHawkClient):
self.banking_command = None self.banking_command = None
self.game_state = False self.game_state = False
self.last_death_link = 0 self.last_death_link = 0
self.current_map = 0
async def validate_rom(self, ctx): async def validate_rom(self, ctx):
game_name = await read(ctx.bizhawk_ctx, [(0x134, 12, "ROM")]) game_name = await read(ctx.bizhawk_ctx, [(0x134, 12, "ROM")])
@@ -230,6 +232,10 @@ class PokemonRBClient(BizHawkClient):
}]) }])
self.banking_command = None self.banking_command = None
if data["CurrentMap"][0] != self.current_map:
await ctx.send_msgs([{"cmd": "Bounce", "slots": [ctx.slot], "data": {"currentMap": data["CurrentMap"][0]}}])
self.current_map = data["CurrentMap"][0]
# VICTORY # VICTORY
if data["EventFlag"][280] & 1 and not ctx.finished_game: if data["EventFlag"][280] & 1 and not ctx.finished_game: