diff --git a/source/core/mapinfo.cpp b/source/core/mapinfo.cpp index 5e2b378c8..193188f30 100644 --- a/source/core/mapinfo.cpp +++ b/source/core/mapinfo.cpp @@ -81,6 +81,15 @@ MapRecord *FindMapByName(const char *nm) return map.Data(); } } + // retry with the path being removed. + FString s = ExtractFileBase(nm); + for (auto& map : mapList) + { + if (map->labelName.CompareNoCase(s) == 0) + { + return map.Data(); + } + } return nullptr; } diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index c05ef3512..046e7dafd 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -426,6 +426,7 @@ void resetprestat(int snum,int g) paused = 0; ud.cameraactor =nullptr; mspos.Clear(); + animates.Clear(); camsprite =nullptr; earthquaketime = 0; diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index abf1f2930..9e66f8d99 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -355,6 +355,7 @@ void doanimations(void) double a = getanimatevalue(i); double const v = animates[i].vel * TICSPERFRAME; auto dasectp = animates[i].sect; + int type = animates[i].type; if (a == animates[i].goal) { @@ -362,9 +363,8 @@ void doanimations(void) animates[i] = animates.Last(); animates.Pop(); - dasectp = animates[i].sect; if (dasectp->lotag == ST_18_ELEVATOR_DOWN || dasectp->lotag == ST_19_ELEVATOR_UP) - if (animates[i].type == anim_ceilingz) + if (type == anim_ceilingz) continue; if ((dasectp->lotag & 0xff) != ST_22_SPLITTING_DOOR) @@ -376,7 +376,7 @@ void doanimations(void) if (v > 0) { a = min(a + v, animates[i].goal); } else { a = max(a + v, animates[i].goal); } - if (animates[i].type == anim_floorz) + if (type == anim_floorz) { for (auto p = connecthead; p >= 0; p = connectpoint2[p]) if (ps[p].cursector == dasectp)