- WH: fixed level warping.

This commit is contained in:
Christoph Oelckers 2021-06-27 10:09:13 +02:00
parent c31b0486a0
commit ce87653ab3
3 changed files with 13 additions and 3 deletions

View file

@ -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.

View file

@ -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);

View file

@ -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();