From 17da18978a9a73f2faf5145c68b1e1cb42b74dc5 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 22 Jun 2013 07:39:12 +0000 Subject: [PATCH] init variables --- source/glest_game/type_instances/unit.cpp | 5 +++++ source/shared_lib/include/graphics/vec.h | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 66c8c44d..34e49c05 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -423,6 +423,11 @@ Unit::Unit(int id, UnitPathInterface *unitpath, const Vec2i &pos, causeOfDeath = ucodNone; pathfindFailedConsecutiveFrameCount = 0; + lastSynchDataString = ""; + lastFile = ""; + lastLine = 0; + lastSource = ""; + targetRotationZ=.0f; targetRotationX=.0f; rotationZ=.0f; diff --git a/source/shared_lib/include/graphics/vec.h b/source/shared_lib/include/graphics/vec.h index 584b3536..98c4557a 100644 --- a/source/shared_lib/include/graphics/vec.h +++ b/source/shared_lib/include/graphics/vec.h @@ -97,6 +97,8 @@ public: public: Vec2(){ + x = 0; + y = 0; }; explicit Vec2(T *p){ @@ -322,14 +324,17 @@ typedef Vec2 Vec2d; // ===================================================== template -class Vec3{ +class Vec3 { public: T x; T y; T z; public: - Vec3(){ + Vec3() { + x = 0; + y = 0; + z = 0; }; explicit Vec3(T *p){ @@ -576,7 +581,7 @@ typedef Vec3 Vec3d; // ===================================================== template -class Vec4{ +class Vec4 { public: T x; T y; @@ -584,6 +589,10 @@ public: T w; public: Vec4() { + x = 0; + y = 0; + z = 0; + w = 0; }; explicit Vec4(const T *p){