1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

Fixed issue that allowed to build multiple boats in town. Renamed state() to sth more sensible.

This commit is contained in:
Michał W. Urbańczyk
2013-07-21 10:08:32 +00:00
parent e45d174ba5
commit e9d51a2670
7 changed files with 11 additions and 10 deletions

View File

@ -6744,7 +6744,7 @@ int3 IBoatGenerator::bestLocation() const
return int3 (-1,-1,-1);
}
IBoatGenerator::EGeneratorState IBoatGenerator::state() const
IBoatGenerator::EGeneratorState IBoatGenerator::shipyardStatus() const
{
int3 tile = bestLocation();
const TerrainTile *t = IObjectInterface::cb->getTile(tile);
@ -6772,7 +6772,7 @@ IBoatGenerator::IBoatGenerator(const CGObjectInstance *O)
void IBoatGenerator::getProblemText(MetaString &out, const CGHeroInstance *visitor) const
{
switch(state())
switch(shipyardStatus())
{
case BOAT_ALREADY_BUILT:
out.addTxt(MetaString::GENERAL_TXT, 51);
@ -6848,7 +6848,7 @@ void CGShipyard::onHeroVisit( const CGHeroInstance * h ) const
if(!cb->gameState()->getPlayerRelations(tempOwner, h->tempOwner))
cb->setOwner(this, h->tempOwner);
auto s = state();
auto s = shipyardStatus();
if(s != IBoatGenerator::GOOD)
{
InfoWindow iw;