From 013ed35c8bb353ca97540c123994d6792c549580 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 17 Sep 2013 23:52:27 +0000 Subject: [PATCH] added more debug info to unit crc logs --- source/glest_game/type_instances/unit.cpp | 8 ++++++++ source/glest_game/type_instances/unit.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index befbb45d..10923eeb 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1994,6 +1994,12 @@ int64 Unit::getUpdatedProgress(int64 currentProgress, int64 updateFPS, int64 spe if(speed > 0 && diagonalFactor > 0 && heightFactor > 0 && progressIncrease == 0) { progressIncrease = 1; } + + char szBuf[8096]=""; + snprintf(szBuf,8095,"currentProgress = " MG_I64_SPECIFIER " updateFPS = " MG_I64_SPECIFIER " speed = " MG_I64_SPECIFIER " diagonalFactor = " MG_I64_SPECIFIER " heightFactor = " MG_I64_SPECIFIER " speedDenominator = " MG_I64_SPECIFIER " progressIncrease = " MG_I64_SPECIFIER " [" MG_I64_SPECIFIER "]", + currentProgress,updateFPS,speed,diagonalFactor,heightFactor,speedDenominator,progressIncrease,((speed * diagonalFactor * heightFactor) / speedDenominator)); + networkCRCLogInfo = szBuf; + newProgress += progressIncrease; // if(currSkill->getClass() == scMove || (currSkill->getClass() == scStop && this->loadCount > 0)) { @@ -4066,6 +4072,8 @@ std::string Unit::toString(bool crcMode) const { result += " deadCount = " + intToStr(this->deadCount); result += " progress = " + intToStr(this->progress); result += "\n"; + result += "networkCRCLogInfo = " + networkCRCLogInfo; + result += "\n"; result += " lastAnimProgress = " + intToStr(this->lastAnimProgress); result += " animProgress = " + intToStr(this->animProgress); result += " highlight = " + floatToStr(this->highlight,16); diff --git a/source/glest_game/type_instances/unit.h b/source/glest_game/type_instances/unit.h index 496e7d2c..9d601d3d 100644 --- a/source/glest_game/type_instances/unit.h +++ b/source/glest_game/type_instances/unit.h @@ -473,6 +473,8 @@ private: Vec2i lastHarvestedResourcePos; + string networkCRCLogInfo; + public: Unit(int id, UnitPathInterface *path, const Vec2i &pos, const UnitType *type, Faction *faction, Map *map, CardinalDir placeFacing); virtual ~Unit();