- removed an assert from APowerMorph::EndEffect. With some recent changes to DestroyAllInventory it appears that the asserted condition no longer is true at this point when ending a game.
- fixed: When replacing a tentative class, the pointers in the morph objects were not replaced. Instead of adding more ReplaceClassRef methods I chose to integrate this part into the PointerSubstitution mechanism and delete ReplaceClassRef entirely. The code had some oversights anyway that would have caused problems, now that non-actors can be created.
This commit is contained in:
parent
0233c21e33
commit
87484950cf
20 changed files with 72 additions and 132 deletions
|
|
@ -423,7 +423,7 @@ size_t DObject::PointerSubstitution (DObject *old, DObject *notOld)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
size_t DObject::StaticPointerSubstitution (DObject *old, DObject *notOld)
|
||||
size_t DObject::StaticPointerSubstitution (DObject *old, DObject *notOld, bool scandefaults)
|
||||
{
|
||||
DObject *probe;
|
||||
size_t changed = 0;
|
||||
|
|
@ -438,6 +438,20 @@ size_t DObject::StaticPointerSubstitution (DObject *old, DObject *notOld)
|
|||
last = probe;
|
||||
}
|
||||
|
||||
if (scandefaults)
|
||||
{
|
||||
for (auto p : PClassActor::AllActorClasses)
|
||||
{
|
||||
auto def = GetDefaultByType(p);
|
||||
if (def != nullptr)
|
||||
{
|
||||
def->Class = p;
|
||||
def->DObject::PointerSubstitution(old, notOld);
|
||||
def->Class = nullptr; // reset pointer. Defaults should not have a valid class pointer.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Go through the bodyque.
|
||||
for (i = 0; i < BODYQUESIZE; ++i)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue