diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 5e0200984..b008a587a 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -3007,9 +3007,9 @@ bool Unit::repair(){ //decrements HP and returns if dead bool Unit::decHp(int decrementValue) { -// char szBuf[8096]=""; -// snprintf(szBuf,8095,"this->hp = %d, decrementValue = %d",this->hp,decrementValue); -// addNetworkCRCDecHp(szBuf); + char szBuf[8096]=""; + snprintf(szBuf,8095,"this->hp = %d, decrementValue = %d",this->hp,decrementValue); + addNetworkCRCDecHp(szBuf); if(this->hp == 0) { return false; @@ -4116,8 +4116,10 @@ bool Unit::showTranslatedTechTree() const { string Unit::getNetworkCRCDecHpList() const { string result = ""; - for(unsigned int index = 0; index < networkCRCDecHpList.size(); ++index) { - result += networkCRCDecHpList[index] + " "; + if(networkCRCDecHpList.empty() == false) { + for(unsigned int index = 0; index < networkCRCDecHpList.size(); ++index) { + result += networkCRCDecHpList[index] + " "; + } } return result; } diff --git a/source/glest_game/type_instances/unit.h b/source/glest_game/type_instances/unit.h index 4345cfb60..d4423cac7 100644 --- a/source/glest_game/type_instances/unit.h +++ b/source/glest_game/type_instances/unit.h @@ -782,16 +782,16 @@ public: void setNetworkCRCParticleLogInfo(string networkCRCParticleLogInfo) { this->networkCRCParticleLogInfo = networkCRCParticleLogInfo; } void setNetworkCRCParticleObserverLogInfo(string networkCRCParticleObserverLogInfo) { this->networkCRCParticleObserverLogInfo = networkCRCParticleObserverLogInfo; } - //void clearNetworkCRCDecHpList() { networkCRCDecHpList.clear(); } - void clearNetworkCRCDecHpList() { } + void clearNetworkCRCDecHpList() { networkCRCDecHpList.clear(); } + //void clearNetworkCRCDecHpList() { } Checksum getCRC(); virtual void end(ParticleSystem *particleSystem); private: - //void addNetworkCRCDecHp(string info) { networkCRCDecHpList.push_back(info); } - void addNetworkCRCDecHp(string info) { } + void addNetworkCRCDecHp(string info) { networkCRCDecHpList.push_back(info); } + //void addNetworkCRCDecHp(string info) { } string getNetworkCRCDecHpList() const; float computeHeight(const Vec2i &pos) const; diff --git a/source/shared_lib/sources/graphics/particle.cpp b/source/shared_lib/sources/graphics/particle.cpp index 12b5d6bcc..000ad9807 100644 --- a/source/shared_lib/sources/graphics/particle.cpp +++ b/source/shared_lib/sources/graphics/particle.cpp @@ -2306,7 +2306,8 @@ bool ParticleManager::hasActiveParticleSystem(ParticleSystem::ParticleSystemType //currentParticleCount+= ps->getAliveParticleCount(); bool showParticle= true; - if(dynamic_cast (ps) != NULL || dynamic_cast (ps) != NULL){ + if(dynamic_cast (ps) != NULL || + dynamic_cast (ps) != NULL) { showParticle= ps->getVisible() || (ps->getState() == ParticleSystem::sFade); } if(showParticle == true){