The IDMap:

Code:

IDMap::IDMap(Landscape * L)
{
maxx=L->SupplySimAreaWidth()/10;
maxy=L->SupplySimAreaHeight()/10;
m_TheMap = new TAnimal*[ (maxx)*(maxy) ];
for (int y=0; y<(maxx); y++)
{
for (int x=0; x<(maxy); x++)
{
SetMapValue((x/10),(y/10),NULL);
}
}
}

Part of the class Cat:

Code:

...
if(m_objType == cob_Male || m_objType == cob_NeuMale)
{
HRList[0] = m_OurPopulationManager->MaleHomeRangeMap->GetMapValue(m_Location_x / 10, evaluate_y_Down);
HRList[1] = m_OurPopulationManager->MaleHomeRangeMap->GetMapValue(evaluate_x_Up, evaluate_y_Down);
HRList[2] = m_OurPopulationManager->MaleHomeRangeMap->GetMapValue(evaluate_x_Up, m_Location_y / 10);
HRList[3] = m_OurPopulationManager->MaleHomeRangeMap->GetMapValue(evaluate_x_Up, evaluate_y_Up);
HRList[4] = m_OurPopulationManager->MaleHomeRangeMap->GetMapValue(m_Location_x / 10, evaluate_y_Up);
HRList[5] = m_OurPopulationManager->MaleHomeRangeMap->GetMapValue(evaluate_x_Down, evaluate_y_Up);
HRList[6] = m_OurPopulationManager->MaleHomeRangeMap->GetMapValue(evaluate_x_Down, m_Location_y / 10);
HRList[7] = m_OurPopulationManager->MaleHomeRangeMap->GetMapValue(evaluate_x_Up, evaluate_y_Down);
for(int j = 0; j < 8; j++)
{
if(HRList[j] != NULL && HRList[j] != this)
{
//QualityScoreArray[j] -= 2;
}
}
}
else
{
HRList[0] = m_OurPopulationManager->FemaleHomeRangeMap->GetMapValue(m_Location_x / 10, evaluate_y_Down);
HRList[1] = m_OurPopulationManager->FemaleHomeRangeMap->GetMapValue(evaluate_x_Up, evaluate_y_Down);
HRList[2] = m_OurPopulationManager->FemaleHomeRangeMap->GetMapValue(evaluate_x_Up, m_Location_y / 10);
HRList[3] = m_OurPopulationManager->FemaleHomeRangeMap->GetMapValue(evaluate_x_Up, evaluate_y_Up);
HRList[4] = m_OurPopulationManager->FemaleHomeRangeMap->GetMapValue(m_Location_x / 10, evaluate_y_Up);
HRList[5] = m_OurPopulationManager->FemaleHomeRangeMap->GetMapValue(evaluate_x_Down, evaluate_y_Up);
HRList[6] = m_OurPopulationManager->FemaleHomeRangeMap->GetMapValue(evaluate_x_Down, m_Location_y / 10);
HRList[7] = m_OurPopulationManager->FemaleHomeRangeMap->GetMapValue(evaluate_x_Up, evaluate_y_Down);
for(int j = 0; j < 8; j++)
{
if(HRList[j] != NULL && HRList[j] != this)
{
//QualityScoreArray[j] -= 2;
}
}
}
...

So the problem is that it goes in the if(HRList[j] != NULL && HRList[j] != this) and subtracts 2. Because HRList[j] is not NULL but this CDCDCDCD