1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Use own resources when buying boat in allied shipyard

This commit is contained in:
Ivan Savenko
2023-03-31 20:02:09 +03:00
parent 839172cd30
commit 820c9be61b
3 changed files with 3 additions and 4 deletions

View File

@ -5698,7 +5698,7 @@ void CGameHandler::objectVisitEnded(const CObjectVisitQuery & query)
ObjectVisitEnded::defaultExecute(serverEventBus.get(), endVisit, query.players.front(), query.visitingHero->id);
}
bool CGameHandler::buildBoat(ObjectInstanceID objid)
bool CGameHandler::buildBoat(ObjectInstanceID objid, PlayerColor playerID)
{
const IShipyard *obj = IShipyard::castFrom(getObj(objid));
@ -5714,7 +5714,6 @@ bool CGameHandler::buildBoat(ObjectInstanceID objid)
return false;
}
const PlayerColor playerID = obj->o->tempOwner;
TResources boatCost;
obj->getBoatCost(boatCost);
TResources aviable = getPlayerState(playerID)->resources;