diff --git a/src/g_shared/a_skies.cpp b/src/g_shared/a_skies.cpp index 57fce23fd0..6e85bd8862 100644 --- a/src/g_shared/a_skies.cpp +++ b/src/g_shared/a_skies.cpp @@ -59,13 +59,6 @@ void ASkyViewpoint::BeginPlay () void ASkyViewpoint::Destroy () { // remove all sector references to ourselves. - for (int i = 0; i < numsectors; i++) - { - if (sectors[i].GetPortal(sector_t::floor)->mSkybox == this) - sectors[i].ClearPortal(sector_t::floor); - if (sectors[i].GetPortal(sector_t::ceiling)->mSkybox == this) - sectors[i].ClearPortal(sector_t::ceiling); - } for (auto &s : sectorPortals) { if (s.mSkybox == this) s.mSkybox = 0; diff --git a/src/portal.cpp b/src/portal.cpp index af98718bfb..64a4dd97de 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -231,6 +231,10 @@ FArchive &operator<< (FArchive &arc, FSectorPortal &port) << port.mDestination << port.mDisplacement << port.mPlaneZ; + if (arc.IsLoading()) + { + port.mSkybox = nullptr; + } return arc; } diff --git a/src/portal.h b/src/portal.h index bba674def5..a87ae207f7 100644 --- a/src/portal.h +++ b/src/portal.h @@ -191,7 +191,6 @@ struct FLinePortal double mSinRot; double mCosRot; portnode_t *render_thinglist; - void *mRenderData; }; extern TArray linePortals; @@ -229,7 +228,6 @@ struct FSectorPortal DVector2 mDisplacement; double mPlaneZ; TObjPtr mSkybox; - void *mRenderData; bool MergeAllowed() const {