(svn r16505) -Fix [FS#2951] (r16472): since g++ 4.4 the implicit (default) constructor will zero the whole class. This caused all vehicle indices to be 0, which causes all kinds of trouble.

This commit is contained in:
rubidium
2009-06-02 19:12:28 +00:00
parent e6b8b65fcd
commit d7eb9f9d0e
6 changed files with 12 additions and 0 deletions

View File

@@ -314,6 +314,8 @@ struct Train : public SpecializedVehicle<Train, VEH_TRAIN> {
RailTypeByte railtype;
RailTypes compatible_railtypes;
/** We don't want GCC to zero our struct! It already is zeroed and has an index! */
Train() : SpecializedVehicle<Train, VEH_TRAIN>() {}
/** We want to 'destruct' the right class. */
virtual ~Train() { this->PreDestructor(); }