diff --git a/data/glest_game b/data/glest_game index c61c99a9..3de3304f 160000 --- a/data/glest_game +++ b/data/glest_game @@ -1 +1 @@ -Subproject commit c61c99a9486adb2408c633209d5fc83d37e4810f +Subproject commit 3de3304fd08fed556c5bfee168fcaa64bbf75612 diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index eda14d39..e4a2a9c2 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1321,7 +1321,8 @@ void Unit::setCurrSkill(const SkillType *currSkill) { } */ checkCustomizedUnitParticleListTriggers(unitParticleSystems, - currSkill->unitParticleSystemTypes,queuedUnitParticleSystemTypes); + currSkill->unitParticleSystemTypes, + queuedUnitParticleSystemTypes, true); } progress2= 0; if(this->currSkill != currSkill) { @@ -3996,7 +3997,8 @@ void Unit::stopDamageParticles(bool force) { void Unit::checkCustomizedUnitParticleListTriggers(vector &unitParticleSystemsList, const UnitParticleSystemTypes &unitParticleSystemTypesList, - vector &queuedUnitParticleSystemTypesList) { + vector &queuedUnitParticleSystemTypesList, + bool applySkillChangeParticles) { if(showUnitParticles == true) { vector systemTypesInUse; @@ -4055,12 +4057,13 @@ void Unit::checkCustomizedUnitParticleListTriggers(vector & //printf("Check Particle line: %d isenabled: %d already in use: %d\n",__LINE__,pst->getMinmaxEnabled(),(iterFind == systemTypesInUse.end())); + bool showParticle = applySkillChangeParticles; if(pst->getMinmaxEnabled() == true) { //printf("Check Particle line: %d isenabled: %d already in use: %d\n",__LINE__,pst->getMinmaxEnabled(),(iterFind != systemTypesInUse.end())); + showParticle = false; if(iterFind == systemTypesInUse.end()) { - bool showParticle = false; if(pst->getMinmaxIsPercent() == false) { if(hp >= pst->getMinHp() && hp <= pst->getMaxHp()) { showParticle = true; @@ -4076,30 +4079,31 @@ void Unit::checkCustomizedUnitParticleListTriggers(vector & //printf("START Particle line: %d\n",__LINE__); } } - - if(showParticle == true) { - - if(pst->getStartTime() == 0.0) { - UnitParticleSystem *ups = new UnitParticleSystem(200); - ups->setParticleOwner(this); - ups->setParticleType(pst); - - pst->setValues(ups); - ups->setPos(getCurrVector()); - ups->setRotation(getRotation()); - ups->setUnitModel(getCurrentModelPtr()); - if(getFaction()->getTexture()) { - ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); - } - unitParticleSystemsList.push_back(ups); - Renderer::getInstance().manageParticleSystem(ups, rsGame); - } - else { - queuedUnitParticleSystemTypesList.push_back(pst); - } - } } } + + if(showParticle == true) { + + if(pst->getStartTime() == 0.0) { + UnitParticleSystem *ups = new UnitParticleSystem(200); + ups->setParticleOwner(this); + ups->setParticleType(pst); + + pst->setValues(ups); + ups->setPos(getCurrVector()); + ups->setRotation(getRotation()); + ups->setUnitModel(getCurrentModelPtr()); + if(getFaction()->getTexture()) { + ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); + } + unitParticleSystemsList.push_back(ups); + Renderer::getInstance().manageParticleSystem(ups, rsGame); + } + else { + queuedUnitParticleSystemTypesList.push_back(pst); + } + } + } } } @@ -4109,7 +4113,8 @@ void Unit::checkCustomizedUnitParticleListTriggers(vector & void Unit::checkCustomizedUnitParticleTriggers() { if(currSkill != NULL) { checkCustomizedUnitParticleListTriggers(unitParticleSystems, - currSkill->unitParticleSystemTypes,queuedUnitParticleSystemTypes); + currSkill->unitParticleSystemTypes, + queuedUnitParticleSystemTypes, false); } } diff --git a/source/glest_game/type_instances/unit.h b/source/glest_game/type_instances/unit.h index 64cc1d4d..9c0381d9 100644 --- a/source/glest_game/type_instances/unit.h +++ b/source/glest_game/type_instances/unit.h @@ -826,7 +826,8 @@ private: void checkCustomizedUnitParticleTriggers(); void checkCustomizedUnitParticleListTriggers(vector &unitParticleSystemsList, const UnitParticleSystemTypes &unitParticleSystemTypesList, - vector &queuedUnitParticleSystemTypesList); + vector &queuedUnitParticleSystemTypesList, + bool applySkillChangeParticles); bool checkModelStateInfoForNewHpValue();