Incremental improvement of getobjectfacing

This commit is contained in:
pkmnsnfrn 2024-08-12 06:51:09 -07:00
parent f0d5b68f70
commit 881e54a52b
2 changed files with 4 additions and 4 deletions

View file

@ -2408,6 +2408,7 @@
@ Gets the facing direction of a given event object and stores it in the variable \dest. @ Gets the facing direction of a given event object and stores it in the variable \dest.
.macro getobjectfacingdirection evObjId:req, dest:req .macro getobjectfacingdirection evObjId:req, dest:req
setvar VAR_TEMP_1, \evObjId setvar VAR_0x8005, \evObjId
specialvar \dest, Script_GetObjectFacingDirection specialvar \dest, Script_GetObjectFacingDirection
.endm .endm

View file

@ -10633,9 +10633,8 @@ void GetDaycareGraphics(struct ScriptContext *ctx)
gSpecialVar_Result = i; gSpecialVar_Result = i;
} }
u8 Script_GetObjectFacingDirection(void) u32 Script_GetObjectFacingDirection(void)
{ {
u8 objId = GetObjectEventIdByLocalId(VarGet(VAR_TEMP_1)); return gObjectEvents[GetObjectEventIdByLocalId(gSpecialVar_0x8005)].facingDirection;
return gObjectEvents[objId].facingDirection;
} }