More style fixes.

This commit is contained in:
Eduardo Quezada 2024-05-18 11:39:46 -04:00
parent 9dd0395852
commit 06094a2137

View file

@ -1482,7 +1482,9 @@ static s16 ReallocSpriteTiles(struct Sprite *sprite, u32 byteSize)
CpuFastFill16(0, (u8 *)OBJ_VRAM0 + TILE_SIZE_4BPP * i, byteSize); CpuFastFill16(0, (u8 *)OBJ_VRAM0 + TILE_SIZE_4BPP * i, byteSize);
sprite->oam.tileNum = i; sprite->oam.tileNum = i;
} }
} else { }
else
{
i = -1; i = -1;
} }
@ -2113,8 +2115,7 @@ void RemoveFollowingPokemon(void)
// Determine whether follower *should* be visible // Determine whether follower *should* be visible
static bool32 IsFollowerVisible(void) static bool32 IsFollowerVisible(void)
{ {
return return !(TestPlayerAvatarFlags(FOLLOWER_INVISIBLE_FLAGS)
!(TestPlayerAvatarFlags(FOLLOWER_INVISIBLE_FLAGS)
|| MetatileBehavior_IsSurfableWaterOrUnderwater(gObjectEvents[gPlayerAvatar.objectEventId].previousMetatileBehavior) || MetatileBehavior_IsSurfableWaterOrUnderwater(gObjectEvents[gPlayerAvatar.objectEventId].previousMetatileBehavior)
|| MetatileBehavior_IsForcedMovementTile(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior)); || MetatileBehavior_IsForcedMovementTile(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior));
} }
@ -2239,16 +2240,20 @@ bool32 CheckMsgInfo(const struct FollowerMsgInfoExtended *info, struct Pokemon *
{ {
// any condition matches // any condition matches
for (i = 0; i < ARRAY_COUNT(info->conditions) && info->conditions[i].type; i++) for (i = 0; i < ARRAY_COUNT(info->conditions) && info->conditions[i].type; i++)
{
if (CheckMsgCondition(&info->conditions[i], mon, species, obj)) if (CheckMsgCondition(&info->conditions[i], mon, species, obj))
return TRUE; return TRUE;
}
return FALSE; return FALSE;
} }
else else
{ {
// all conditions must match // all conditions must match
for (i = 0; i < ARRAY_COUNT(info->conditions) && info->conditions[i].type; i++) for (i = 0; i < ARRAY_COUNT(info->conditions) && info->conditions[i].type; i++)
{
if (!CheckMsgCondition(&info->conditions[i], mon, species, obj)) if (!CheckMsgCondition(&info->conditions[i], mon, species, obj))
return FALSE; return FALSE;
}
return TRUE; return TRUE;
} }
} }
@ -5275,8 +5280,7 @@ bool8 MovementType_FollowPlayer_Shadow(struct ObjectEvent *objectEvent, struct S
{ {
// Shadow player's position // Shadow player's position
objectEvent->invisible = TRUE; objectEvent->invisible = TRUE;
MoveObjectEventToMapCoords( MoveObjectEventToMapCoords(objectEvent,
objectEvent,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x, gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y
); );
@ -5287,8 +5291,7 @@ bool8 MovementType_FollowPlayer_Shadow(struct ObjectEvent *objectEvent, struct S
// This way the player cannot talk to the invisible follower before it appears // This way the player cannot talk to the invisible follower before it appears
if (objectEvent->invisible) if (objectEvent->invisible)
{ {
MoveObjectEventToMapCoords( MoveObjectEventToMapCoords(objectEvent,
objectEvent,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x, gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x,
gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y
); );
@ -5357,8 +5360,11 @@ bool8 FollowablePlayerMovement_Idle(struct ObjectEvent *objectEvent, struct Spri
{ {
// finish movement action // finish movement action
objectEvent->singleMovementActive = 0; objectEvent->singleMovementActive = 0;
} else if (OW_MON_BOBBING == TRUE && (sprite->data[3] & 7) == 2) }
else if (OW_MON_BOBBING == TRUE && (sprite->data[3] & 7) == 2)
{
sprite->y2 ^= -1; sprite->y2 ^= -1;
}
UpdateFollowerTransformEffect(objectEvent, sprite); UpdateFollowerTransformEffect(objectEvent, sprite);
return FALSE; return FALSE;
} }
@ -5483,9 +5489,7 @@ bool8 FollowablePlayerMovement_GoSpeed1(struct ObjectEvent *objectEvent, struct
ObjectEventMoveDestCoords(objectEvent, direction, &x, &y); ObjectEventMoveDestCoords(objectEvent, direction, &x, &y);
ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkFastMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkFastMovementAction(direction));
if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y))))
{
ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction));
}
objectEvent->singleMovementActive = TRUE; objectEvent->singleMovementActive = TRUE;
sprite->sTypeFuncId = 2; sprite->sTypeFuncId = 2;
return TRUE; return TRUE;
@ -5502,9 +5506,7 @@ bool8 FollowablePlayerMovement_GoSpeed2(struct ObjectEvent *objectEvent, struct
ObjectEventMoveDestCoords(objectEvent, direction, &x, &y); ObjectEventMoveDestCoords(objectEvent, direction, &x, &y);
ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkFasterMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkFasterMovementAction(direction));
if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y))))
{
ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction));
}
objectEvent->singleMovementActive = TRUE; objectEvent->singleMovementActive = TRUE;
sprite->sTypeFuncId = 2; sprite->sTypeFuncId = 2;
return TRUE; return TRUE;
@ -5521,9 +5523,7 @@ bool8 FollowablePlayerMovement_Slide(struct ObjectEvent *objectEvent, struct Spr
ObjectEventMoveDestCoords(objectEvent, direction, &x, &y); ObjectEventMoveDestCoords(objectEvent, direction, &x, &y);
ObjectEventSetSingleMovement(objectEvent, sprite, GetSlideMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetSlideMovementAction(direction));
if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y))))
{
ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction));
}
objectEvent->singleMovementActive = TRUE; objectEvent->singleMovementActive = TRUE;
sprite->sTypeFuncId = 2; sprite->sTypeFuncId = 2;
return TRUE; return TRUE;
@ -5552,9 +5552,7 @@ bool8 FollowablePlayerMovement_GoSpeed4(struct ObjectEvent *objectEvent, struct
ObjectEventMoveDestCoords(objectEvent, direction, &x, &y); ObjectEventMoveDestCoords(objectEvent, direction, &x, &y);
ObjectEventSetSingleMovement(objectEvent, sprite, GetJumpMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetJumpMovementAction(direction));
if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y)))) if (GetCollisionAtCoords(objectEvent, x, y, direction) || (tileCallback != NULL && !tileCallback(MapGridGetMetatileBehaviorAt(x, y))))
{
ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction));
}
objectEvent->singleMovementActive = TRUE; objectEvent->singleMovementActive = TRUE;
sprite->sTypeFuncId = 2; sprite->sTypeFuncId = 2;
return TRUE; return TRUE;
@ -9425,7 +9423,7 @@ static void DoTracksGroundEffect_Footprints(struct ObjectEvent *objEvent, struct
FieldEffectStart(sandFootprints_FieldEffectData[isDeepSand]); FieldEffectStart(sandFootprints_FieldEffectData[isDeepSand]);
} }
static void DoTracksGroundEffect_FootprintsB(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) static void DoTracksGroundEffect_FootprintsB(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand)
{ {
// First half-word is a Field Effect script id. (gFieldEffectScriptPointers) // First half-word is a Field Effect script id. (gFieldEffectScriptPointers)
u16 otherFootprintsA_FieldEffectData[2] = { u16 otherFootprintsA_FieldEffectData[2] = {
@ -9439,10 +9437,10 @@ static void DoTracksGroundEffect_FootprintsB(struct ObjectEvent *objEvent, struc
gFieldEffectArguments[3] = 2; gFieldEffectArguments[3] = 2;
gFieldEffectArguments[4] = objEvent->facingDirection; gFieldEffectArguments[4] = objEvent->facingDirection;
gFieldEffectArguments[5] = objEvent->previousMetatileBehavior; gFieldEffectArguments[5] = objEvent->previousMetatileBehavior;
FieldEffectStart(otherFootprintsA_FieldEffectData[a]); FieldEffectStart(otherFootprintsA_FieldEffectData[isDeepSand]);
} }
static void DoTracksGroundEffect_FootprintsC(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) static void DoTracksGroundEffect_FootprintsC(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand)
{ {
// First half-word is a Field Effect script id. (gFieldEffectScriptPointers) // First half-word is a Field Effect script id. (gFieldEffectScriptPointers)
u16 otherFootprintsB_FieldEffectData[2] = { u16 otherFootprintsB_FieldEffectData[2] = {
@ -9456,7 +9454,7 @@ static void DoTracksGroundEffect_FootprintsC(struct ObjectEvent *objEvent, struc
gFieldEffectArguments[3] = 2; gFieldEffectArguments[3] = 2;
gFieldEffectArguments[4] = objEvent->facingDirection; gFieldEffectArguments[4] = objEvent->facingDirection;
gFieldEffectArguments[5] = objEvent->previousMetatileBehavior; gFieldEffectArguments[5] = objEvent->previousMetatileBehavior;
FieldEffectStart(otherFootprintsB_FieldEffectData[a]); FieldEffectStart(otherFootprintsB_FieldEffectData[isDeepSand]);
} }
static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand) static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand)