fix: checkCommand + TODO

This commit is contained in:
pavanvo 2022-08-27 15:56:40 +04:00
parent 0b1dcc70f5
commit 37b6fbb12e
No known key found for this signature in database
GPG Key ID: 34C1C36681B4AD84
2 changed files with 3 additions and 2 deletions

View File

@ -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){

View File

@ -3829,13 +3829,14 @@ std::pair<CommandResult,string> 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 {