diff --git a/lib/mapObjects/CGHeroInstance.cpp b/lib/mapObjects/CGHeroInstance.cpp index 0404140fc..4ab847bf5 100644 --- a/lib/mapObjects/CGHeroInstance.cpp +++ b/lib/mapObjects/CGHeroInstance.cpp @@ -451,7 +451,7 @@ void CGHeroInstance::onHeroVisit(const CGHeroInstance * h) const { smp.val = maxMovePoints(false); //Create a new boat for hero - cb->createObject(boatPos, Obj::BOAT, BoatId(EBoatId::CASTLE)); + cb->createObject(boatPos, Obj::BOAT, getBoatType().getNum()); boatId = cb->getTopObj(boatPos)->id; } else diff --git a/lib/mapObjects/MiscObjects.cpp b/lib/mapObjects/MiscObjects.cpp index f3011582a..0ea519a87 100644 --- a/lib/mapObjects/MiscObjects.cpp +++ b/lib/mapObjects/MiscObjects.cpp @@ -1377,11 +1377,10 @@ const IObjectInterface * CGShipyard::getObject() const void CGShipyard::onHeroVisit( const CGHeroInstance * h ) const { - if(!cb->gameState()->getPlayerRelations(tempOwner, h->tempOwner)) + if(cb->gameState()->getPlayerRelations(tempOwner, h->tempOwner) == PlayerRelations::ENEMIES) cb->setOwner(this, h->tempOwner); - auto s = shipyardStatus(); - if(s != IBoatGenerator::GOOD) + if(shipyardStatus() != IBoatGenerator::GOOD) { InfoWindow iw; iw.type = EInfoWindowMode::AUTO; diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index bd003c20f..f8a5a4af5 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -4429,7 +4429,7 @@ bool CGameHandler::hireHero(const CGObjectInstance *obj, ui8 hid, PlayerColor pl if (getTile(hr.tile)->isWater()) { //Create a new boat for hero - createObject(obj->visitablePos(), Obj::BOAT, BoatId(EBoatId::CASTLE)); + createObject(obj->visitablePos(), Obj::BOAT, nh->getBoatType().getNum()); hr.boatId = getTopObj(hr.tile)->id; }