diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 4295d1c4..7062edd2 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1250,8 +1250,12 @@ bool Unit::update() { float speedDenominator = (speedDivider * game->getWorld()->getUpdateFps(this->getFactionIndex())); progress += (speed * diagonalFactor * heightFactor) / speedDenominator; - animProgress += (currSkill->getAnimSpeed() * heightFactor) / speedDenominator; - + if(currSkill->getClass() == scBeBuilt && static_cast(currSkill)->getAnimHpBound()==true ){ + animProgress=this->getHpRatio(); + } + else{ + animProgress += (currSkill->getAnimSpeed() * heightFactor) / speedDenominator; + } //update target updateTarget(); @@ -2230,7 +2234,7 @@ void Unit::stopDamageParticles(bool force) { } } } - if(force == true || pst->getMinmaxEnabled() == false) { + if(force == true || ( pst !=NULL && pst->getMinmaxEnabled() == false )) { damageParticleSystemsInUse.erase(foundParticleIndexType); ps->fade(); damageParticleSystems.pop_back(); diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index be27bd91..07248d02 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -625,6 +625,20 @@ BeBuiltSkillType::BeBuiltSkillType(){ skillClass= scBeBuilt; } +void BeBuiltSkillType::load(const XmlNode *sn, const string &dir, const TechTree *tt, + const FactionType *ft, std::map > > &loadedFileList, + string parentLoader) { + SkillType::load(sn, dir, tt, ft, loadedFileList, parentLoader); + + if(sn->hasChild("anim-hp-bound")){ + animHpBound= sn->getChild("anim-hp-bound")->getAttribute("value")->getBoolValue(); + } + else { + animHpBound=false; + } +} + + string BeBuiltSkillType::toString() const{ return "Be built"; } diff --git a/source/glest_game/types/skill_type.h b/source/glest_game/types/skill_type.h index 3cb11a08..af05a589 100644 --- a/source/glest_game/types/skill_type.h +++ b/source/glest_game/types/skill_type.h @@ -303,7 +303,11 @@ public: // =============================== class BeBuiltSkillType: public SkillType{ +private: + bool animHpBound; + public: + bool getAnimHpBound() const {return animHpBound;} BeBuiltSkillType(); virtual string toString() const; };