From 2605e1c4d7ae9c5a078099fafd4211de4a02e36a Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 30 Jul 2010 01:19:31 +0000 Subject: [PATCH] - added proper constructor to init pointers to NULL in case or early game load problems to avoid a crash --- source/glest_game/world/unit_updater.cpp | 12 ++++++++++++ source/glest_game/world/unit_updater.h | 1 + 2 files changed, 13 insertions(+) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 0b7110836..216fc71dc 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -43,6 +43,18 @@ namespace Glest{ namespace Game{ // ===================== PUBLIC ======================== +UnitUpdater::UnitUpdater() { + this->game= NULL; + this->gui= NULL; + this->gameCamera= NULL; + this->world= NULL; + this->map= NULL; + this->console= NULL; + this->scriptManager= NULL; + this->routePlanner = NULL; + this->pathFinder = NULL; +} + void UnitUpdater::init(Game *game){ this->game= game; diff --git a/source/glest_game/world/unit_updater.h b/source/glest_game/world/unit_updater.h index 5a14bd5f7..400c1c14e 100644 --- a/source/glest_game/world/unit_updater.h +++ b/source/glest_game/world/unit_updater.h @@ -60,6 +60,7 @@ private: RandomGen random; public: + UnitUpdater(); void init(Game *game); ~UnitUpdater();