Fixes crash with toggling walk speed. (#1877)

This commit is contained in:
Christopher Leggett 2022-10-31 12:39:43 -04:00 committed by GitHub
parent 8932f30904
commit 087f42a826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 9 deletions

View File

@ -10942,6 +10942,15 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
if (CVar_GetS32("gEnableWalkModify", 0) && CVar_GetS32("gWalkSpeedToggle", 0)) {
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_MODIFIER1)) {
gWalkSpeedToggle1 = !gWalkSpeedToggle1;
}
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_MODIFIER2)) {
gWalkSpeedToggle2 = !gWalkSpeedToggle2;
}
}
Player_UpdateCommon(this, globalCtx, &sp44);
}
@ -10982,15 +10991,6 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) {
if (chaosEffectGravityLevel == GRAVITY_LEVEL_LIGHT) {
this->actor.gravity = -0.3f;
}
if (CVar_GetS32("gEnableWalkModify", 0) && CVar_GetS32("gWalkSpeedToggle", 0)) {
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_MODIFIER1)) {
gWalkSpeedToggle1 = !gWalkSpeedToggle1;
}
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_MODIFIER2)) {
gWalkSpeedToggle2 = !gWalkSpeedToggle2;
}
}
}
static struct_80858AC8 D_80858AC8;