mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-17 17:11:32 +00:00
- fixed: When a tentative class is being replaced, the old one should be removed entirely so that it cannot cause any problems later.
This commit is contained in:
parent
fbf8084999
commit
91c3ddf692
1 changed files with 6 additions and 2 deletions
|
@ -3330,11 +3330,15 @@ PClass *PClass::CreateDerivedClass(FName name, unsigned int size)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
TypeTable.ReplaceType(type, existclass, bucket);
|
||||||
StaticPointerSubstitution(existclass, type, true); // replace the old one, also in the actor defaults.
|
StaticPointerSubstitution(existclass, type, true); // replace the old one, also in the actor defaults.
|
||||||
// Delete the old class from the actor classes list, if it is in there.
|
// Delete the old class from the class lists, both the full one and the actor list.
|
||||||
auto index = PClassActor::AllActorClasses.Find(static_cast<PClassActor*>(existclass));
|
auto index = PClassActor::AllActorClasses.Find(static_cast<PClassActor*>(existclass));
|
||||||
if (index < PClassActor::AllActorClasses.Size()) PClassActor::AllActorClasses.Delete(index);
|
if (index < PClassActor::AllActorClasses.Size()) PClassActor::AllActorClasses.Delete(index);
|
||||||
TypeTable.ReplaceType(type, existclass, bucket);
|
index = PClass::AllClasses.Find(existclass);
|
||||||
|
if (index < PClass::AllClasses.Size()) PClass::AllClasses.Delete(index);
|
||||||
|
// Now we can destroy the old class as nothing should reference it anymore
|
||||||
|
existclass->Destroy();
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue