Skip to content

Commit

Permalink
Remove trailing whitespace pass 10-2-2024 (Upcoming) (rh-hideout#5456)
Browse files Browse the repository at this point in the history
  • Loading branch information
kittenchilly authored Oct 2, 2024
1 parent ded97e5 commit a135876
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion src/battle_ai_switch_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ static bool32 CanAbilityTrapOpponent(u16 ability, u32 opponent)
static inline bool32 IsFreeSwitch(bool32 isSwitchAfterKO, u32 battlerSwitchingOut, u32 opposingBattler)
{
bool32 movedSecond = GetBattlerTurnOrderNum(battlerSwitchingOut) > GetBattlerTurnOrderNum(opposingBattler) ? TRUE : FALSE;

// Switch out effects
if (!IsDoubleBattle()) // Not handling doubles' additional complexity
{
Expand Down
2 changes: 1 addition & 1 deletion src/battle_anim_rock.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ void AnimRockFragment(struct Sprite *sprite)
void AnimParticleInVortex(struct Sprite *sprite)
{
if (IsDoubleBattle() //got a little lazy here will fix later
&& (gAnimMoveIndex == MOVE_BLEAKWIND_STORM
&& (gAnimMoveIndex == MOVE_BLEAKWIND_STORM
|| gAnimMoveIndex == MOVE_SANDSEAR_STORM
|| gAnimMoveIndex == MOVE_SPRINGTIDE_STORM
|| gAnimMoveIndex == MOVE_WILDBOLT_STORM))
Expand Down
4 changes: 2 additions & 2 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ s32 CalcCritChanceStageGen1(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recor
// Crit scaling
if (moveCritStage > 0)
critChance = critChance * highCritRatioScaler * moveCritStage;

if (bonusCritStage > 0)
critChance = critChance * bonusCritStage;

Expand Down Expand Up @@ -11604,7 +11604,7 @@ static void Cmd_stockpiletohpheal(void)
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
gBattleMoveDamage *= -1;

gBattlescriptCurrInstr = cmd->nextInstr;
gBattlerTarget = gBattlerAttacker;
}
Expand Down
2 changes: 1 addition & 1 deletion src/berry.c
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,7 @@ void ObjectEventInteractionGetBerryCountString(void)
u8 treeId = GetObjectEventBerryTreeId(gSelectedObjectEvent);
u8 berry = GetBerryTypeByBerryTreeId(treeId);
u8 count = GetBerryCountByBerryTreeId(treeId);

gSpecialVar_0x8006 = BerryTypeToItemId(berry);
CopyItemNameHandlePlural(BerryTypeToItemId(berry), gStringVar1, count);
berry = GetTreeMutationValue(treeId);
Expand Down
8 changes: 4 additions & 4 deletions src/bike.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static u8 GetMachBikeTransition(u8 *dirTraveling)
{
// if the dir updated before this function, get the relevent new direction to check later.
u8 direction = GetPlayerMovementDirection();

// fix direction when moving on sideways stairs
switch (direction)
{
Expand Down Expand Up @@ -249,7 +249,7 @@ static void MachBikeTransition_TrySpeedUp(u8 direction)
// we did not hit anything that can slow us down, so perform the advancement callback depending on the bikeFrameCounter and try to increase the mach bike's speed.
if (ObjectMovingOnRockStairs(playerObjEvent, direction) && gPlayerAvatar.bikeFrameCounter > 1)
gPlayerAvatar.bikeFrameCounter--;

sMachBikeSpeedCallbacks[gPlayerAvatar.bikeFrameCounter](direction);
gPlayerAvatar.bikeSpeed = gPlayerAvatar.bikeFrameCounter + (gPlayerAvatar.bikeFrameCounter >> 1); // same as dividing by 2, but compiler is insistent on >> 1
if (gPlayerAvatar.bikeFrameCounter < 2) // do not go faster than the last element in the mach bike array
Expand Down Expand Up @@ -384,7 +384,7 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16
struct ObjectEvent *playerObjEvent;

direction = GetPlayerMovementDirection();

playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
gPlayerAvatar.runningState = NOT_MOVING;

Expand Down Expand Up @@ -716,7 +716,7 @@ static void AcroBikeTransition_WheelieMoving(u8 direction)
}
return;
}

PlayerWheelieMove(direction);
gPlayerAvatar.runningState = MOVING;
}
Expand Down
2 changes: 1 addition & 1 deletion src/data/graphics/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -21882,7 +21882,7 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_
const u32 gShinyOverworldPalette_OgerponCornerstoneMask[] = INCBIN_U32("graphics/pokemon/ogerpon/cornerstone/overworld_shiny.gbapal.lz");
const u32 gOverworldPalette_OgerponTealMask[] = INCBIN_U32("graphics/pokemon/ogerpon/overworld_normal.gbapal.lz");
const u32 gShinyOverworldPalette_OgerponTealMask[] = INCBIN_U32("graphics/pokemon/ogerpon/overworld_shiny.gbapal.lz");

const u32 gObjectEventPic_OgerponTealMaskTeraTera[] = INCBIN_COMP("graphics/pokemon/ogerpon/overworld.4bpp");
const u32 gObjectEventPic_OgerponWellspringMaskTera[] = INCBIN_COMP("graphics/pokemon/ogerpon/wellspring/overworld.4bpp");
const u32 gObjectEventPic_OgerponHearthflameMaskTera[] = INCBIN_COMP("graphics/pokemon/ogerpon/hearthflame/overworld.4bpp");
Expand Down
2 changes: 1 addition & 1 deletion src/data/heal_locations_pkm_center.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static const struct HealLocation sHealLocationsPokemonCenter[HEAL_LOCATION_COUNT
},
[HEAL_LOCATION_SLATEPORT_CITY - 1] =
{
.group = MAP_GROUP(SLATEPORT_CITY_POKEMON_CENTER_1F),
.group = MAP_GROUP(SLATEPORT_CITY_POKEMON_CENTER_1F),
.map = MAP_NUM(SLATEPORT_CITY_POKEMON_CENTER_1F),
DEFAULT_POKEMON_CENTER_COORDS,
},
Expand Down
2 changes: 1 addition & 1 deletion src/data/pokemon/species_info/gen_9_families.h
Original file line number Diff line number Diff line change
Expand Up @@ -7361,7 +7361,7 @@ const struct SpeciesInfo gSpeciesInfoGen9[] =
TRACKS_FOOT,
gOverworldPalette_Fezandipiti,
gShinyOverworldPalette_Fezandipiti
)
)
.isLegendary = TRUE,
.perfectIVCount = LEGENDARY_PERFECT_IV_COUNT,
.levelUpLearnset = sFezandipitiLevelUpLearnset,
Expand Down
30 changes: 15 additions & 15 deletions src/event_object_movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -5469,7 +5469,7 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri
s16 targetX;
s16 targetY;
u32 playerAction = gObjectEvents[gPlayerAvatar.objectEventId].movementActionId;

targetX = gObjectEvents[gPlayerAvatar.objectEventId].previousCoords.x;
targetY = gObjectEvents[gPlayerAvatar.objectEventId].previousCoords.y;
x = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x;
Expand Down Expand Up @@ -6022,11 +6022,11 @@ u8 GetSidewaysStairsCollision(struct ObjectEvent *objectEvent, u8 dir, u8 curren
{
if ((dir == DIR_SOUTH || dir == DIR_NORTH) && collision != COLLISION_NONE)
return collision;

// cant descend stairs into water
if (MetatileBehavior_IsSurfableFishableWater(nextBehavior))
return collision;

if (MetatileBehavior_IsSidewaysStairsLeftSide(nextBehavior))
{
//moving ONTO left side stair
Expand Down Expand Up @@ -6059,12 +6059,12 @@ u8 GetSidewaysStairsCollision(struct ObjectEvent *objectEvent, u8 dir, u8 curren
else
return collision;
}

return collision;
}

static u8 GetVanillaCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction)
{
{
if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y))
return COLLISION_OUTSIDE_RANGE;
else if (MapGridGetCollisionAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction))
Expand All @@ -6075,7 +6075,7 @@ static u8 GetVanillaCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8
return COLLISION_ELEVATION_MISMATCH;
else if (DoesObjectCollideWithObjectAt(objectEvent, x, y))
return COLLISION_OBJECT_EVENT;

return COLLISION_NONE;
}

Expand Down Expand Up @@ -6114,14 +6114,14 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
u8 currentBehavior = MapGridGetMetatileBehaviorAt(objectEvent->currentCoords.x, objectEvent->currentCoords.y);
u8 nextBehavior = MapGridGetMetatileBehaviorAt(x, y);
u8 collision;

#if OW_FLAG_NO_COLLISION != 0
if (FlagGet(OW_FLAG_NO_COLLISION))
return COLLISION_NONE;
#endif

objectEvent->directionOverwrite = DIR_NONE;

//sideways stairs checks
if (MetatileBehavior_IsSidewaysStairsLeftSideTop(nextBehavior) && dir == DIR_EAST)
return COLLISION_IMPASSABLE; //moving onto left-side top edge east from regular ground -> nope
Expand All @@ -6140,10 +6140,10 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
else if (!(MetatileBehavior_IsSidewaysStairsLeftSideBottom(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideBottom(currentBehavior))
&& dir == DIR_NORTH && (MetatileBehavior_IsSidewaysStairsLeftSideBottom(nextBehavior) || MetatileBehavior_IsSidewaysStairsRightSideBottom(nextBehavior)))
return COLLISION_IMPASSABLE; //trying to move north onto top stair tile at same level from non-stair -> no

// regular checks
collision = GetVanillaCollision(objectEvent, x, y, dir);

//sideways stairs direction change checks
collision = GetSidewaysStairsCollision(objectEvent, dir, currentBehavior, nextBehavior, collision);
switch (collision)
Expand All @@ -6159,7 +6159,7 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
objectEvent->directionOverwrite = GetRightSideStairsDirection(dir);
return COLLISION_NONE;
}

return collision;
}

