From 45691e91c9b554f595504d386ea2117aa7f208d4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 11 Apr 2017 14:03:49 +0200 Subject: [PATCH] - removed PClassActor::PointerSubstitution. This is not needed anymore because classes do not need to be replaced. The only reason this was implemented was the original design with the class descriptors taking on all the metadata themselves. --- src/info.cpp | 43 ------------------------------------------- src/info.h | 1 - 2 files changed, 44 deletions(-) diff --git a/src/info.cpp b/src/info.cpp index e895253b5..5e9653336 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -589,49 +589,6 @@ void PClassActor::SetPainChance(FName type, int chance) } } -//========================================================================== -// -// PClassActor :: ReplaceClassRef -// -//========================================================================== - -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(newclass); - changed++; - } - } - - for (unsigned i = 0; i < ForbiddenToPlayerClass.Size(); i++) - { - if (ForbiddenToPlayerClass[i] == oldclass) - { - ForbiddenToPlayerClass[i] = static_cast(newclass); - changed++; - } - } - for (unsigned i = 0; i < RestrictedToPlayerClass.Size(); i++) - { - if (RestrictedToPlayerClass[i] == oldclass) - { - RestrictedToPlayerClass[i] = static_cast(newclass); - changed++; - } - } - AInventory *def = dyn_cast((AActor*)Defaults); - if (def != NULL) - { - if (def->PickupFlash == oldclass) def->PickupFlash = static_cast(newclass); - } - - return changed; -} - //========================================================================== // // DmgFactors :: CheckFactor diff --git a/src/info.h b/src/info.h index 697bd836f..248d1cd35 100644 --- a/src/info.h +++ b/src/info.h @@ -248,7 +248,6 @@ public: PClassActor(); ~PClassActor(); - virtual size_t PointerSubstitution(DObject *oldclass, DObject *newclass); void BuildDefaults(); void ApplyDefaults(uint8_t *defaults); void RegisterIDs();