summaryrefslogtreecommitdiff
path: root/src/roadveh.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-06-02 19:12:28 +0000
committerrubidium <rubidium@openttd.org>2009-06-02 19:12:28 +0000
commit2fc0cb3e76ec36826056c661555b925b3ce43fe3 (patch)
tree3abde6b4e39242c5d4c8f255f5f4b8d4403b0b47 /src/roadveh.h
parent78a25e84e9d7935404f13c041e8a93c4e9b6ff47 (diff)
downloadopenttd-2fc0cb3e76ec36826056c661555b925b3ce43fe3.tar.xz
(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.
Diffstat (limited to 'src/roadveh.h')
-rw-r--r--src/roadveh.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/roadveh.h b/src/roadveh.h
index 7a248b8e7..687cbd313 100644
--- a/src/roadveh.h
+++ b/src/roadveh.h
@@ -133,6 +133,8 @@ struct RoadVehicle : public SpecializedVehicle<RoadVehicle, VEH_ROAD> {
RoadType roadtype;
RoadTypes compatible_roadtypes;
+ /** We don't want GCC to zero our struct! It already is zeroed and has an index! */
+ RoadVehicle() : SpecializedVehicle<RoadVehicle, VEH_ROAD>() {}
/** We want to 'destruct' the right class. */
virtual ~RoadVehicle() { this->PreDestructor(); }