1
0

Fixed mobs too close to player not ticking

A condition would never be fulfilled. A number squared was compared to
-1, but there is nothing that, multiplied by itself, gives -1.
This commit is contained in:
Tiger Wang 2014-01-24 19:54:13 +00:00
parent 3e675f8c38
commit 161a1c7274

View File

@ -59,7 +59,7 @@ cMobProximityCounter::sIterablePair cMobProximityCounter::getMobWithinThosesDist
{
if (toReturn.m_Begin == m_DistanceToMonster.end())
{
if (a_DistanceMin == -1 || itr->first > a_DistanceMin)
if ((a_DistanceMin == 1) || (itr->first > a_DistanceMin))
{
toReturn.m_Begin = itr; // this is the first one with distance > a_DistanceMin;
}
@ -67,7 +67,7 @@ cMobProximityCounter::sIterablePair cMobProximityCounter::getMobWithinThosesDist
if (toReturn.m_Begin != m_DistanceToMonster.end())
{
if (a_DistanceMax != -1 && itr->first > a_DistanceMax)
if ((a_DistanceMax != 1) && (itr->first > a_DistanceMax))
{
toReturn.m_End = itr; // this is just after the last one with distance < a_DistanceMax
// Note : if we are not going through this, it's ok, toReturn.m_End will be end();