From 3f4b3ee96fe9c2f0d13c89be5be98fa31213c35c Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Wed, 2 Jul 2025 18:32:31 -0400 Subject: Check limits for warp, bg, and object events --- ram/wram.asm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ram') diff --git a/ram/wram.asm b/ram/wram.asm index 4e3e6411..504eb646 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -1826,13 +1826,13 @@ wDestinationWarpID:: db ds 128 -; number of signs in the current map (up to 16) +; number of signs in the current map (up to MAX_BG_EVENTS) wNumSigns:: db -wSignCoords:: ds 16 * 2 ; Y, X -wSignTextIDs:: ds 16 +wSignCoords:: ds MAX_BG_EVENTS * 2 ; Y, X +wSignTextIDs:: ds MAX_BG_EVENTS -; number of sprites on the current map (up to 16) +; number of sprites on the current map (up to MAX_OBJECT_EVENTS) wNumSprites:: db ; these two variables track the X and Y offset in blocks from the last special warp used @@ -1840,8 +1840,8 @@ wNumSprites:: db wYOffsetSinceLastSpecialWarp:: db wXOffsetSinceLastSpecialWarp:: db -wMapSpriteData:: ds 16 * 2 ; movement byte 2, text ID -wMapSpriteExtraData:: ds 16 * 2 ; trainer class/item ID, trainer set ID +wMapSpriteData:: ds MAX_OBJECT_EVENTS * 2 ; movement byte 2, text ID +wMapSpriteExtraData:: ds MAX_OBJECT_EVENTS * 2 ; trainer class/item ID, trainer set ID ; map height in 2x2 meta-tiles wCurrentMapHeight2:: db -- cgit v1.3.1-sl0p