1
0

replacing dynamic_cast by c-style cast

This commit is contained in:
mgueydan 2013-09-09 18:45:39 +02:00
parent ead953898d
commit 59f4635309

View File

@ -449,20 +449,13 @@ void cChunk::CollectMobCensus(cMobCensus& toFill)
//LOGD("Counting entity #%i (%s)", (*itr)->GetUniqueID(), (*itr)->GetClass());
if ((*itr)->IsMob())
{
try
{
cMonster& Monster = dynamic_cast<cMonster&>(**itr);
cMonster& Monster = (cMonster&)(**itr);
currentPosition = Monster.GetPosition();
for (std::list<const Vector3d*>::const_iterator itr2 = playerPositions.begin(); itr2 != playerPositions.end(); itr2 ++)
{
toFill.CollectMob(Monster,*this,(currentPosition-**itr2).SqrLength());
}
}
catch (std::bad_cast& e)
{
LOGD("Something wrong happend I'm collecting an entity that respond 'true' to IsMob() but are not castable in cMonster - No Action");
}
}
} // for itr - m_Entitites[]
}