1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +02:00

Merge pull request #1718 from vcmi/fix_shipyard_border

Fix shipyard border calculation for RMG
This commit is contained in:
DjWarmonger 2023-03-19 16:05:24 +01:00 committed by GitHub
commit 15047a4469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
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())
return -1.f;