diff --git a/src/maploader/specials.cpp b/src/maploader/specials.cpp index 240b0818bf..9393d4823a 100644 --- a/src/maploader/specials.cpp +++ b/src/maploader/specials.cpp @@ -127,7 +127,6 @@ void MapLoader::SpawnLinePortal(line_t* line) line->portalindex = Level->linePortals.Reserve(1); FLinePortal *port = &Level->linePortals.Last(); - memset(port, 0, sizeof(FLinePortal)); port->mOrigin = line; port->mDestination = dst; port->mType = uint8_t(line->args[2]); // range check is done above. diff --git a/src/playsim/portal.cpp b/src/playsim/portal.cpp index 6a0170111d..c080dc210e 100644 --- a/src/playsim/portal.cpp +++ b/src/playsim/portal.cpp @@ -540,7 +540,6 @@ unsigned FLevelLocals::GetSkyboxPortal(AActor *actor) if (sectorPortals[i].mSkybox == actor) return i; } unsigned i = sectorPortals.Reserve(1); - memset(§orPortals[i], 0, sizeof(sectorPortals[i])); sectorPortals[i].mType = PORTS_SKYVIEWPOINT; sectorPortals[i].mFlags = actor->GetClass()->IsDescendantOf("SkyCamCompat") ? 0 : PORTSF_SKYFLATONLY; sectorPortals[i].mSkybox = actor; @@ -565,7 +564,6 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, GetSkyboxPortal) unsigned FLevelLocals::GetPortal(int type, int plane, sector_t *from, sector_t *to, const DVector2 &displacement) { unsigned i = sectorPortals.Reserve(1); - memset(§orPortals[i], 0, sizeof(sectorPortals[i])); sectorPortals[i].mType = type; sectorPortals[i].mPlane = plane; sectorPortals[i].mOrigin = from; @@ -586,7 +584,6 @@ unsigned FLevelLocals::GetPortal(int type, int plane, sector_t *from, sector_t * unsigned FLevelLocals::GetStackPortal(AActor *point, int plane) { unsigned i = sectorPortals.Reserve(1); - memset(§orPortals[i], 0, sizeof(sectorPortals[i])); sectorPortals[i].mType = PORTS_STACKEDSECTORTHING; sectorPortals[i].mPlane = plane; sectorPortals[i].mOrigin = point->target->Sector; diff --git a/src/playsim/portal.h b/src/playsim/portal.h index abffde16ba..164593daf6 100644 --- a/src/playsim/portal.h +++ b/src/playsim/portal.h @@ -193,6 +193,11 @@ struct FLinePortal double mCosRot; portnode_t *lineportal_thinglist; FLinePortalSpan *mGroup; + + FLinePortal() + { + memset(this, 0, sizeof *this); + } }; struct FLinePortalSpan @@ -238,6 +243,11 @@ struct FSectorPortal double mPlaneZ; TObjPtr mSkybox; + FSectorPortal() + { + memset(this, 0, sizeof * this); + } + bool MergeAllowed() const { // For thing based stack sectors and regular skies the portal has no relevance for merging visplanes.