diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 13d5e2de..b47a9f16 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -5223,6 +5223,9 @@ Checksum Unit::getCRC() { //Vec2i currentPathFinderDesiredFinalPos; crcForUnit.addInt(random.getLastNumber()); + if(this->random.getLastCaller() != "") { + crcForUnit.addString(this->random.getLastCaller()); + } if(consoleDebug) printf("#16 Unit: %d CRC: %u\n",id,crcForUnit.getSum()); diff --git a/source/shared_lib/include/util/randomgen.h b/source/shared_lib/include/util/randomgen.h index 848e36c3..40123bd4 100644 --- a/source/shared_lib/include/util/randomgen.h +++ b/source/shared_lib/include/util/randomgen.h @@ -46,8 +46,8 @@ public: void setLastNumber(int value) { lastNumber = value; } std::string getLastCaller() const; - //void clearLastCaller() { lastCaller.clear(); } - void clearLastCaller() { } + void clearLastCaller() { lastCaller.clear(); } + //void clearLastCaller() { } }; }}//end namespace diff --git a/source/shared_lib/sources/util/randomgen.cpp b/source/shared_lib/sources/util/randomgen.cpp index 1e6eb825..31db2f54 100644 --- a/source/shared_lib/sources/util/randomgen.cpp +++ b/source/shared_lib/sources/util/randomgen.cpp @@ -40,6 +40,7 @@ void RandomGen::init(int seed){ } int RandomGen::rand(string lastCaller) { + this->lastCaller.push_back(lastCaller); this->lastNumber = (a*lastNumber + b) % m; return lastNumber; }