Skip to content

Commit e4def27

Browse files
committed
fix
1 parent 1a2cd0d commit e4def27

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Labels/Labels.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ void StatusNode::update(float dt)
309309
cps.erase(std::remove_if(cps.begin(), cps.end(), [](float i){ return i < 0; }), cps.end());
310310

311311
sLabels[8]->setString((cpsM->options[1]->enabled ? fmt::format("{} / {} CPS", cps.size(), totalClicks) : fmt::format("{} CPS", cps.size(), totalClicks)).c_str());
312-
sLabels[9]->setString(bestRunPlayLayer->getRunString().c_str());
312+
313+
if (bestRunPlayLayer)
314+
sLabels[9]->setString(bestRunPlayLayer->getRunString().c_str());
313315

314316
updateVis();
315317
}

src/Labels/Labels.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class StatusNode : public CCNode
8484
std::vector<float> cps;
8585
int totalClicks = 0;
8686

87-
BestPlayLayer* bestRunPlayLayer;
87+
Ref<BestPlayLayer> bestRunPlayLayer = nullptr;
8888

8989
std::string formatTime(float time) {
9090
// Convert float time to milliseconds

0 commit comments

Comments
 (0)