diff --git a/src/aircraft.h b/src/aircraft.h index 1977b82494..b782aae502 100644 --- a/src/aircraft.h +++ b/src/aircraft.h @@ -100,6 +100,8 @@ struct Aircraft : public SpecializedVehicle { StationID targetairport; byte state; + /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ + Aircraft() : SpecializedVehicle() {} /** We want to 'destruct' the right class. */ virtual ~Aircraft() { this->PreDestructor(); } diff --git a/src/effectvehicle_base.h b/src/effectvehicle_base.h index 15c100b062..1f99661eb3 100644 --- a/src/effectvehicle_base.h +++ b/src/effectvehicle_base.h @@ -19,6 +19,8 @@ struct EffectVehicle : public SpecializedVehicle { uint16 animation_state; byte animation_substate; + /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ + EffectVehicle() : SpecializedVehicle() {} /** We want to 'destruct' the right class. */ virtual ~EffectVehicle() {} diff --git a/src/roadveh.h b/src/roadveh.h index 7a248b8e76..687cbd313f 100644 --- a/src/roadveh.h +++ b/src/roadveh.h @@ -133,6 +133,8 @@ struct RoadVehicle : public SpecializedVehicle { RoadType roadtype; RoadTypes compatible_roadtypes; + /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ + RoadVehicle() : SpecializedVehicle() {} /** We want to 'destruct' the right class. */ virtual ~RoadVehicle() { this->PreDestructor(); } diff --git a/src/ship.h b/src/ship.h index 7e1b2ec6d5..01e337eea4 100644 --- a/src/ship.h +++ b/src/ship.h @@ -20,6 +20,8 @@ void GetShipSpriteSize(EngineID engine, uint &width, uint &height); struct Ship: public SpecializedVehicle { TrackBitsByte state; + /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ + Ship() : SpecializedVehicle() {} /** We want to 'destruct' the right class. */ virtual ~Ship() { this->PreDestructor(); } diff --git a/src/train.h b/src/train.h index bcf005472c..b52b52396f 100644 --- a/src/train.h +++ b/src/train.h @@ -314,6 +314,8 @@ struct Train : public SpecializedVehicle { RailTypeByte railtype; RailTypes compatible_railtypes; + /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ + Train() : SpecializedVehicle() {} /** We want to 'destruct' the right class. */ virtual ~Train() { this->PreDestructor(); } diff --git a/src/vehicle_base.h b/src/vehicle_base.h index b4a43e2aec..b6bcbb4b61 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -584,6 +584,8 @@ struct DisasterVehicle : public SpecializedVehicle() {} /** We want to 'destruct' the right class. */ virtual ~DisasterVehicle() {}