diff --git a/src/maploader/compatibility.cpp b/src/maploader/compatibility.cpp index e59357731..461f8cab4 100644 --- a/src/maploader/compatibility.cpp +++ b/src/maploader/compatibility.cpp @@ -353,21 +353,18 @@ IMPLEMENT_CLASS(DLevelCompatibility, true, false); void MapLoader::SetCompatibilityParams(FName checksum) { - if (checksum != NAME_None) + auto lc = Create(); + lc->loader = this; + lc->Level = Level; + for(auto cls : PClass::AllClasses) { - auto lc = Create(); - lc->loader = this; - lc->Level = Level; - for(auto cls : PClass::AllClasses) + if (cls->IsDescendantOf(RUNTIME_CLASS(DLevelCompatibility))) { - if (cls->IsDescendantOf(RUNTIME_CLASS(DLevelCompatibility))) + PFunction *const func = dyn_cast(cls->FindSymbol("Apply", false)); + if (func != nullptr) { - PFunction *const func = dyn_cast(cls->FindSymbol("Apply", false)); - if (func != nullptr) - { - VMValue param[] = { lc, (int)checksum }; - VMCall(func->Variants[0].Implementation, param, 2, nullptr, 0); - } + VMValue param[] = { lc, checksum.GetIndex(), &Level->MapName }; + VMCall(func->Variants[0].Implementation, param, 3, nullptr, 0); } } } diff --git a/wadsrc/static/zscript/level_compatibility.txt b/wadsrc/static/zscript/level_compatibility.txt index 29378b01e..25eacb9da 100644 --- a/wadsrc/static/zscript/level_compatibility.txt +++ b/wadsrc/static/zscript/level_compatibility.txt @@ -3,10 +3,13 @@ class LevelCompatibility native play { native LevelLocals level; - protected void Apply(Name checksum) + protected void Apply(Name checksum, String mapname) { switch (checksum) { + case 'none': + return; + case '9BC9E12781903D7C2D5697A5E0AEFD6F': // HACX.WAD map05 from 21.10.2010 case '9527DD0809FDA39CCFC316A21D135783': // HACX.WAD map05 from 20.10.2010 {