From adeff4f6d22ae0356668340d751e922b74f5a928 Mon Sep 17 00:00:00 2001 From: vulcandth Date: Mon, 14 Aug 2023 09:19:25 -0500 Subject: [PATCH] Define relationship between map_object and object_events (#1054) --- constants/map_object_constants.asm | 1 + constants/script_constants.asm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/constants/map_object_constants.asm b/constants/map_object_constants.asm index ada9a984f0..e44c2825b4 100644 --- a/constants/map_object_constants.asm +++ b/constants/map_object_constants.asm @@ -97,6 +97,7 @@ DEF RELATIVE_ATTRIBUTES EQU 1 << RELATIVE_ATTRIBUTES_F DEF ABSOLUTE_TILE_ID EQU 1 << ABSOLUTE_TILE_ID_F ; map_object struct members (see macros/ram.asm) +; struct initialized by object_event macro (see macros/scripts/maps.asm) rsreset DEF MAPOBJECT_OBJECT_STRUCT_ID rb ; 0 DEF MAPOBJECT_SPRITE rb ; 1 diff --git a/constants/script_constants.asm b/constants/script_constants.asm index 30b1eae400..15ed96c007 100644 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -113,7 +113,8 @@ DEF CALLBACK_SIZE EQU 3 ; callback DEF WARP_EVENT_SIZE EQU 5 ; warp_event DEF COORD_EVENT_SIZE EQU 8 ; coord_event DEF BG_EVENT_SIZE EQU 5 ; bg_event -DEF OBJECT_EVENT_SIZE EQU 13 ; object_event +; An object_event is a map_object without its initial MAPOBJECT_OBJECT_STRUCT_ID or final padding +DEF OBJECT_EVENT_SIZE EQU MAPOBJECT_LENGTH - 3 ; 13 ; A coord_event for scene -1 will always activate, ; regardless of the map's scene variable value.