From 4200d0405d008b65b87b4ab6cb2e0b4dc9876ba8 Mon Sep 17 00:00:00 2001 From: vladislavbelov Date: Tue, 11 Apr 2023 09:50:35 +0000 Subject: [PATCH] Removes assertion from MinimapTexture on entities overflow. Differential Revision: https://code.wildfiregames.com/D4977 git-svn-id: https://svn.wildfiregames.com/public/ps/trunk@27601 3db68df2-c116-0410-a063-a993310a9797 --- source/graphics/MiniMapTexture.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/graphics/MiniMapTexture.cpp b/source/graphics/MiniMapTexture.cpp index 07bd849830..1558150d4d 100644 --- a/source/graphics/MiniMapTexture.cpp +++ b/source/graphics/MiniMapTexture.cpp @@ -30,6 +30,7 @@ #include "graphics/TerritoryTexture.h" #include "graphics/TextureManager.h" #include "lib/bits.h" +#include "lib/code_generation.h" #include "lib/hash.h" #include "lib/timer.h" #include "maths/MathUtil.h" @@ -676,7 +677,7 @@ void CMiniMapTexture::UpdateAndUploadEntities( v.b = 255; pingingVertices.push_back(v); } - else + else if (m_EntitiesDrawn < MAX_ENTITIES_DRAWN) { AddEntity(v, attrColor, attrPos, entityRadius, m_UseInstancing); ++m_EntitiesDrawn; @@ -767,9 +768,12 @@ void CMiniMapTexture::UpdateAndUploadEntities( { AddEntity(vertex, attrColor, attrPos, entityRadius, m_UseInstancing); ++m_EntitiesDrawn; + if (m_EntitiesDrawn == MAX_ENTITIES_DRAWN) + break; } - ENSURE(m_EntitiesDrawn < MAX_ENTITIES_DRAWN); + if (m_EntitiesDrawn == MAX_ENTITIES_DRAWN) + ONCE(LOGERROR("Too many entities, some of them will be hidden on the minimap.")); if (!m_UseInstancing) { -- 2.11.4.GIT