1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

#2018 - fix shipyard usage for NKAI, allied shipyard should work now

This commit is contained in:
Andrii Danylchenko
2023-04-22 18:37:27 +03:00
committed by Andrii Danylchenko
parent d347db4c16
commit fbc9a32ad8
5 changed files with 12 additions and 13 deletions

View File

@@ -53,15 +53,13 @@ namespace AIPathfinding
for(const CGTownInstance * t : cb->getTownsInfo())
{
// do not allow ally shipyards because of bug
if(t->hasBuilt(BuildingID::SHIPYARD) && t->getOwner() == ai->playerID)
if(t->hasBuilt(BuildingID::SHIPYARD))
shipyards.push_back(t);
}
for(const CGObjectInstance * obj : ai->memory->visitableObjs)
{
// do not allow ally shipyards because of bug
if(obj->ID != Obj::TOWN && obj->getOwner() == ai->playerID) //towns were handled in the previous loop
if(obj->ID != Obj::TOWN) //towns were handled in the previous loop
{
if(const IShipyard * shipyard = IShipyard::castFrom(obj))
shipyards.push_back(shipyard);