diff options
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_actor.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 3933f263d..620cb4959 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1284,8 +1284,16 @@ void Actor_UpdatePos(Actor* actor) { } void Actor_UpdateVelocityXZGravity(Actor* actor) { - actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speedXZ; + Player* player = GET_PLAYER(gPlayState); + uint8_t inCutscene = player->stateFlags1 & PLAYER_STATE1_CLIMBING_LADDER || + player->stateFlags1 & PLAYER_STATE1_IN_CUTSCENE || + player->stateFlags2 & PLAYER_STATE2_CRAWLING; + f32 speedModifier = 1.0f; + if (actor->id == ACTOR_PLAYER && !inCutscene) { + speedModifier = GameInteractor_MovementSpeedMultiplier(); + } + actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speedXZ * speedModifier; + actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speedXZ * speedModifier; actor->velocity.y += actor->gravity; if (actor->velocity.y < actor->minVelocityY) { |
