Fix virtual object events

This commit is contained in:
Jaizu 2024-05-19 12:41:51 +02:00
parent d785fad8cf
commit 2358ee88e3
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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);