diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 84bbda08..517201c9 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -2489,8 +2489,10 @@ void Unit::updateTimedParticles() { UnitParticleSystem *ps = unitParticleSystems[i]; if(ps != NULL) { if(Renderer::getInstance().validateParticleSystemStillExists(ps,rsGame) == true) { - double particleStartTime = truncateDecimal(ps->getStartTime()); - double particleEndTime = truncateDecimal(ps->getEndTime()); + float pst = ps->getStartTime(); + float pet = ps->getEndTime(); + double particleStartTime = truncateDecimal(pst); + double particleEndTime = truncateDecimal(pet); if(particleStartTime != 0.0 || particleEndTime != 1.0) { //printf("Checking for end particle system #%d [%d] [%f] [%f] [%f] [%f]\n",i,ps->shape,truncateDecimal(ps->getStartTime()),truncateDecimal(ps->getEndTime()),truncateDecimal(animProgress),truncateDecimal(lastAnimProgress)); @@ -4098,7 +4100,9 @@ std::string Unit::toString(bool crcMode) const { result += "\n"; result += " lastAnimProgress = " + intToStr(this->lastAnimProgress); result += " animProgress = " + intToStr(this->animProgress); - result += " highlight = " + floatToStr(this->highlight,16); + if(crcMode == false) { + result += " highlight = " + floatToStr(this->highlight,16); + } result += " progress2 = " + intToStr(this->progress2); result += " kills = " + intToStr(this->kills); result += " enemyKills = " + intToStr(this->enemyKills); @@ -5051,6 +5055,9 @@ Checksum Unit::getCRC() { } //TotalUpgrade totalUpgrade; + uint32 crc = totalUpgrade.getCRC().getSum(); + crcForUnit.addBytes(&crc,sizeof(uint32)); + //Map *map; //UnitPathInterface *unitPath; //WaypointPath waypointPath; diff --git a/source/glest_game/types/upgrade_type.h b/source/glest_game/types/upgrade_type.h index 0c88f112..10475f5e 100644 --- a/source/glest_game/types/upgrade_type.h +++ b/source/glest_game/types/upgrade_type.h @@ -125,26 +125,71 @@ public: result += "sightIsMultiplier = " + intToStr(sightIsMultiplier); result += " maxEp = " + intToStr(maxEp); - result += "maxEpIsMultiplier = " + intToStr(maxEpIsMultiplier); + result += " maxEpIsMultiplier = " + intToStr(maxEpIsMultiplier); result += " maxEpRegeneration = " + intToStr(maxEpRegeneration); //result += "maxEpRegenerationIsMultiplier = " + intToStr(maxEpRegenerationIsMultiplier); result += " armor = " + intToStr(armor); - result += "armorIsMultiplier = " + intToStr(armorIsMultiplier); + result += " armorIsMultiplier = " + intToStr(armorIsMultiplier); result += " attackStrength = " + intToStr(attackStrength); - result += "attackStrengthIsMultiplier = " + intToStr(attackStrengthIsMultiplier); + result += " attackStrengthIsMultiplier = " + intToStr(attackStrengthIsMultiplier); result += " attackRange = " + intToStr(attackRange); - result += "attackRangeIsMultiplier = " + intToStr(attackRangeIsMultiplier); + result += " attackRangeIsMultiplier = " + intToStr(attackRangeIsMultiplier); result += " moveSpeed = " + intToStr(moveSpeed); - result += "moveSpeedIsMultiplier = " + intToStr(moveSpeedIsMultiplier); + result += " moveSpeedIsMultiplier = " + intToStr(moveSpeedIsMultiplier); result += " prodSpeed = " + intToStr(prodSpeed); - result += "prodSpeedIsMultiplier = " + intToStr(prodSpeedIsMultiplier); + result += " prodSpeedIsMultiplier = " + intToStr(prodSpeedIsMultiplier); return result; } virtual void saveGame(XmlNode *rootNode) const; static const UpgradeType * loadGame(const XmlNode *rootNode, Faction *faction); + + Checksum getCRC() { + Checksum crcForUpgradeType; + + crcForUpgradeType.addString(upgradename); + crcForUpgradeType.addInt(maxHp); + crcForUpgradeType.addInt(maxHpIsMultiplier); + crcForUpgradeType.addInt(maxHpRegeneration); + + crcForUpgradeType.addInt(sight); + crcForUpgradeType.addInt(sightIsMultiplier); + + crcForUpgradeType.addInt(maxEp); + crcForUpgradeType.addInt(maxEpIsMultiplier); + crcForUpgradeType.addInt(maxEpRegeneration); + + crcForUpgradeType.addInt(armor); + crcForUpgradeType.addInt(armorIsMultiplier); + + crcForUpgradeType.addInt(attackStrength); + crcForUpgradeType.addInt(attackStrengthIsMultiplier); + //std::map attackStrengthMultiplierValueList; + crcForUpgradeType.addInt64((int64)attackStrengthMultiplierValueList.size()); + + crcForUpgradeType.addInt(attackRange); + crcForUpgradeType.addInt(attackRangeIsMultiplier); + //std::map attackRangeMultiplierValueList; + crcForUpgradeType.addInt64((int64)attackRangeMultiplierValueList.size()); + + crcForUpgradeType.addInt(moveSpeed); + crcForUpgradeType.addInt(moveSpeedIsMultiplier); + //std::map moveSpeedIsMultiplierValueList; + crcForUpgradeType.addInt64((int64)moveSpeedIsMultiplierValueList.size()); + + crcForUpgradeType.addInt(prodSpeed); + crcForUpgradeType.addInt(prodSpeedIsMultiplier); + //std::map prodSpeedProduceIsMultiplierValueList; + crcForUpgradeType.addInt64((int64)prodSpeedProduceIsMultiplierValueList.size()); + //std::map prodSpeedUpgradeIsMultiplierValueList; + crcForUpgradeType.addInt64((int64)prodSpeedUpgradeIsMultiplierValueList.size()); + //std::map prodSpeedMorphIsMultiplierValueList; + crcForUpgradeType.addInt64((int64)prodSpeedMorphIsMultiplierValueList.size()); + + return crcForUpgradeType; + } }; // ===============================