- bugfixes for multi-build. Now the other units are checked that they can not only build but repair too. Also those who repair now try to approach from the best angle as well as the builder.
This commit is contained in:
parent
f07cbb13ad
commit
d6d1fe2add
|
@ -90,6 +90,7 @@ CommandResult Commander::tryGiveCommand(const Selection *selection, const Comman
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(useCommandtype != NULL) {
|
||||||
NetworkCommand networkCommand(this->world,nctGiveCommand, unitId,
|
NetworkCommand networkCommand(this->world,nctGiveCommand, unitId,
|
||||||
useCommandtype->getId(), usePos, unitType->getId(),
|
useCommandtype->getId(), usePos, unitType->getId(),
|
||||||
(targetUnit != NULL ? targetUnit->getId() : -1),
|
(targetUnit != NULL ? targetUnit->getId() : -1),
|
||||||
|
@ -99,6 +100,7 @@ CommandResult Commander::tryGiveCommand(const Selection *selection, const Comman
|
||||||
CommandResult result= pushNetworkCommand(&networkCommand);
|
CommandResult result= pushNetworkCommand(&networkCommand);
|
||||||
results.push_back(result);
|
results.push_back(result);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return computeResult(results);
|
return computeResult(results);
|
||||||
}
|
}
|
||||||
|
|
|
@ -816,13 +816,13 @@ void UnitUpdater::updateRepair(Unit *unit) {
|
||||||
Unit *peerUnitBuilder = NULL;
|
Unit *peerUnitBuilder = NULL;
|
||||||
if(repaired == NULL) {
|
if(repaired == NULL) {
|
||||||
peerUnitBuilder = findPeerUnitBuilder(unit);
|
peerUnitBuilder = findPeerUnitBuilder(unit);
|
||||||
|
|
||||||
if(peerUnitBuilder != NULL) {
|
if(peerUnitBuilder != NULL) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] peerUnitBuilder = %p\n",__FILE__,__FUNCTION__,__LINE__,peerUnitBuilder);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] peerUnitBuilder = %p\n",__FILE__,__FUNCTION__,__LINE__,peerUnitBuilder);
|
||||||
|
|
||||||
// command->getPos()-Vec2i(1)
|
Vec2i buildPos = map->findBestBuildApproach(unit->getPos(), command->getPos(), peerUnitBuilder->getCurrCommand()->getUnitType());
|
||||||
//nextToRepaired= map->isNextTo(unit->getPos(), command->getPos()-Vec2i(1));
|
|
||||||
nextToRepaired= (unit->getPos() == (command->getPos()-Vec2i(1)));
|
//nextToRepaired= (unit->getPos() == (command->getPos()-Vec2i(1)));
|
||||||
|
nextToRepaired = (unit->getPos() == buildPos);
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] peerUnitBuilder = %p, nextToRepaired = %d\n",__FILE__,__FUNCTION__,__LINE__,peerUnitBuilder,nextToRepaired);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] peerUnitBuilder = %p, nextToRepaired = %d\n",__FILE__,__FUNCTION__,__LINE__,peerUnitBuilder,nextToRepaired);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue