C++ - Lua player syncing refactoring

This commit is contained in:
devZoGok
2023-12-09 12:27:31 +02:00
parent 90ebaf467f
commit a3e40d7810
6 changed files with 35 additions and 15 deletions
+9 -3
View File
@@ -334,9 +334,15 @@ namespace battleship{
if(selectingPatrolPoints){
castRayToTerrain();
if(!shiftPressed){
issueOrder(Order::TYPE::PATROL, targets, shiftPressed);
selectingPatrolPoints = false;
if(!(targets.empty() || selectingPatrolPoints)){
Order::TYPE type = Order::TYPE::MOVE;
if(controlPressed || (targets[0].unit && targets[0].unit->getPlayer()->getTeam() != mainPlayer->getTeam()))
type = Order::TYPE::ATTACK;
else if(ufCtr->isPlacingFrames() && !selectingDestOrient)
type = Order::TYPE::BUILD;
issueOrder(type, shiftPressed);
}
}
else{