diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 8970e0c6..608a4beb 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -707,6 +707,9 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) { if (activeCommandClass == ccAttack) { ct = selection.getUnitFromCC(ccAttack)->getType()->getFirstCtOfClass(activeCommandClass); } + auto mct= unit->getCurrMorphCt(); + if(mct) ct= mct->getMorphUnit()->getFirstCtOfClass(activeCommandClass); + if(activeCommandType!=NULL && activeCommandType->getClass()==ccBuild){ assert(selection.isUniform()); selectingBuilding= true; diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index c32daa83..bb1d543c 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -747,7 +747,7 @@ void Unit::cleanupAllParticlesystems() { const MorphCommandType* Unit::getCurrMorphCt() const { 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()) { return static_cast((*result)->getCommandType()); }