diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 5cfce2f06..c371cc698 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -629,7 +629,7 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) { const CommandType *ct = display.getCommandType(posDisplay); // try to switch to next attack type - if(activeCommandClass == ccAttack) { + if(activeCommandClass == ccAttack && activeCommandType!=NULL) { int maxI = unit->getType()->getCommandTypeCount(); int cmdTypeId = activeCommandType->getId(); @@ -651,7 +651,7 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) { } if(ct != NULL && unit->getFaction()->reqsOk(ct)) { - activeCommandType= display.getCommandType(posDisplay); + activeCommandType= ct; activeCommandClass= activeCommandType->getClass(); } else {