Skip to content

Commit 5c990ab

Browse files
committed
Dont use PlayLayer::getCurrentPercentInt because its inlined on macchew os my beloved
1 parent 6b2b5e5 commit 5c990ab

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/layers/PlayLayer.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ class $modify(PlayLayerPause, PlayLayer)
3232
CCDirector::sharedDirector()->getRunningScene()->stopAction(m_fields->pauseGameAction);
3333
}
3434

35+
// thank you alk <3
36+
float currentPercent()
37+
{
38+
float percent;
39+
40+
if (m_level->m_timestamp > 0)
41+
percent = static_cast<float>(m_gameState.m_unk1f8) / m_level->m_timestamp * 100.f;
42+
else
43+
percent = m_player1->getPosition().x / m_levelLength * 100.f;
44+
45+
if (percent >= 100.f)
46+
return 100.f;
47+
else if (percent <= 0.f)
48+
return 0.f;
49+
else
50+
return percent;
51+
}
52+
3553
bool init(GJGameLevel* level, bool p1, bool p2)
3654
{
3755
delta = .0f;
@@ -51,7 +69,7 @@ class $modify(PlayLayerPause, PlayLayer)
5169
void destroyPlayer(PlayerObject* player, GameObject* obj)
5270
{
5371
if (
54-
const int percentage = this->getCurrentPercentInt();
72+
const int percentage = static_cast<int>(currentPercent());
5573
g_rouletteManager.isPlaying &&
5674
this->m_level->m_levelID == g_rouletteManager.currentLevelID &&
5775
!this->m_isPracticeMode &&

0 commit comments

Comments
 (0)