- replaced some dyn_casts with calls to FindActor.

- fixed type checks in A_Morph.
This commit is contained in:
Christoph Oelckers 2017-04-12 01:29:51 +02:00
commit 0e0eca0e0f
2 changed files with 6 additions and 6 deletions

View file

@ -714,14 +714,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_Morph)
bool res = false;
if (self->player)
{
if (type->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
if (type->IsDescendantOf(RUNTIME_CLASS(APlayerPawn)))
{
res = P_MorphPlayer(self->player, self->player, type, duration, flags, enter_flash, exit_flash);
}
}
else
{
if (type->IsKindOf(RUNTIME_CLASS(AMorphedMonster)))
if (type->IsDescendantOf(RUNTIME_CLASS(AMorphedMonster)))
{
res = P_MorphMonster(self, type, duration, flags, enter_flash, exit_flash);
}