Fix setNull on inherited classes leaving uninitialized variables

This commit is contained in:
ZehMatt 2021-07-27 21:34:53 +03:00
parent 163fe3756d
commit b7b3418b75
No known key found for this signature in database
GPG key ID: 18CE582C71A225B0

View file

@ -268,6 +268,12 @@ struct CoordsXYZ : public CoordsXY
{
return ToTileStart() + CoordsXYZ{ COORDS_XY_HALF_TILE, COORDS_XY_HALF_TILE, 0 };
}
void setNull()
{
CoordsXY::setNull();
z = 0;
}
};
struct CoordsXYRangedZ : public CoordsXY
@ -459,6 +465,12 @@ struct TileCoordsXYZ : public TileCoordsXY
}
return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP };
}
void setNull()
{
TileCoordsXY::setNull();
z = 0;
}
};
/**
@ -655,6 +667,12 @@ struct TileCoordsXYZD : public TileCoordsXYZ
}
return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP, direction };
}
void setNull()
{
TileCoordsXYZ::setNull();
direction = INVALID_DIRECTION;
}
};
/**