- fixed unit particles so they worked for normal use cases

This commit is contained in:
SoftCoder 2014-11-24 14:36:12 -08:00
parent eae90a2198
commit 29ab1094ec
3 changed files with 34 additions and 28 deletions

@ -1 +1 @@
Subproject commit c61c99a9486adb2408c633209d5fc83d37e4810f Subproject commit 3de3304fd08fed556c5bfee168fcaa64bbf75612

View File

@ -1321,7 +1321,8 @@ void Unit::setCurrSkill(const SkillType *currSkill) {
} }
*/ */
checkCustomizedUnitParticleListTriggers(unitParticleSystems, checkCustomizedUnitParticleListTriggers(unitParticleSystems,
currSkill->unitParticleSystemTypes,queuedUnitParticleSystemTypes); currSkill->unitParticleSystemTypes,
queuedUnitParticleSystemTypes, true);
} }
progress2= 0; progress2= 0;
if(this->currSkill != currSkill) { if(this->currSkill != currSkill) {
@ -3996,7 +3997,8 @@ void Unit::stopDamageParticles(bool force) {
void Unit::checkCustomizedUnitParticleListTriggers(vector<UnitParticleSystem*> &unitParticleSystemsList, void Unit::checkCustomizedUnitParticleListTriggers(vector<UnitParticleSystem*> &unitParticleSystemsList,
const UnitParticleSystemTypes &unitParticleSystemTypesList, const UnitParticleSystemTypes &unitParticleSystemTypesList,
vector<UnitParticleSystemType*> &queuedUnitParticleSystemTypesList) { vector<UnitParticleSystemType*> &queuedUnitParticleSystemTypesList,
bool applySkillChangeParticles) {
if(showUnitParticles == true) { if(showUnitParticles == true) {
vector<ParticleSystemTypeInterface *> systemTypesInUse; vector<ParticleSystemTypeInterface *> systemTypesInUse;
@ -4055,12 +4057,13 @@ void Unit::checkCustomizedUnitParticleListTriggers(vector<UnitParticleSystem*> &
//printf("Check Particle line: %d isenabled: %d already in use: %d\n",__LINE__,pst->getMinmaxEnabled(),(iterFind == systemTypesInUse.end())); //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) { if(pst->getMinmaxEnabled() == true) {
//printf("Check Particle line: %d isenabled: %d already in use: %d\n",__LINE__,pst->getMinmaxEnabled(),(iterFind != systemTypesInUse.end())); //printf("Check Particle line: %d isenabled: %d already in use: %d\n",__LINE__,pst->getMinmaxEnabled(),(iterFind != systemTypesInUse.end()));
showParticle = false;
if(iterFind == systemTypesInUse.end()) { if(iterFind == systemTypesInUse.end()) {
bool showParticle = false;
if(pst->getMinmaxIsPercent() == false) { if(pst->getMinmaxIsPercent() == false) {
if(hp >= pst->getMinHp() && hp <= pst->getMaxHp()) { if(hp >= pst->getMinHp() && hp <= pst->getMaxHp()) {
showParticle = true; showParticle = true;
@ -4076,6 +4079,8 @@ void Unit::checkCustomizedUnitParticleListTriggers(vector<UnitParticleSystem*> &
//printf("START Particle line: %d\n",__LINE__); //printf("START Particle line: %d\n",__LINE__);
} }
} }
}
}
if(showParticle == true) { if(showParticle == true) {
@ -4098,8 +4103,7 @@ void Unit::checkCustomizedUnitParticleListTriggers(vector<UnitParticleSystem*> &
queuedUnitParticleSystemTypesList.push_back(pst); queuedUnitParticleSystemTypesList.push_back(pst);
} }
} }
}
}
} }
} }
} }
@ -4109,7 +4113,8 @@ void Unit::checkCustomizedUnitParticleListTriggers(vector<UnitParticleSystem*> &
void Unit::checkCustomizedUnitParticleTriggers() { void Unit::checkCustomizedUnitParticleTriggers() {
if(currSkill != NULL) { if(currSkill != NULL) {
checkCustomizedUnitParticleListTriggers(unitParticleSystems, checkCustomizedUnitParticleListTriggers(unitParticleSystems,
currSkill->unitParticleSystemTypes,queuedUnitParticleSystemTypes); currSkill->unitParticleSystemTypes,
queuedUnitParticleSystemTypes, false);
} }
} }

View File

@ -826,7 +826,8 @@ private:
void checkCustomizedUnitParticleTriggers(); void checkCustomizedUnitParticleTriggers();
void checkCustomizedUnitParticleListTriggers(vector<UnitParticleSystem*> &unitParticleSystemsList, void checkCustomizedUnitParticleListTriggers(vector<UnitParticleSystem*> &unitParticleSystemsList,
const UnitParticleSystemTypes &unitParticleSystemTypesList, const UnitParticleSystemTypes &unitParticleSystemTypesList,
vector<UnitParticleSystemType*> &queuedUnitParticleSystemTypesList); vector<UnitParticleSystemType*> &queuedUnitParticleSystemTypesList,
bool applySkillChangeParticles);
bool checkModelStateInfoForNewHpValue(); bool checkModelStateInfoForNewHpValue();