This commit is contained in:
parent
7399360c8b
commit
bda517987b
2 changed files with 22 additions and 5 deletions
|
@ -95,6 +95,7 @@ sBBox CThingManager::m_ThinkBBox;
|
||||||
|
|
||||||
#ifdef USE_FREE_LIST
|
#ifdef USE_FREE_LIST
|
||||||
CThing **CThingManager::s_FreeList[CThing::MAX_TYPE];
|
CThing **CThingManager::s_FreeList[CThing::MAX_TYPE];
|
||||||
|
CThing *DuffList;
|
||||||
|
|
||||||
|
|
||||||
struct sFreeListTable
|
struct sFreeListTable
|
||||||
|
@ -759,6 +760,7 @@ void CThingManager::initFreeList()
|
||||||
s_FreeList[ThisType.Type]=List;
|
s_FreeList[ThisType.Type]=List;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
DuffList=0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -783,7 +785,13 @@ void CThingManager::resetFreeList()
|
||||||
}
|
}
|
||||||
List[t]=0;
|
List[t]=0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
CThing *Duff=DuffList;
|
||||||
|
while (Duff)
|
||||||
|
{
|
||||||
|
CThing *next=Duff->NextFreeThing;
|
||||||
|
delete Duff;
|
||||||
|
Duff=next;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -831,11 +839,20 @@ int SubType=Thing->getThingSubType();
|
||||||
CThing **List=s_FreeList[Type];
|
CThing **List=s_FreeList[Type];
|
||||||
|
|
||||||
// Check its been aquired/set correctly
|
// 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
|
#else
|
||||||
delete Thing;
|
delete Thing;
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue