diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index a0ebeba9..8970e0c6 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -972,7 +972,7 @@ void Gui::computeDisplay(){ auto mct = u->getCurrMorphCt(); if(mct && isKeyDown(queueCommandKey)) {//Morph Queue ut=mct->getMorphUnit(); - } + }//TODO subscribe on queueCommandKey presed => resetState() and may remove stop cmd int morphPos= 8; for(int i= 0; i < ut->getCommandTypeCount(); ++i){ diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 6f6788f6..c32daa83 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -3829,13 +3829,14 @@ std::pair Unit::checkCommand(Command *command) const { (ignoreCheckCommand == false && this->getFaction()->reqsOk(command->getCommandType()) == false)) { if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d] isOperative() = %d, command->getUnit() = %p, getType()->hasCommandType(command->getCommandType()) = %d, this->getFaction()->reqsOk(command->getCommandType()) = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__, __LINE__,isOperative(),command->getUnit(),getType()->hasCommandType(command->getCommandType()),this->getFaction()->reqsOk(command->getCommandType())); + auto mct = getCurrMorphCt(); // Allow self healing if able to heal own unit type if( command->getUnit() == this && command->getCommandType()->getClass() == ccRepair && this->getType()->getFirstRepairCommand(this->getType()) != NULL) { } - else if(getCurrMorphCt()->getMorphUnit()->hasCommandType(command->getCommandType())) { + else if(mct && mct->getMorphUnit()->hasCommandType(command->getCommandType())) { // Allow Current Morph Commands } else {