MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / notifyBuildingRemovedFromGameMap

Method notifyBuildingRemovedFromGameMap

source/game/Seat.cpp:1734–1755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1732}
1733
1734void Seat::notifyBuildingRemovedFromGameMap(Building* building, Tile* tile)
1735{
1736 if(getPlayer() == nullptr)
1737 return;
1738 if(!getPlayer()->getIsHuman())
1739 return;
1740
1741 if(tile->getX() >= static_cast<int>(mTilesStates.size()))
1742 {
1743 OD_LOG_ERR("Tile=" + Tile::displayAsString(tile));
1744 return;
1745 }
1746 if(tile->getY() >= static_cast<int>(mTilesStates[tile->getX()].size()))
1747 {
1748 OD_LOG_ERR("Tile=" + Tile::displayAsString(tile));
1749 return;
1750 }
1751
1752 TileStateNotified& tileState = mTilesStates[tile->getX()][tile->getY()];
1753 if(tileState.mBuilding == building)
1754 tileState.mBuilding = nullptr;
1755}
1756
1757void Seat::tileMarkedDiggingNotifiedToPlayer(Tile* tile, bool isDigSet)
1758{

Callers 2

removeFromGameMapMethod · 0.80
removeFromGameMapMethod · 0.80

Calls 3

getIsHumanMethod · 0.80
getXMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected