mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 11:42:31 +01:00
new param <anim-hp-bound value="true"/> for BeBuilt skill to have the animation progress bound to the HP. / fixed a nullpointer exception related to particles
This commit is contained in:
parent
8e1836220d
commit
a1ab98d4b9
@ -1250,8 +1250,12 @@ bool Unit::update() {
|
||||
float speedDenominator = (speedDivider * game->getWorld()->getUpdateFps(this->getFactionIndex()));
|
||||
progress += (speed * diagonalFactor * heightFactor) / speedDenominator;
|
||||
|
||||
if(currSkill->getClass() == scBeBuilt && static_cast<const BeBuiltSkillType*>(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();
|
||||
|
@ -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<string,vector<pair<string, string> > > &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";
|
||||
}
|
||||
|
@ -303,7 +303,11 @@ public:
|
||||
// ===============================
|
||||
|
||||
class BeBuiltSkillType: public SkillType{
|
||||
private:
|
||||
bool animHpBound;
|
||||
|
||||
public:
|
||||
bool getAnimHpBound() const {return animHpBound;}
|
||||
BeBuiltSkillType();
|
||||
virtual string toString() const;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user