Anyone knows what this code does?
My game went into an infinite loop at
if ((iID == FFreeList::INVALID_INDEX) || (m_pArray == NULL))
{
return NULL;
}
and before that it it went through
and before that it was in int pathValid(FAStarNode* parent, FAStarNode* node, int data, const void* pointer, FAStar* finder)
I got this from the debugger:
0485A8D8 mov ecx,dword ptr [pToPlot]
0485A8DB call CvPlot::getY_INLINE (443035Ah)
0485A8E0 push eax
0485A8E1 mov ecx,dword ptr [pToPlot]
0485A8E4 call CvPlot::getX_INLINE (4432DA8h)
0485A8E9 push eax
0485A8EA mov ecx,dword ptr [pFromPlot]
0485A8ED call CvPlot::getY_INLINE (443035Ah)
0485A8F2 push eax
0485A8F3 mov ecx,dword ptr [pFromPlot]
0485A8F6 call CvPlot::getX_INLINE (4432DA8h)
But that means the to and from plot is the same, and I didnt get a failed assert on that
btw is it 146,63? Not sure I read the hex right.
As far as I can tell its a Marine trying to get on a transport, but why its stalled I have no idea.
Code:
template <class T>
T* FFreeListTrashArray<T>::getAt(int iID) const
{
int iIndex;
if ((iID == FFreeList::INVALID_INDEX) || (m_pArray == NULL))
{
return NULL;
}
iIndex = (iID & FLTA_INDEX_MASK);
assert(iIndex >= 0);
if ((iIndex <= m_iLastIndex) &&
(m_pArray[iIndex].pData != NULL))
{
if (((iID & FLTA_ID_MASK) == 0) || (m_pArray[iIndex].pData->getID() == iID))
{
return m_pArray[iIndex].pData;
}
}
return NULL;
}
My game went into an infinite loop at
if ((iID == FFreeList::INVALID_INDEX) || (m_pArray == NULL))
{
return NULL;
}
and before that it it went through
Code:
CvUnit* CvPlayer::getUnit(int iID) const
{
return (m_units.getAt(iID));
}
Code:
CvUnit* getUnit(IDInfo unit)
{
if ((unit.eOwner >= 0) && unit.eOwner < MAX_PLAYERS)
{
return (GET_PLAYER((PlayerTypes)unit.eOwner).getUnit(unit.iID));
}
return NULL;
}
Code:
bool CvSelectionGroup::canFight()
{
CLLNode<IDInfo>* pUnitNode;
CvUnit* pLoopUnit;
pUnitNode = headUnitNode();
while (pUnitNode != NULL)
{
pLoopUnit = ::getUnit(pUnitNode->m_data);
pUnitNode = nextUnitNode(pUnitNode);
if (pLoopUnit->canFight())
{
return true;
}
}
return false;
}
I got this from the debugger:
0485A8D8 mov ecx,dword ptr [pToPlot]
0485A8DB call CvPlot::getY_INLINE (443035Ah)
0485A8E0 push eax
0485A8E1 mov ecx,dword ptr [pToPlot]
0485A8E4 call CvPlot::getX_INLINE (4432DA8h)
0485A8E9 push eax
0485A8EA mov ecx,dword ptr [pFromPlot]
0485A8ED call CvPlot::getY_INLINE (443035Ah)
0485A8F2 push eax
0485A8F3 mov ecx,dword ptr [pFromPlot]
0485A8F6 call CvPlot::getX_INLINE (4432DA8h)
But that means the to and from plot is the same, and I didnt get a failed assert on that

btw is it 146,63? Not sure I read the hex right.
As far as I can tell its a Marine trying to get on a transport, but why its stalled I have no idea.