Skip to content

Commit 91c86d9

Browse files
committed
im an idiot.
1 parent 780cc14 commit 91c86d9

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/PlayLayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class $modify(MyPlayLayer, PlayLayer) {
227227

228228
if (nodeString.ends_with("%") && fontFile == "bigFont.fnt") {
229229
// this is the node displaying where you died as a new best
230-
if (isNewBest && getModBool("accuratePercent")) return hopefullyALabel->setString(fmt::format("{:.{}f}%", manager->lastDeathPercent, getModInt("accuracy")).c_str());
230+
if (isNewBest && getModBool("accuratePercent")) return hopefullyALabel->setString(fmt::format("{:.{}f}%", manager->currentDeathPercentForQueueInMainLoader, getModInt("accuracy")).c_str());
231231
// i have to do all of this because robtop's wonderful technology shows percent from previous death if i dont include all of this
232232
if (!std::regex_match(nodeString, match, manager->percentRegex)) continue;
233233
auto percent = std::regex_replace(nodeString, std::regex("%"), "");
@@ -240,7 +240,7 @@ class $modify(MyPlayLayer, PlayLayer) {
240240
log::info("getCurrentPercentInt: {}", currPercent);
241241

242242
if (!getModBool("accuratePercent")) hopefullyALabel->setString(fmt::format("{}%", currPercent).c_str());
243-
else hopefullyALabel->setString(fmt::format("{:.{}f}%", manager->lastDeathPercent, getModInt("accuracy")).c_str());
243+
else hopefullyALabel->setString(fmt::format("{:.{}f}%", manager->currentDeathPercentForQueueInMainLoader, getModInt("accuracy")).c_str());
244244
continue;
245245
}
246246

src/PlayerObject.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class $modify(MyPlayerObject, PlayerObject) {
2626
if (this == pl->m_player2 && theLevel->m_twoPlayerMode) return;
2727

2828
Manager* manager = Manager::getSharedInstance();
29-
if (this == pl->m_player1 && this->m_isDead) manager->lastDeathPercent = pl->getCurrentPercent();
29+
const float plCurrentPercent = pl->getCurrentPercent();
30+
if (this == pl->m_player1 && this->m_isDead) manager->currentDeathPercentForQueueInMainLoader = plCurrentPercent;
3031

3132
const bool isNewBest = MyPlayerObject::isNewBest(pl);
3233
const bool shouldPlayNewBestSFX = getBool("newBestSFX") && isNewBest;
@@ -42,9 +43,7 @@ class $modify(MyPlayerObject, PlayerObject) {
4243
const auto fmod = FMODAudioEngine::get();
4344
if (!fmod) return;
4445

45-
const float plCurrentPercent = pl->getCurrentPercent();
46-
const float originalDeathPercent = manager->lastDeathPercent;
47-
const bool shouldActivateSisyphusMode = getBool("sisyphus") && std::abs(originalDeathPercent - plCurrentPercent) <= static_cast<float>(std::clamp(getFloat("sisyphusThreshold"), .01, 10.));
46+
const bool shouldActivateSisyphusMode = getBool("sisyphus") && std::abs(manager->lastDeathPercent - plCurrentPercent) <= static_cast<float>(std::clamp(getFloat("sisyphusThreshold"), .01, 10.));
4847
if (!pl->m_isTestMode) {
4948
manager->lastDeathPercent = plCurrentPercent;
5049
}

0 commit comments

Comments
 (0)