Expand Down Expand Up @@ -6367,10 +6367,10 @@ static u8 TryUpdateMovementActionOnStairs(struct ObjectEvent *objectEvent, u8 mo
{
if (objectEvent->isPlayer || objectEvent->localId == OBJ_EVENT_ID_FOLLOWER)
return movementActionId; // handled separately

if (!ObjectMovingOnRockStairs(objectEvent, objectEvent->movementDirection))
return movementActionId;

switch (movementActionId)
{
case MOVEMENT_ACTION_WALK_NORMAL_DOWN:
Expand All @@ -6390,7 +6390,7 @@ bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementAct
{
if (ObjectEventIsMovementOverridden(objectEvent))
return TRUE;

movementActionId = TryUpdateMovementActionOnStairs(objectEvent, movementActionId);

UnfreezeObjectEvent(objectEvent);
Expand Down
4 changes: 2 additions & 2 deletions src/field_control_avatar.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ static const u8 *GetInteractedObjectEventScript(struct MapPosition *position, u8
s16 currX = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x;
s16 currY = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y;
u8 currBehavior = MapGridGetMetatileBehaviorAt(currX, currY);

switch (direction)
{
case DIR_EAST:
Expand Down Expand Up @@ -364,7 +364,7 @@ static const u8 *GetInteractedObjectEventScript(struct MapPosition *position, u8
objectEventId = GetObjectEventIdByPosition(position->x, position->y, position->elevation);
break;
}

if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER)
{
if (MetatileBehavior_IsCounter(metatileBehavior) != TRUE)
Expand Down
16 changes: 8 additions & 8 deletions src/field_player_avatar.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ static bool8 DoForcedMovement(u8 direction, void (*moveFunc)(u8))
{
struct PlayerAvatar *playerAvatar = &gPlayerAvatar;
u8 collision;

// Check for sideways stairs onto ice movement.
switch (direction)
{
Expand All @@ -473,7 +473,7 @@ static bool8 DoForcedMovement(u8 direction, void (*moveFunc)(u8))
direction = DIR_EAST;
break;
}

collision = CheckForPlayerAvatarCollision(direction);

playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE;
Expand Down Expand Up @@ -679,7 +679,7 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys)
PlayerRunSlow(direction);
else
PlayerRun(direction);

gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_DASH;
return;
}
Expand Down Expand Up @@ -720,7 +720,7 @@ static u8 CheckForPlayerAvatarStaticCollision(u8 direction)
u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior)
{
u8 collision = GetCollisionAtCoords(objectEvent, x, y, direction);

if (collision == COLLISION_ELEVATION_MISMATCH && CanStopSurfing(x, y, direction))
return COLLISION_STOP_SURFING;

Expand All @@ -738,7 +738,7 @@ u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u
return COLLISION_ROTATING_GATE;
CheckAcroBikeCollision(x, y, metatileBehavior, &collision);
}

return collision;
}

Expand Down Expand Up @@ -2481,7 +2481,7 @@ u8 GetRightSideStairsDirection(u8 direction)
if (direction > DIR_EAST)
direction -= DIR_EAST;
return direction;
}
}
}

