fixed assertion

This commit is contained in:
2025-11-30 15:52:39 +01:00
parent 7f07036f07
commit b46246b74f
2 changed files with 36 additions and 11 deletions

View File

@ -9,6 +9,7 @@
#include <algorithm>
#include <array>
#include <cmath>
#include <vector>
// Use dynamic logical dimensions from GlobalState instead of hardcoded values
// This allows the UI to adapt when the window is resized or goes fullscreen
@ -239,7 +240,8 @@ void MenuState::render(SDL_Renderer* renderer, float logicalScale, SDL_Rect logi
// High scores table with wave offset
float scoresStartY = topPlayersY + 70; // more spacing under title
const auto &hs = ctx.scores ? ctx.scores->all() : *(new std::vector<ScoreEntry>());
static const std::vector<ScoreEntry> EMPTY_SCORES;
const auto& hs = ctx.scores ? ctx.scores->all() : EMPTY_SCORES;
size_t maxDisplay = std::min(hs.size(), size_t(12));
// Draw table header