From 2358ee88e375ee9dd2a6b850c6a7642795e51eb1 Mon Sep 17 00:00:00 2001 From: Jaizu Date: Sun, 19 May 2024 12:41:51 +0200 Subject: [PATCH] Fix virtual object events --- asm/macros/event.inc | 2 +- src/scrcmd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index ef1ba30270..25f688aff1 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1347,7 +1347,7 @@ @ The specified id can be used to refer to the sprite again later with turnvobject. .macro createvobject graphicsId:req, id:req, x:req, y:req, elevation=3, direction=DIR_SOUTH .byte 0xaa - .byte \graphicsId + .2byte \graphicsId .byte \id .2byte \x .2byte \y diff --git a/src/scrcmd.c b/src/scrcmd.c index a3531d3094..64c8c9880c 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1210,10 +1210,10 @@ bool8 ScrCmd_setobjectmovementtype(struct ScriptContext *ctx) bool8 ScrCmd_createvobject(struct ScriptContext *ctx) { - u16 graphicsId = ScriptReadByte(ctx); // Support u16 in createvobject + u16 graphicsId = ScriptReadHalfWord(ctx); // Support u16 in createvobject u8 virtualObjId = ScriptReadByte(ctx); u16 x = VarGet(ScriptReadHalfword(ctx)); - u32 y = VarGet(ScriptReadHalfword(ctx)); + u16 y = VarGet(ScriptReadHalfword(ctx)); u8 elevation = ScriptReadByte(ctx); u8 direction = ScriptReadByte(ctx);