@any who can help:
Code:
void CvUnit::joinGroup(CvSelectionGroup* pSelectionGroup, bool bRemoveSelected, bool bRejoin)
{
PROFILE_FUNC();
CvSelectionGroup* pOldSelectionGroup;
CvSelectionGroup* pNewSelectionGroup;
CvPlot* pPlot;
pOldSelectionGroup = GET_PLAYER(getOwnerINLINE()).getSelectionGroup(getGroupID());
if ((pSelectionGroup != pOldSelectionGroup) || (pOldSelectionGroup == NULL))
{
pPlot = plot();
if (pSelectionGroup != NULL)
{
pNewSelectionGroup = pSelectionGroup;
}
else
{
if (bRejoin)
{
pNewSelectionGroup = GET_PLAYER(getOwnerINLINE()).addSelectionGroup();
FAssert(pNewSelectionGroup != NULL);
pNewSelectionGroup->init(pNewSelectionGroup->getID(), getOwnerINLINE());
This comes up in the process of initializing a unit. The last line is where it crashes. The only way this happens, if I'm not reading it wrong somehow, is if GET_PLAYER(getOwnerINLINE()).addSelectionGroup():
Code:
CvSelectionGroup* CvPlayer::addSelectionGroup()
{
return ((CvSelectionGroup *)(m_selectionGroups.add()));
}
is coming up with no further available spaces to add another group definition here.
This IS a very very large map size - not sure what size unless I go back and reload and check first but very very large. And the player is of course the Barbarian. So if there's a limit to hit they'd be the ones to hit it.
Now I can think of a few ways it could be addressed:
1) Split animals and barbs - This would destroy save compatibility but maybe it is indeed time to do this.
or
2) Reuse old groups that were initialized but are now destroyed. Much of the AI code runs through new group inits like sheets of toiletpaper and if they're never recycled this will be a problem in any and all games at some point. So we MUST figure out a way to do this and tbh, I'm not sure how to do this myself.
This is the first time I've seen anything suggesting a unit limit being reached... is this what Koshling was indicating? Because this isn't a unit limit itself but a group limit being reached and exceeded. There's a fairly big difference as a unit can take on many differing group definition clothings throughout its time in the game. That said, I'm sure units will eventually have similar issues.
Anyhow, suffice it to say, this game exhibits something other than a basic crash syntax error but rather, something much more. I'd be interested to know how to solve this.