mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
allowing units move out of blocked source cells
This commit is contained in:
+3
-1
@@ -73,15 +73,17 @@ namespace battleship{
|
|||||||
bool ship = (unitType == UnitType::UNDERWATER || unitType == UnitType::SEA_LEVEL);
|
bool ship = (unitType == UnitType::UNDERWATER || unitType == UnitType::SEA_LEVEL);
|
||||||
Unit *blockingUnit = cells[vertStrich].blockedBy;
|
Unit *blockingUnit = cells[vertStrich].blockedBy;
|
||||||
bool diffBlockingUnit = (blockingUnit && blockingUnit != vehicle);
|
bool diffBlockingUnit = (blockingUnit && blockingUnit != vehicle);
|
||||||
|
bool throughBlockedCell = (source != vertStrich);
|
||||||
|
|
||||||
if(
|
if(
|
||||||
(unitType == UnitType::LAND && (diffBlockingUnit || cells[vertStrich].type != Map::Cell::LAND)) ||
|
(unitType == UnitType::LAND && ((diffBlockingUnit && throughBlockedCell) || cells[vertStrich].type != Map::Cell::LAND)) ||
|
||||||
(
|
(
|
||||||
ship &&
|
ship &&
|
||||||
(
|
(
|
||||||
cells[vertStrich].type != Map::Cell::WATER ||
|
cells[vertStrich].type != Map::Cell::WATER ||
|
||||||
(
|
(
|
||||||
diffBlockingUnit &&
|
diffBlockingUnit &&
|
||||||
|
throughBlockedCell &&
|
||||||
blockingUnit->getUnitClass() == UnitClass::ICE_SHEET &&
|
blockingUnit->getUnitClass() == UnitClass::ICE_SHEET &&
|
||||||
vehicle->getUnitClass() != UnitClass::ICEBREAKER
|
vehicle->getUnitClass() != UnitClass::ICEBREAKER
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user