New lightweight minimap format, finish #15

This commit is contained in:
Eduardo Bart
2013-01-27 14:06:47 -02:00
parent cf0ecf418d
commit e81dd31ae3
14 changed files with 261 additions and 124 deletions

View File

@@ -476,7 +476,7 @@ ThingPtr Tile::getTopMultiUseThing()
return m_things[0];
}
bool Tile::isWalkable()
bool Tile::isWalkable(bool ignoreCreatures)
{
if(!getGround())
return false;
@@ -485,24 +485,17 @@ bool Tile::isWalkable()
if(thing->isNotWalkable())
return false;
if(thing->isCreature()) {
CreaturePtr creature = thing->static_self_cast<Creature>();
if(!creature->isPassable() && creature->canBeSeen())
return false;
if(!ignoreCreatures) {
if(thing->isCreature()) {
CreaturePtr creature = thing->static_self_cast<Creature>();
if(!creature->isPassable() && creature->canBeSeen())
return false;
}
}
}
return true;
}
bool Tile::changesFloor()
{
for(const ThingPtr& thing : m_things) {
if(thing->isTranslucent() || (thing->isOnBottom() && thing->hasElevation()))
return true;
}
return false;
}
bool Tile::isPathable()
{
for(const ThingPtr& thing : m_things) {