set meeting point for whole selection ( via icon )

This commit is contained in:
titiger 2021-10-06 23:40:18 +02:00
parent f344fa7fbd
commit ae5e308a28
1 changed files with 10 additions and 1 deletions

View File

@ -278,7 +278,16 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) {
Vec2i targetPos=game->getMouseCellPos();
if(prepared || (game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
commander->trySetMeetingPoint(selection.getFrontUnit(), targetPos);
for(int unitIndex = 0; unitIndex < selection.getCount(); ++unitIndex){
const Unit *unit = selection.getUnit(unitIndex);
if(unit == NULL) {
//ignore
}
else {
commander->trySetMeetingPoint(unit, targetPos);
}
}
}
}
resetState();