fix out of range error in CUnit::unsetTargetUnit(), attempt to fix QueueEntries' inProgress not being set back to 0 when the drone dies
This commit is contained in:
parent
e5c2079866
commit
34194b88c7
|
@ -58,6 +58,8 @@ void CUnit::mine(std::string action, int baseIndex)
|
|||
|
||||
void CUnit::unsetTargetUnit()
|
||||
{
|
||||
int queueIndex = Util::getQueueIndex(this->targetUnit);
|
||||
if(queueIndex > -1)
|
||||
Macro::queue.at(queueIndex).inProgress = 0;
|
||||
this->targetUnit = UnitTypes::None;
|
||||
Macro::queue.at(Util::getQueueIndex(this->targetUnit)).inProgress = 0;
|
||||
}
|
|
@ -178,6 +178,11 @@ void Macro::freeUnit(int index)
|
|||
if (base > -1)
|
||||
players.at(selfID).bases.at(base).subtractWorker(players.at(selfID).units.at(index).action);
|
||||
}
|
||||
if (players.at(selfID).units.at(index).action == "expand")
|
||||
{
|
||||
stopProduction = 0;
|
||||
}
|
||||
|
||||
players.at(selfID).units.at(index).action = "";
|
||||
players.at(selfID).units.at(index).miningBase = -1;
|
||||
players.at(selfID).units.at(index).target = TilePosition(-1, -1);
|
||||
|
|
|
@ -200,6 +200,7 @@ int Util::getQueueIndex(UnitType ut)
|
|||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue