add camera bugfix option in macbeth

This commit is contained in:
Sonic Dreamcaster 2024-11-24 17:53:22 -03:00
parent bda925b33f
commit 288504039f
2 changed files with 19 additions and 7 deletions

View File

@ -3803,8 +3803,8 @@ void Macbeth_MaFallingBoulder_Update(MaFallingBoulder* this) {
}
Macbeth_MaBoulder_Spawn(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z,
(RAND_FLOAT(2.0f) + 20.0f) * (s32) this->iwork[4], 0.0f,
(s32) this->iwork[4] * -34.0f, 0.0f, 2, 3);
(RAND_FLOAT(2.0f) + 20.0f) * (s32) this->iwork[4], 0.0f, (s32) this->iwork[4] * -34.0f,
0.0f, 2, 3);
Object_Kill(&this->obj, this->sfxSource);
}
}
@ -6994,11 +6994,16 @@ void Macbeth_LevelComplete2(Player* player) {
//! @BUG: The following condition is always true:
// if ((gCsFrameCount >= 2120) || (gCsFrameCount < 2175)) {
// LTODO: Fixed the bug, maybe have an option for it
if ((gCsFrameCount >= 2120) && (gCsFrameCount < 2175)) {
Math_SmoothStepToF(&gCsCamAtY, player->pos.y + 70.0f, 0.1f, 8.0f, 0.0f);
if (CVarGetInteger("gMaCameraFix", 0) == 1) {
if ((gCsFrameCount >= 2120) && (gCsFrameCount < 2175)) {
Math_SmoothStepToF(&gCsCamAtY, player->pos.y + 70.0f, 0.1f, 8.0f, 0.0f);
}
} else {
if ((gCsFrameCount >= 2120) || (gCsFrameCount < 2175)) {
Math_SmoothStepToF(&gCsCamAtY, player->pos.y + 70.0f, 0.1f, 8.0f, 0.0f);
}
}
if (gCsFrameCount == 2120) {
D_ctx_80177A48[0] = 0.0f;
}

View File

@ -426,6 +426,13 @@ void DrawEnhancementsMenu() {
ImGui::EndMenu();
}
if (UIWidgets::BeginMenu("Fixes")) {
UIWidgets::CVarCheckbox("Macbeth: Level ending cutscene camera fix", "gMaCameraFix", {
.tooltip = "Fixes a camera bug found in the code of the game"
});
ImGui::EndMenu();
}
ImGui::EndMenu();
}