* Fix use after free in ProgressScreen

This commit is contained in:
iProgramInCpp
2023-11-03 18:27:13 +02:00
parent 1860016fb3
commit ebdb8d3576
2 changed files with 12 additions and 6 deletions

View File

@@ -15,12 +15,6 @@ bool ProgressScreen::isInGameScreen()
void ProgressScreen::render(int a, int b, float c)
{
if (m_pMinecraft->isLevelGenerated())
{
m_pMinecraft->setScreen(nullptr);
return;
}
renderBackground();
// render the dirt background
@@ -84,3 +78,14 @@ void ProgressScreen::render(int a, int b, float c)
sleepMs(50);
#endif
}
void ProgressScreen::updateEvents()
{
if (m_pMinecraft->isLevelGenerated())
{
m_pMinecraft->setScreen(nullptr);
return;
}
Screen::updateEvents();
}

View File

@@ -14,6 +14,7 @@ class ProgressScreen : public Screen
{
public:
void render(int, int, float) override;
void updateEvents() override;
bool isInGameScreen() override;
};