re-enable some hitpoint tracking for crc checks

This commit is contained in:
Mark Vejvoda
2013-10-03 20:04:55 +00:00
parent ada8810666
commit ebcbaafc0d
3 changed files with 13 additions and 10 deletions

View File

@@ -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,9 +4116,11 @@ bool Unit::showTranslatedTechTree() const {
string Unit::getNetworkCRCDecHpList() const {
string result = "";
if(networkCRCDecHpList.empty() == false) {
for(unsigned int index = 0; index < networkCRCDecHpList.size(); ++index) {
result += networkCRCDecHpList[index] + " ";
}
}
return result;
}
std::string Unit::toString(bool crcMode) const {

View File

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

View File

@@ -2306,7 +2306,8 @@ bool ParticleManager::hasActiveParticleSystem(ParticleSystem::ParticleSystemType
//currentParticleCount+= ps->getAliveParticleCount();
bool showParticle= true;
if(dynamic_cast<UnitParticleSystem *> (ps) != NULL || dynamic_cast<FireParticleSystem *> (ps) != NULL){
if(dynamic_cast<UnitParticleSystem *> (ps) != NULL ||
dynamic_cast<FireParticleSystem *> (ps) != NULL) {
showParticle= ps->getVisible() || (ps->getState() == ParticleSystem::sFade);
}
if(showParticle == true){