- fixed: The morph actors stored their required classes as names, not as class pointers.

This prevented any kind of error check on them.
Unfortunately, due to backwards compatibility needs, on DECORATE the missing class may not be fatal so a workaround had to be added to clear those bogus pointers later if they are discovered to be broken.
For ZScript, though, this will result in a compile error, which was the intention behind this change.
This commit is contained in:
Christoph Oelckers 2016-11-23 22:34:17 +01:00
commit 7527141ad4
7 changed files with 64 additions and 40 deletions

View file

@ -620,17 +620,13 @@ IMPLEMENT_CLASS(AMorphProjectile, false, false, false, false)
int AMorphProjectile::DoSpecialDamage (AActor *target, int damage, FName damagetype)
{
PClassActor *morph_flash = PClass::FindActor(MorphFlash);
PClassActor *unmorph_flash = PClass::FindActor(UnMorphFlash);
if (target->player)
{
PClassPlayerPawn *player_class = dyn_cast<PClassPlayerPawn>(PClass::FindClass(PlayerClass));
P_MorphPlayer (NULL, target->player, player_class, Duration, MorphStyle, morph_flash, unmorph_flash);
P_MorphPlayer (NULL, target->player, PlayerClass, Duration, MorphStyle, MorphFlash, UnMorphFlash);
}
else
{
PClassActor *monster_class = PClass::FindActor(MonsterClass);
P_MorphMonster (target, monster_class, Duration, MorphStyle, morph_flash, unmorph_flash);
P_MorphMonster (target, MonsterClass, Duration, MorphStyle, MorphFlash, UnMorphFlash);
}
return -1;
}