Properly Fix #301

This commit is contained in:
Joao Pasqualini Costa
2013-03-14 20:57:02 -03:00
parent a71e07f063
commit 6ef3508362
3 changed files with 17 additions and 8 deletions

View File

@@ -590,15 +590,24 @@ bool Tile::hasCreature()
return false;
}
bool Tile::limitsFloorsView()
bool Tile::limitsFloorsView(bool isFreeView)
{
// ground and walls limits the view
ThingPtr firstThing = getThing(0);
if(firstThing && !firstThing->isDontHide() && (firstThing->isGround() || firstThing->isOnBottom()))
return true;
if(isFreeView){
if(firstThing && !firstThing->isDontHide() && (firstThing->isGround() || firstThing->isOnBottom()))
return true;
}
else
{
if(firstThing && !firstThing->isDontHide() && (firstThing->isGround() || (firstThing->isOnBottom() && firstThing->blockProjectile())))
return true;
}
return false;
}
bool Tile::canErase()
{
return m_walkingCreatures.empty() && m_effects.empty() && m_things.empty() && m_flags == 0 && m_minimapColor == 0;