Skip to content

Commit 9774c8b

Browse files
authored
please proofread your code before making it final
1 parent c778d89 commit 9774c8b

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/main.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,13 @@ class $modify(AutoLevelRate, LevelInfoLayer) {
6868

6969
int starsRated = 0; // Used to log the amount of stars that the level got rated
7070

71-
// Only rate the requested difficulty if the user doesn't have a difficulty override.
72-
if (!Mod::get()->getSettingValue<bool>("toggle-override-difficulty-rate")){
73-
if (p0->m_starsRequested == 0) { // If they never requested any stars (N/A)
74-
button = static_cast<CCMenuItemSpriteExtra*>(menuLayer->getChildren()->objectAtIndex(4));
75-
starsRated = 5;
76-
} else {
77-
button = static_cast<CCMenuItemSpriteExtra*>(menuLayer->getChildren()->objectAtIndex(p0->m_starsRequested));
78-
starsRated = p0->m_starsRequested;
79-
}
80-
} else { // This is if the user specified a difficulty override.
81-
button = static_cast<CCMenuItemSpriteExtra*>(menuLayer->getChildren()->objectAtIndex(Mod::get()->getSettingValue<int>("override-difficulty-rate") - 1));
82-
starsRated = Mod::get()->getSettingValue<int>("override-difficulty-rate");
83-
}
84-
8571
// Only rate the requested difficulty if the user chose it.
8672
if (Mod::get()->getSettingValue<std::string>("rate-mode-selection") == "Requested Difficulty"){
8773
if (p0->m_starsRequested == 0) { // If they never requested any stars (N/A)
8874
button = static_cast<CCMenuItemSpriteExtra*>(menuLayer->getChildren()->objectAtIndex(4));
8975
starsRated = 5;
9076
} else {
91-
button = static_cast<CCMenuItemSpriteExtra*>(menuLayer->getChildren()->objectAtIndex(p0->m_starsRequested));
77+
button = static_cast<CCMenuItemSpriteExtra*>(menuLayer->getChildren()->objectAtIndex(p0->m_starsRequested - 1));
9278
starsRated = p0->m_starsRequested;
9379
}
9480
} else if(Mod::get()->getSettingValue<std::string>("rate-mode-selection") == "Current Difficulty") { // Only rate the current difficulty if the user chose it.
@@ -206,7 +192,7 @@ class $modify(AutoLevelRate, LevelInfoLayer) {
206192
newButton = static_cast<CCMenuItemSpriteExtra*>(newMenuLayer->getChildren()->objectAtIndex(4));
207193
newStarsRated = 5;
208194
} else {
209-
newButton = static_cast<CCMenuItemSpriteExtra*>(newMenuLayer->getChildren()->objectAtIndex(p0->m_starsRequested));
195+
newButton = static_cast<CCMenuItemSpriteExtra*>(newMenuLayer->getChildren()->objectAtIndex(p0->m_starsRequested - 1));
210196
newStarsRated = p0->m_starsRequested;
211197
}
212198
} else if(Mod::get()->getSettingValue<std::string>("rate-mode-selection") == "Current Difficulty") { // Only rate the current difficulty if the user chose it.

0 commit comments

Comments
 (0)