added more debug info to unit crc logs

This commit is contained in:
Mark Vejvoda 2013-09-17 23:52:27 +00:00
parent b716cea3e7
commit 013ed35c8b
2 changed files with 10 additions and 0 deletions

View File

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

View File

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