mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 23:23:43 +01:00
Use runningState directly in CheckMovementInputNotOnBike
This commit is contained in:
parent
8f1a760937
commit
429d53b95c
@ -33,12 +33,6 @@
|
|||||||
#define NUM_FORCED_MOVEMENTS 18
|
#define NUM_FORCED_MOVEMENTS 18
|
||||||
#define NUM_ACRO_BIKE_COLLISIONS 5
|
#define NUM_ACRO_BIKE_COLLISIONS 5
|
||||||
|
|
||||||
enum {
|
|
||||||
PLAYER_STILL,
|
|
||||||
PLAYER_TURNING,
|
|
||||||
PLAYER_MOVING,
|
|
||||||
};
|
|
||||||
|
|
||||||
static EWRAM_DATA u8 sSpinStartFacingDir = 0;
|
static EWRAM_DATA u8 sSpinStartFacingDir = 0;
|
||||||
EWRAM_DATA struct ObjectEvent gObjectEvents[OBJECT_EVENTS_COUNT] = {};
|
EWRAM_DATA struct ObjectEvent gObjectEvents[OBJECT_EVENTS_COUNT] = {};
|
||||||
EWRAM_DATA struct PlayerAvatar gPlayerAvatar = {};
|
EWRAM_DATA struct PlayerAvatar gPlayerAvatar = {};
|
||||||
@ -196,9 +190,9 @@ static bool8 (*const sForcedMovementFuncs[NUM_FORCED_MOVEMENTS + 1])(void) =
|
|||||||
|
|
||||||
static void (*const sPlayerNotOnBikeFuncs[])(u8, u16) =
|
static void (*const sPlayerNotOnBikeFuncs[])(u8, u16) =
|
||||||
{
|
{
|
||||||
[PLAYER_STILL] = PlayerNotOnBikeNotMoving,
|
[NOT_MOVING] = PlayerNotOnBikeNotMoving,
|
||||||
[PLAYER_TURNING] = PlayerNotOnBikeTurningInPlace,
|
[TURN_DIRECTION] = PlayerNotOnBikeTurningInPlace,
|
||||||
[PLAYER_MOVING] = PlayerNotOnBikeMoving,
|
[MOVING] = PlayerNotOnBikeMoving,
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool8 (*const sAcroBikeTrickMetatiles[NUM_ACRO_BIKE_COLLISIONS])(u8) =
|
static bool8 (*const sAcroBikeTrickMetatiles[NUM_ACRO_BIKE_COLLISIONS])(u8) =
|
||||||
@ -591,20 +585,11 @@ static void MovePlayerNotOnBike(u8 direction, u16 heldKeys)
|
|||||||
static u8 CheckMovementInputNotOnBike(u8 direction)
|
static u8 CheckMovementInputNotOnBike(u8 direction)
|
||||||
{
|
{
|
||||||
if (direction == DIR_NONE)
|
if (direction == DIR_NONE)
|
||||||
{
|
return gPlayerAvatar.runningState = NOT_MOVING;
|
||||||
gPlayerAvatar.runningState = NOT_MOVING;
|
|
||||||
return PLAYER_STILL;
|
|
||||||
}
|
|
||||||
else if (direction != GetPlayerMovementDirection() && gPlayerAvatar.runningState != MOVING)
|
else if (direction != GetPlayerMovementDirection() && gPlayerAvatar.runningState != MOVING)
|
||||||
{
|
return gPlayerAvatar.runningState = TURN_DIRECTION;
|
||||||
gPlayerAvatar.runningState = TURN_DIRECTION;
|
|
||||||
return PLAYER_TURNING;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
return gPlayerAvatar.runningState = MOVING;
|
||||||
gPlayerAvatar.runningState = MOVING;
|
|
||||||
return PLAYER_MOVING;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PlayerNotOnBikeNotMoving(u8 direction, u16 heldKeys)
|
static void PlayerNotOnBikeNotMoving(u8 direction, u16 heldKeys)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user