getobjectfacingdirection
This commit is contained in:
parent
262505589a
commit
7f5ecd8d0f
3 changed files with 14 additions and 0 deletions
|
@ -2392,3 +2392,9 @@
|
|||
goto_if_eq VAR_RESULT, TRUE, \script
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@ Gets the facing direction of a given event object and stores it in the variable \dest.
|
||||
.macro getobjectfacingdirection evObjId:req, dest:req
|
||||
setvar VAR_TEMP_1, \evObjId
|
||||
specialvar \dest, Script_GetObjectFacingDirection
|
||||
.endm
|
||||
|
|
|
@ -562,3 +562,4 @@ gSpecials::
|
|||
def_special SetCaughtMon
|
||||
def_special SetMonBall
|
||||
def_special CheckPartyForMon
|
||||
def_special Script_GetObjectFacingDirection
|
||||
|
|
|
@ -10632,3 +10632,10 @@ void GetDaycareGraphics(struct ScriptContext *ctx)
|
|||
}
|
||||
gSpecialVar_Result = i;
|
||||
}
|
||||
|
||||
u8 Script_GetObjectFacingDirection(void)
|
||||
{
|
||||
u8 objId = GetObjectEventIdByLocalId(VarGet(VAR_TEMP_1));
|
||||
return gObjectEvents[objId].facingDirection;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue