Fix fakematchings and warnings in overworld.c

This commit is contained in:
AZero13 2026-04-05 16:27:42 -04:00
parent 30185ea16b
commit 833a56bbe6

View File

@ -131,7 +131,7 @@ static void UpdateAllLinkPlayers(u16 *, s32);
static u8 FlipVerticalAndClearForced(u8, u8);
static u8 LinkPlayerGetCollision(u8, u8, s16, s16);
static void CreateLinkPlayerSprite(u8, u8);
static void GetLinkPlayerCoords(u8, u16 *, u16 *);
static void GetLinkPlayerCoords(u8, s16 *, s16 *);
static u8 GetLinkPlayerFacingDirection(u8);
static u8 GetLinkPlayerElevation(u8);
static u8 GetLinkPlayerIdAt(s16, s16);
@ -2995,7 +2995,7 @@ static u8 GetSpriteForLinkedPlayer(u8 linkPlayerId)
return objEvent->spriteId;
}
static void GetLinkPlayerCoords(u8 linkPlayerId, u16 *x, u16 *y)
static void GetLinkPlayerCoords(u8 linkPlayerId, s16 *x, s16 *y)
{
u8 objEventId = gLinkPlayerObjectEvents[linkPlayerId].objEventId;
struct ObjectEvent *objEvent = &gObjectEvents[objEventId];
@ -3017,7 +3017,7 @@ static u8 GetLinkPlayerElevation(u8 linkPlayerId)
return objEvent->currentElevation;
}
static s32 UNUSED GetLinkPlayerObjectStepTimer(u8 linkPlayerId)
static s16 UNUSED GetLinkPlayerObjectStepTimer(u8 linkPlayerId)
{
u8 objEventId = gLinkPlayerObjectEvents[linkPlayerId].objEventId;
struct ObjectEvent *objEvent = &gObjectEvents[objEventId];
@ -3046,26 +3046,18 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing)
u8 objEventId = linkPlayerObjEvent->objEventId;
struct ObjectEvent *objEvent = &gObjectEvents[objEventId];
if (linkPlayerObjEvent->active)
if (!linkPlayerObjEvent->active)
return;
if (facing > FACING_FORCED_RIGHT)
{
if (facing > FACING_FORCED_RIGHT)
{
objEvent->triggerGroundEffectsOnMove = TRUE;
}
else
{
// This is a hack to split this code onto two separate lines, without declaring a local variable.
// C++ style inline variables would be nice here.
#define TEMP sLinkPlayerMovementModes[linkPlayerObjEvent->movementMode](linkPlayerObjEvent, objEvent, facing)
sMovementStatusHandler[TEMP](linkPlayerObjEvent, objEvent);
// Clean up the hack.
#undef TEMP
}
objEvent->triggerGroundEffectsOnMove = TRUE;
return;
}
}
sMovementStatusHandler[sLinkPlayerMovementModes[linkPlayerObjEvent->movementMode](
linkPlayerObjEvent, objEvent, facing)](linkPlayerObjEvent, objEvent);
}
static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir)
{