Skip to content

Commit

Permalink
rel: Handle missing map in seq_change_map command
Browse files Browse the repository at this point in the history
  • Loading branch information
PistonMiner committed Oct 19, 2022
1 parent 0076ac8 commit 9ef9c81
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ttyd-tools/rel/source/con_seq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "console.h"

#include <ttyd/seq_logo.h>
#include <ttyd/mapdata.h>

#include <cstdio>

Expand Down Expand Up @@ -53,6 +54,14 @@ ConCommand seq_change_map("seq_change_map", [](const char *text) {
{
beroName[0] = '\0';
}

void *mapData = ttyd::mapdata::mapDataPtr(mapName);
if (!mapData)
{
gConsole->logError("No map named '%s'!\n", mapName);
return;
}

ttyd::seqdrv::seqSetSeq(ttyd::seqdrv::SeqIndex::kMapChange, mapName, beroName);
});

Expand Down

0 comments on commit 9ef9c81

Please sign in to comment.