diff --git a/source/common/cutscenes/screenjob.cpp b/source/common/cutscenes/screenjob.cpp index 9175a6f62..2004e4dc1 100644 --- a/source/common/cutscenes/screenjob.cpp +++ b/source/common/cutscenes/screenjob.cpp @@ -88,12 +88,14 @@ void Job_Init() VMFunction* LookupFunction(const char* qname, bool validate) { size_t p = strcspn(qname, "."); - if (p == 0) I_Error("Call to undefined function %s", qname); + if (p == 0) + I_Error("Call to undefined function %s", qname); FString clsname(qname, p); FString funcname = qname + p + 1; auto func = PClass::FindFunction(clsname, funcname); - if (func == nullptr) I_Error("Call to undefined function %s", qname); + if (func == nullptr) + I_Error("Call to undefined function %s", qname); if (validate) { // these conditions must be met by all functions for this interface. diff --git a/source/core/g_mapinfo.cpp b/source/core/g_mapinfo.cpp index fd4f01d30..4a57c0a26 100644 --- a/source/core/g_mapinfo.cpp +++ b/source/core/g_mapinfo.cpp @@ -863,7 +863,14 @@ void FMapInfoParser::ParseMapDefinition(MapRecord &info) static int GetDefaultLevelNum(const char *mapname) { - if ((!strnicmp (mapname, "MAP", 3) || !strnicmp(mapname, "LEV", 3)) && strlen(mapname) <= 5) + if ((!strnicmp(mapname, "LEVEL", 5)) && strlen(mapname) <= 7) + { + int mapnum = atoi(mapname + 5); + + if (mapnum >= 1 && mapnum <= 99) + return mapnum; + } + else if ((!strnicmp (mapname, "MAP", 3) || !strnicmp(mapname, "LEV", 3)) && strlen(mapname) <= 5) { int mapnum = atoi (mapname + 3); diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index e96759a8d..64201de86 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -91,6 +91,7 @@ static void CallCreateMapFunction(const char* qname, DObject* runner, MapRecord* void CallCreateSummaryFunction(const char* qname, DObject* runner, MapRecord* map, SummaryInfo* info, MapRecord* map2) { + if (qname == nullptr || *qname == 0) return; // no level summary defined. auto func = LookupFunction(qname); auto s = func->Proto->ArgumentTypes.Size(); auto at = func->Proto->ArgumentTypes.Data();