From 2fc0cb3e76ec36826056c661555b925b3ce43fe3 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 2 Jun 2009 19:12:28 +0000 Subject: (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. --- src/train.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/train.h') diff --git a/src/train.h b/src/train.h index bcf005472..b52b52396 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(); } -- cgit v1.2.3-54-g00ecf