mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +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
|
else
|
||||||
Layer = NUM_LAYERS;
|
Layer = NUM_LAYERS;
|
||||||
|
|
||||||
EExplanation Explanation = EExplanation::DDNET;
|
EExplanation Explanation;
|
||||||
if(m_SelectEntitiesImage == "DDNet")
|
if(m_SelectEntitiesImage == "DDNet")
|
||||||
Explanation = EExplanation::DDNET;
|
Explanation = EExplanation::DDNET;
|
||||||
else if(m_SelectEntitiesImage == "FNG")
|
else if(m_SelectEntitiesImage == "FNG")
|
||||||
|
@ -2561,7 +2561,7 @@ void CEditor::DoMapEditor(CUIRect View)
|
||||||
else if(m_SelectEntitiesImage == "blockworlds")
|
else if(m_SelectEntitiesImage == "blockworlds")
|
||||||
Explanation = EExplanation::BLOCKWORLDS;
|
Explanation = EExplanation::BLOCKWORLDS;
|
||||||
else
|
else
|
||||||
dbg_assert(false, "Unhandled entities image for explanations");
|
Explanation = EExplanation::NONE;
|
||||||
|
|
||||||
if(Layer != NUM_LAYERS)
|
if(Layer != NUM_LAYERS)
|
||||||
{
|
{
|
||||||
|
|
|
@ -951,6 +951,7 @@ public:
|
||||||
// Explanations
|
// Explanations
|
||||||
enum class EExplanation
|
enum class EExplanation
|
||||||
{
|
{
|
||||||
|
NONE,
|
||||||
DDNET,
|
DDNET,
|
||||||
FNG,
|
FNG,
|
||||||
RACE,
|
RACE,
|
||||||
|
|
|
@ -670,6 +670,8 @@ const char *CEditor::Explain(EExplanation Explanation, int Tile, int Layer)
|
||||||
{
|
{
|
||||||
switch(Explanation)
|
switch(Explanation)
|
||||||
{
|
{
|
||||||
|
case EExplanation::NONE:
|
||||||
|
return nullptr;
|
||||||
case EExplanation::DDNET:
|
case EExplanation::DDNET:
|
||||||
return ExplainDDNet(Tile, Layer);
|
return ExplainDDNet(Tile, Layer);
|
||||||
case EExplanation::FNG:
|
case EExplanation::FNG:
|
||||||
|
|
Loading…
Reference in a new issue