u8 GetLeftSideStairsDirection(u8 direction)
Expand All @@ -2504,11 +2504,11 @@ bool8 ObjectMovingOnRockStairs(struct ObjectEvent *objectEvent, u8 direction)
#if SLOW_MOVEMENT_ON_STAIRS == TRUE
s16 x = objectEvent->currentCoords.x;
s16 y = objectEvent->currentCoords.y;

// TODO followers on sideways stairs
if (IsFollowerVisible() && GetFollowerObject() != NULL && (objectEvent->isPlayer || objectEvent->localId == OBJ_EVENT_ID_FOLLOWER))
return FALSE;

switch (direction)
{
case DIR_NORTH:
Expand Down
8 changes: 4 additions & 4 deletions src/heal_location.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ u32 GetHealLocationIndexByWarpData(struct WarpData *warp)
u32 i;
for (i = 0; i < ARRAY_COUNT(sHealLocations); i++)
{
if (sHealLocations[i].group == warp->mapGroup
&& sHealLocations[i].map == warp->mapNum
&& sHealLocations[i].x == warp->x
if (sHealLocations[i].group == warp->mapGroup
&& sHealLocations[i].map == warp->mapNum
&& sHealLocations[i].x == warp->x
&& sHealLocations[i].y == warp->y)
return i + 1;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ void SetWhiteoutRespawnWarpAndHealerNPC(struct WarpData *warp)
u32 healLocationId = GetHealLocationIndexByWarpData(&gSaveBlock1Ptr->lastHealLocation);
u32 healNpcLocalId = GetHealNpcLocalId(healLocationId);
struct HealLocation pkmCenterHealLocation;

if (!healNpcLocalId)
{
*(warp) = gSaveBlock1Ptr->lastHealLocation;
Expand Down
2 changes: 1 addition & 1 deletion src/metatile_behavior.c
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@ bool8 MetatileBehavior_IsSidewaysStairsRightSideAny(u8 metatileBehavior)

bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior)
{
if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE
if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE
|| metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM
|| metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP)
return TRUE;
Expand Down
4 changes: 2 additions & 2 deletions src/overworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -3311,7 +3311,7 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite)
#define ITEM_TAG 0x2722 //same as money label

bool8 GetSetItemObtained(u16 item, enum ItemObtainFlags caseId)
{
{
#if OW_SHOW_ITEM_DESCRIPTIONS == OW_ITEM_DESCRIPTIONS_FIRST_TIME
u8 index = item / 8;
u8 bit = item % 8;
Expand Down Expand Up @@ -3436,7 +3436,7 @@ void ScriptHideItemDescription(struct ScriptContext *ctx)
static void ShowItemIconSprite(u16 item, bool8 firstTime, bool8 flash)
{
s16 x = 0, y = 0;
u8 iconSpriteId;
u8 iconSpriteId;
u8 spriteId2 = MAX_SPRITES;

if (flash)
Expand Down
2 changes: 1 addition & 1 deletion src/pokemon_sprite_visualizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ static void UpdateShadowSizeValue(u8 taskId, bool8 increment)
else
{
update = 1;
data->shadowSettings.overrideSize += 1;
data->shadowSettings.overrideSize += 1;
}
}
else
Expand Down
Loading

0 comments on commit a135876

Please sign in to comment.