summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-01-07 16:48:22 +0100
committerAki <please@ignore.pl>2023-01-07 16:48:22 +0100
commitdc95f5f0a2fa48379dd1dc3729fda4d4333c64d1 (patch)
tree84b2d066df098dd396ec3429c46ed6217a271e6d
parentace2b0b32b402703ed65f395e8e7b9aa47561f21 (diff)
downloadkurator-dc95f5f0a2fa48379dd1dc3729fda4d4333c64d1.zip
kurator-dc95f5f0a2fa48379dd1dc3729fda4d4333c64d1.tar.gz
kurator-dc95f5f0a2fa48379dd1dc3729fda4d4333c64d1.tar.bz2
Fixed one imgui frame showing after campaign ends
-rw-r--r--kurator/src/Campaign.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kurator/src/Campaign.cpp b/kurator/src/Campaign.cpp
index c0e28f1..be02862 100644
--- a/kurator/src/Campaign.cpp
+++ b/kurator/src/Campaign.cpp
@@ -52,6 +52,8 @@ Campaign::Campaign(std::shared_ptr<Session> _session) :
void
Campaign::update(const float)
{
+ if (ships.empty())
+ return session->pop();
if (ImGui::Begin("Campaign")) {
ImGui::Text("Level %d, ships left:", level);
for (const auto& ship : ships) {
@@ -76,8 +78,6 @@ Campaign::update(const float)
session->pop();
}
ImGui::End();
- if (ships.empty())
- session->pop();
}