Fix missile amount increments

This commit is contained in:
Luke Street 2021-05-30 19:03:23 -04:00
parent 24115948ce
commit b4268f7504
1 changed files with 5 additions and 3 deletions

View File

@ -970,14 +970,16 @@ static void RenderItemType(CPlayerState& pState, CPlayerState::EItemType itemTyp
if (ImGui::SliderInt((name + " (Capacity)").c_str(), &capacity, 0, int(maxValue), "%d", if (ImGui::SliderInt((name + " (Capacity)").c_str(), &capacity, 0, int(maxValue), "%d",
ImGuiSliderFlags_AlwaysClamp)) { ImGuiSliderFlags_AlwaysClamp)) {
if (itemType == CPlayerState::EItemType::Missiles) { if (itemType == CPlayerState::EItemType::Missiles) {
pState.ReInitializePowerUp(itemType, roundMultiple(capacity, 5)); capacity = roundMultiple(capacity, 5);
} else {
pState.ReInitializePowerUp(itemType, u32(capacity));
} }
pState.ReInitializePowerUp(itemType, u32(capacity));
pState.ResetAndIncrPickUp(itemType, u32(capacity)); pState.ResetAndIncrPickUp(itemType, u32(capacity));
} }
if (capacity > 0) { if (capacity > 0) {
if (ImGui::SliderInt((name + " (Amount)").c_str(), &amount, 0, capacity, "%d", ImGuiSliderFlags_AlwaysClamp)) { if (ImGui::SliderInt((name + " (Amount)").c_str(), &amount, 0, capacity, "%d", ImGuiSliderFlags_AlwaysClamp)) {
if (itemType == CPlayerState::EItemType::Missiles) {
amount = roundMultiple(amount, 5);
}
pState.ResetAndIncrPickUp(itemType, u32(amount)); pState.ResetAndIncrPickUp(itemType, u32(amount));
} }
} else { } else {