- fixed: It is not guaranteed that the class object that is created by FindClassTentative actually matches the real object that is required later, so it needs to be replaced wherever it could be referenced once the real object is created.
- removed some unneeded code from earlier attempts to fix the class type resolving issue.
This commit is contained in:
parent
ff70cf1ee7
commit
b484cbf18a
13 changed files with 119 additions and 24 deletions
|
|
@ -54,6 +54,19 @@ void PClassWeapon::Derive(PClass *newclass)
|
|||
newc->SlotPriority = SlotPriority;
|
||||
}
|
||||
|
||||
|
||||
void PClassWeapon::ReplaceClassRef(PClass *oldclass, PClass *newclass)
|
||||
{
|
||||
Super::ReplaceClassRef(oldclass, newclass);
|
||||
AWeapon *def = (AWeapon*)Defaults;
|
||||
if (def != NULL)
|
||||
{
|
||||
if (def->AmmoType1 == oldclass) def->AmmoType1 = static_cast<PClassAmmo *>(newclass);
|
||||
if (def->AmmoType2 == oldclass) def->AmmoType2 = static_cast<PClassAmmo *>(newclass);
|
||||
if (def->SisterWeaponType == oldclass) def->SisterWeaponType = static_cast<PClassWeapon *>(newclass);
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AWeapon :: Serialize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue