Skip to content

Commit e749eb8

Browse files
committed
* [Level Editor] Shows an error message if trying to test without having setup a source port.
1 parent bf8b727 commit e749eb8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

TheForceEngine/TFE_Editor/LevelEditor/levelEditor.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4386,6 +4386,24 @@ namespace LevelEditor
43864386

43874387
void play()
43884388
{
4389+
// For now assume Dark Forces - TODO: Fix for Outlaws support.
4390+
size_t len = strlen(s_editorConfig.darkForcesPort);
4391+
bool invalidPort = false;
4392+
if (len == 0) { invalidPort = true; }
4393+
#ifdef _WIN32
4394+
char ext[32];
4395+
FileUtil::getFileExtension(s_editorConfig.darkForcesPort, ext);
4396+
if (strcasecmp(ext, "exe"))
4397+
{
4398+
invalidPort = true;
4399+
}
4400+
#endif
4401+
if (invalidPort)
4402+
{
4403+
showMessageBox("Error", "You need to set a source port before you can test.\nOpen the Level menu and choose Test Options to set.");
4404+
return;
4405+
}
4406+
43894407
StartPoint start = {};
43904408
start.pos = s_camera.pos;
43914409
start.yaw = s_camera.yaw;

0 commit comments

Comments
 (0)