fix: non-targed commands + TODO
This commit is contained in:
parent
37b6fbb12e
commit
d2d691024e
|
@ -707,6 +707,9 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
|
||||||
if (activeCommandClass == ccAttack) {
|
if (activeCommandClass == ccAttack) {
|
||||||
ct = selection.getUnitFromCC(ccAttack)->getType()->getFirstCtOfClass(activeCommandClass);
|
ct = selection.getUnitFromCC(ccAttack)->getType()->getFirstCtOfClass(activeCommandClass);
|
||||||
}
|
}
|
||||||
|
auto mct= unit->getCurrMorphCt();
|
||||||
|
if(mct) ct= mct->getMorphUnit()->getFirstCtOfClass(activeCommandClass);
|
||||||
|
|
||||||
if(activeCommandType!=NULL && activeCommandType->getClass()==ccBuild){
|
if(activeCommandType!=NULL && activeCommandType->getClass()==ccBuild){
|
||||||
assert(selection.isUniform());
|
assert(selection.isUniform());
|
||||||
selectingBuilding= true;
|
selectingBuilding= true;
|
||||||
|
|
|
@ -747,7 +747,7 @@ void Unit::cleanupAllParticlesystems() {
|
||||||
|
|
||||||
const MorphCommandType* Unit::getCurrMorphCt() const {
|
const MorphCommandType* Unit::getCurrMorphCt() const {
|
||||||
auto result = std::find_if(commands.rbegin(), commands.rend(),[](Command *i)
|
auto result = std::find_if(commands.rbegin(), commands.rend(),[](Command *i)
|
||||||
{ return i->getCommandType()->getClass() == ccMorph? true: false; });
|
{ return i->getCommandType()->getClass() == ccMorph; });//TODO set CurrMorphCt on push comands instead of looping
|
||||||
if(result != commands.rend()) {
|
if(result != commands.rend()) {
|
||||||
return static_cast<const MorphCommandType*>((*result)->getCommandType());
|
return static_cast<const MorphCommandType*>((*result)->getCommandType());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue