CrowdControl additions & improvements (#5104)

* CrowdControl additions & improvements

* Update after dev merge

* clang format

* Revert "clang format"

This reverts commit 1be5ad18f5995792971fa0a1772109b0157817b4.

* clang format
This commit is contained in:
aMannus
2025-07-01 19:54:26 +02:00
committed by GitHub
parent 05a7f728e7
commit 48d2193fec
15 changed files with 103 additions and 397 deletions

View File

@@ -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) {