Explorar o código

Merge pull request #1718 from vcmi/fix_shipyard_border

Fix shipyard border calculation for RMG
DjWarmonger %!s(int64=2) %!d(string=hai) anos
pai
achega
15047a4469
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      lib/rmg/WaterProxy.cpp

+ 3 - 1
lib/rmg/WaterProxy.cpp

@@ -298,7 +298,9 @@ bool WaterProxy::placeShipyard(Zone & land, const Lake & lake, si32 guard, Route
 		//try to place shipyard close to boarding position and appropriate water access
 		//try to place shipyard close to boarding position and appropriate water access
 		auto path = manager->placeAndConnectObject(land.areaPossible(), rmgObject, [&rmgObject, &shipPositions, &boardingPosition](const int3 & tile)
 		auto path = manager->placeAndConnectObject(land.areaPossible(), rmgObject, [&rmgObject, &shipPositions, &boardingPosition](const int3 & tile)
 		{
 		{
-			rmg::Area shipyardOut(rmgObject.getArea().getBorderOutside());
+			//Must only check the border of shipyard and not the added guard
+			rmg::Area shipyardOut = rmgObject.instances().front()->getBlockedArea().getBorderOutside();
+
 			if(!shipyardOut.contains(boardingPosition) || (shipyardOut * shipPositions).empty())
 			if(!shipyardOut.contains(boardingPosition) || (shipyardOut * shipPositions).empty())
 				return -1.f;
 				return -1.f;