This commit is contained in:
Daveo 2001-05-29 13:32:17 +00:00
parent 7399360c8b
commit bda517987b
2 changed files with 22 additions and 5 deletions

View File

@ -95,6 +95,7 @@ sBBox CThingManager::m_ThinkBBox;
#ifdef USE_FREE_LIST
CThing **CThingManager::s_FreeList[CThing::MAX_TYPE];
CThing *DuffList;
struct sFreeListTable
@ -759,6 +760,7 @@ void CThingManager::initFreeList()
s_FreeList[ThisType.Type]=List;
}
DuffList=0;
#endif
}
@ -783,7 +785,13 @@ void CThingManager::resetFreeList()
}
List[t]=0;
}
}
CThing *Duff=DuffList;
while (Duff)
{
CThing *next=Duff->NextFreeThing;
delete Duff;
Duff=next;
}
#endif
}
@ -831,11 +839,20 @@ int SubType=Thing->getThingSubType();
CThing **List=s_FreeList[Type];
// Check its been aquired/set correctly
// Temp workaround
// ASSERT(SubType!=1234);
if (SubType!=1234)
{
Thing->NextFreeThing=List[SubType];
List[SubType]=Thing;
}
else
{
// delete Thing;
Thing->NextFreeThing=DuffList;
DuffList=Thing;
ASSERT(SubType!=1234);
Thing->NextFreeThing=List[SubType];
List[SubType]=Thing;
}
#else
delete Thing;

Binary file not shown.