1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Minor formatting

This commit is contained in:
Ivan Savenko 2023-06-20 23:19:54 +03:00
parent 1fb2b60999
commit ce3e150d59
3 changed files with 4 additions and 5 deletions

View File

@ -451,7 +451,7 @@ void CGHeroInstance::onHeroVisit(const CGHeroInstance * h) const
{ {
smp.val = maxMovePoints(false); smp.val = maxMovePoints(false);
//Create a new boat for hero //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; boatId = cb->getTopObj(boatPos)->id;
} }
else else

View File

@ -1377,11 +1377,10 @@ const IObjectInterface * CGShipyard::getObject() const
void CGShipyard::onHeroVisit( const CGHeroInstance * h ) 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); cb->setOwner(this, h->tempOwner);
auto s = shipyardStatus(); if(shipyardStatus() != IBoatGenerator::GOOD)
if(s != IBoatGenerator::GOOD)
{ {
InfoWindow iw; InfoWindow iw;
iw.type = EInfoWindowMode::AUTO; iw.type = EInfoWindowMode::AUTO;

View File

@ -4429,7 +4429,7 @@ bool CGameHandler::hireHero(const CGObjectInstance *obj, ui8 hid, PlayerColor pl
if (getTile(hr.tile)->isWater()) if (getTile(hr.tile)->isWater())
{ {
//Create a new boat for hero //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; hr.boatId = getTopObj(hr.tile)->id;
} }