mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix editor crash when showing explanation for custom entities
The failing assertion is removed because users can add custom entities images besides the predefined ones. Reported by Mr.Gh0s7 on Discord.
This commit is contained in:
parent
670f4e167a
commit
df664261bb
|
@ -2549,7 +2549,7 @@ void CEditor::DoMapEditor(CUIRect View)
|
|||
else
|
||||
Layer = NUM_LAYERS;
|
||||
|
||||
EExplanation Explanation = EExplanation::DDNET;
|
||||
EExplanation Explanation;
|
||||
if(m_SelectEntitiesImage == "DDNet")
|
||||
Explanation = EExplanation::DDNET;
|
||||
else if(m_SelectEntitiesImage == "FNG")
|
||||
|
@ -2561,7 +2561,7 @@ void CEditor::DoMapEditor(CUIRect View)
|
|||
else if(m_SelectEntitiesImage == "blockworlds")
|
||||
Explanation = EExplanation::BLOCKWORLDS;
|
||||
else
|
||||
dbg_assert(false, "Unhandled entities image for explanations");
|
||||
Explanation = EExplanation::NONE;
|
||||
|
||||
if(Layer != NUM_LAYERS)
|
||||
{
|
||||
|
|
|
@ -951,6 +951,7 @@ public:
|
|||
// Explanations
|
||||
enum class EExplanation
|
||||
{
|
||||
NONE,
|
||||
DDNET,
|
||||
FNG,
|
||||
RACE,
|
||||
|
|
|
@ -670,6 +670,8 @@ const char *CEditor::Explain(EExplanation Explanation, int Tile, int Layer)
|
|||
{
|
||||
switch(Explanation)
|
||||
{
|
||||
case EExplanation::NONE:
|
||||
return nullptr;
|
||||
case EExplanation::DDNET:
|
||||
return ExplainDDNet(Tile, Layer);
|
||||
case EExplanation::FNG:
|
||||
|
|
Loading…
Reference in a new issue