- attempt to detect oos by adding more crc and log info

This commit is contained in:
Mark Vejvoda 2013-10-14 02:35:42 +00:00
parent 769c1ced91
commit 37a53c114a
3 changed files with 6 additions and 2 deletions

View File

@ -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());

View File

@ -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

View File

@ -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;
}