Skip to content

Commit

Permalink
fix: auto command for morph queue
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanvo committed Sep 5, 2022
1 parent 60d8bf7 commit 8bc5abb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/glest_game/game/commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,15 @@ std::pair<CommandResult,string> Commander::tryGiveCommand(const Selection *selec
currPos= world->getMap()->computeDestPos(refPos, unit->getPosNotThreadSafe(), pos);

//get command type
const CommandType *commandType= unit->computeCommandType(pos, targetUnit);
auto mct= unit->getCurrMorphCt();
auto unitType= mct? mct->getMorphUnit(): NULL;
const CommandType *commandType= unit->computeCommandType(pos, targetUnit, unitType);

//give commands
if(commandType != NULL) {
int targetId= targetUnit==NULL? Unit::invalidId: targetUnit->getId();
int unitId= unit->getId();
int unitTypeId= -1;
auto mct= unit->getCurrMorphCt();
if(mct) unitTypeId= mct->getMorphUnit()->getId();
int unitTypeId= unitType? unitType->getId(): -1;

std::pair<CommandResult,string> resultCur(crFailUndefined,"");

Expand Down

0 comments on commit 8bc5abb

Please sign in to comment.