Merge pull request #690 from ottools/master

Add 'GameKeepUnawareTiles' feature.
master
Sam 9 years ago
commit d9e8bfff4c

@ -132,6 +132,7 @@ GameUnjustifiedPoints = 68
GameSessionKey = 69
GameDeathType = 70
GameIdleAnimations = 71
GameKeepUnawareTiles = 72
TextColors = {
red = '#f55e5e', --'#c83200'

@ -404,6 +404,7 @@ namespace Otc
GameSessionKey = 69,
GameDeathType = 70,
GameIdleAnimations = 71,
GameKeepUnawareTiles=72,
LastGameFeature = 101
};

@ -504,6 +504,32 @@ void Map::removeUnawareThings()
else
++it;
}
if(!g_game.getFeature(Otc::GameKeepUnawareTiles)) {
// remove tiles that we are not aware anymore
for(int z = 0; z <= Otc::MAX_Z; ++z) {
std::unordered_map<uint, TileBlock>& tileBlocks = m_tileBlocks[z];
for(auto it = tileBlocks.begin(); it != tileBlocks.end();) {
TileBlock& block = (*it).second;
bool blockEmpty = true;
for(const TilePtr& tile : block.getTiles()) {
if(!tile)
continue;
const Position& pos = tile->getPosition();
if(!isAwareOfPosition(pos))
block.remove(pos);
else
blockEmpty = false;
}
if(blockEmpty)
it = tileBlocks.erase(it);
else
++it;
}
}
}
}
void Map::setCentralPosition(const Position& centralPosition)

Loading…
Cancel
Save