From 67f8a61eef101d197c1f95524f4f8682a7258d0c Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Wed, 14 Aug 2024 19:44:18 -0700 Subject: [PATCH] Moved current and template positions to headers --- asm/macros/event.inc | 17 +++++++++++++---- include/constants/field_specials.h | 5 +++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index ac008119ef..7b4bca1170 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -2328,16 +2328,25 @@ .2byte \itemId .endm - CURRENT_POSITION = FALSE - TEMPLATE_POSITION = TRUE - - @ Stores the CURRENT / TEMPLATE position of the given object in VAR_0x8007 (x) and VAR_0x8008 (y) + @ Stores the position of the given object in VAR_0x8007 (x) and VAR_0x8008 (y). Mode CURRENT_POSITION will take the object's current position. Mode TEMPLATE_POSITION will takje the object's template position. .macro getobjectxy localId:req, posType:req setvar VAR_0x8000, \localId setvar VAR_0x8001, \posType special GetObjectPosition .endm + .macro getobjecttemplatexy localId:req + setvar VAR_0x8000, \localId + setvar VAR_0x8001, TEMPLATE_POSITION + special GetObjectPosition + .endm + + .macro getobjectcurrentxy localId:req + setvar VAR_0x8000, \localId + setvar VAR_0x8001, CURRENT_POSITION + special GetObjectPosition + .endm + @ checks if there is any object at a given position .macro checkobjectat x:req, y:req setorcopyvar VAR_0x8005, \x diff --git a/include/constants/field_specials.h b/include/constants/field_specials.h index 35769ba3b1..64a105a5fd 100644 --- a/include/constants/field_specials.h +++ b/include/constants/field_specials.h @@ -91,4 +91,9 @@ enum { NO_PARTY_SCREEN }; +enum { + CURRENT_POSITION, + TEMPLATE_POSITION +}; + #endif // GUARD_CONSTANTS_FIELD_SPECIALS_H