- 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
13
src/info.cpp
13
src/info.cpp
|
|
@ -619,19 +619,18 @@ void PClassActor::SetPainChance(FName type, int chance)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void PClassActor::ReplaceClassRef(PClass *oldclass, PClass *newclass)
|
||||
size_t PClassActor::PointerSubstitution(DObject *oldclass, DObject *newclass)
|
||||
{
|
||||
auto changed = Super::PointerSubstitution(oldclass, newclass);
|
||||
for (unsigned i = 0; i < VisibleToPlayerClass.Size(); i++)
|
||||
{
|
||||
if (VisibleToPlayerClass[i] == oldclass)
|
||||
{
|
||||
VisibleToPlayerClass[i] = static_cast<PClassPlayerPawn*>(newclass);
|
||||
changed++;
|
||||
}
|
||||
}
|
||||
AActor *def = (AActor*)Defaults;
|
||||
if (def != NULL)
|
||||
{
|
||||
if (def->TeleFogSourceType == oldclass) def->TeleFogSourceType = static_cast<PClassActor *>(newclass);
|
||||
if (def->TeleFogDestType == oldclass) def->TeleFogDestType = static_cast<PClassActor *>(newclass);
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue