- use value initialization for secspecial_t

This commit is contained in:
Tommy Nguyen 2018-10-23 13:19:10 -04:00 committed by Christoph Oelckers
parent 43c30ff485
commit 75bd1b00b4
4 changed files with 6 additions and 16 deletions

View file

@ -428,7 +428,7 @@ bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int t
switch (change & 3)
{
case 1: // type is zeroed
ceiling->m_NewSpecial.Clear();
ceiling->m_NewSpecial = {};
ceiling->m_Type = DCeiling::genCeilingChg0;
break;
case 2: // type is copied
@ -447,7 +447,7 @@ bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int t
switch (change & 3)
{
case 1: // type is zeroed
ceiling->m_NewSpecial.Clear();
ceiling->m_NewSpecial = {};
ceiling->m_Type = DCeiling::genCeilingChg0;
break;
case 2: // type is copied

View file

@ -229,7 +229,7 @@ void DFloor::SetFloorChangeType (sector_t *sec, int change)
switch (change & 3)
{
case 1:
m_NewSpecial.Clear();
m_NewSpecial = {};
m_Type = DFloor::genFloorChg0;
break;
case 2:
@ -828,7 +828,7 @@ bool EV_DoDonut (int tag, line_t *line, double pillarspeed, double slimespeed)
floor->m_Speed = slimespeed;
floor->m_Instant = false;
floor->m_Texture = s3->GetTexture(sector_t::floor);
floor->m_NewSpecial.Clear();
floor->m_NewSpecial = {};
height = s3->FindHighestFloorPoint (&spot);
floor->m_FloorDestDist = s2->floorplane.PointToDist (spot, height);
floor->StartFloorSound ();

View file

@ -439,7 +439,7 @@ protected:
// [RH] Need these for BOOM-ish transferring ceilings
FTextureID m_Texture;
secspecial_t m_NewSpecial;
secspecial_t m_NewSpecial{};
// ID
int m_Tag;
@ -536,7 +536,7 @@ public:
bool m_Hexencrush;
bool m_Instant;
int m_Direction;
secspecial_t m_NewSpecial;
secspecial_t m_NewSpecial{};
FTextureID m_Texture;
double m_FloorDestDist;
double m_Speed;

View file

@ -588,16 +588,6 @@ struct secspecial_t
short damageinterval; // Interval for damage application
short leakydamage; // chance of leaking through radiation suit
int Flags;
secspecial_t()
{
Clear();
}
void Clear()
{
memset(this, 0, sizeof(*this));
}
};
FSerializer &Serialize(FSerializer &arc, const char *key, secspecial_t &spec, secspecial_t *def);