mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-19 02:00:41 +00:00
- Exhumed: The ObjectList was not properly garbage collected.
This commit is contained in:
parent
6a5d548019
commit
ac09f7584a
1 changed files with 6 additions and 5 deletions
|
@ -149,7 +149,7 @@ TArray<Bob> sBob;
|
||||||
TArray<Trail> sTrail;
|
TArray<Trail> sTrail;
|
||||||
TArray<TrailPoint> sTrailPoint;
|
TArray<TrailPoint> sTrailPoint;
|
||||||
TArray<Elev> Elevator;
|
TArray<Elev> Elevator;
|
||||||
TArray<DExhumedActor*> ObjectList;
|
TArray<TObjPtr<DExhumedActor*>> ObjectList;
|
||||||
TArray<MoveSect> sMoveSect;
|
TArray<MoveSect> sMoveSect;
|
||||||
TArray<slideData> SlideData;
|
TArray<slideData> SlideData;
|
||||||
TArray<wallFace> WallFace;
|
TArray<wallFace> WallFace;
|
||||||
|
@ -160,6 +160,7 @@ TObjPtr<DExhumedActor*> pFinaleSpr;
|
||||||
size_t MarkObjects()
|
size_t MarkObjects()
|
||||||
{
|
{
|
||||||
GC::Mark(pFinaleSpr);
|
GC::Mark(pFinaleSpr);
|
||||||
|
for (auto& d : ObjectList) GC::Mark(d);
|
||||||
for (auto& d : sDrip) GC::Mark(d.pActor);
|
for (auto& d : sDrip) GC::Mark(d.pActor);
|
||||||
for (auto& d : sTrap) GC::Mark(d.pActor);
|
for (auto& d : sTrap) GC::Mark(d.pActor);
|
||||||
for (auto& d : Elevator) GC::Mark(d.pActor);
|
for (auto& d : Elevator) GC::Mark(d.pActor);
|
||||||
|
@ -1882,7 +1883,7 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag)
|
||||||
pActor->spr.intowner = runlist_AddRunRec(pActor->spr.lotag - 1, pActor, 0x170000);
|
pActor->spr.intowner = runlist_AddRunRec(pActor->spr.lotag - 1, pActor, 0x170000);
|
||||||
|
|
||||||
// GrabTimeSlot(3);
|
// GrabTimeSlot(3);
|
||||||
pActor->nPhase = ObjectList.Push(pActor);
|
pActor->nPhase = ObjectList.Push(MakeObjPtr(pActor));
|
||||||
if (pActor->spr.statnum == kStatDestructibleSprite) {
|
if (pActor->spr.statnum == kStatDestructibleSprite) {
|
||||||
pActor->nHealth = 4;
|
pActor->nHealth = 4;
|
||||||
}
|
}
|
||||||
|
@ -2164,7 +2165,7 @@ void AIObject::RadialDamage(RunListEvent* ev)
|
||||||
pActor->nHealth = -1;
|
pActor->nHealth = -1;
|
||||||
int ax = pActor->nIndex2;
|
int ax = pActor->nIndex2;
|
||||||
|
|
||||||
if (ax < 0 || ObjectList[ax]->nHealth <= 0) {
|
if (ax < 0 || ObjectList[ax] == nullptr || ObjectList[ax]->nHealth <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2649,7 +2650,7 @@ void PostProcess()
|
||||||
{
|
{
|
||||||
auto pObjectActor = ObjectList[i];
|
auto pObjectActor = ObjectList[i];
|
||||||
|
|
||||||
if (pObjectActor->spr.statnum == kStatExplodeTarget)
|
if (pObjectActor && pObjectActor->spr.statnum == kStatExplodeTarget)
|
||||||
{
|
{
|
||||||
if (!pObjectActor->nIndex2) {
|
if (!pObjectActor->nIndex2) {
|
||||||
pObjectActor->nIndex2 = -1;
|
pObjectActor->nIndex2 = -1;
|
||||||
|
@ -2662,7 +2663,7 @@ void PostProcess()
|
||||||
for (unsigned j = 0; j < ObjectList.Size(); j++)
|
for (unsigned j = 0; j < ObjectList.Size(); j++)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (i != j && ObjectList[j]->spr.statnum == kStatExplodeTarget && edi == ObjectList[j]->nIndex2)
|
if (i != j && ObjectList[j] && ObjectList[j]->spr.statnum == kStatExplodeTarget && edi == ObjectList[j]->nIndex2)
|
||||||
{
|
{
|
||||||
pObjectActor->nIndex2 = j;
|
pObjectActor->nIndex2 = j;
|
||||||
ObjectList[j]->nIndex2 = i;
|
ObjectList[j]->nIndex2 = i;
|
||||||
|
|
Loading…
Reference in a new issue