Virtualized returns for SpecialMissileHit/SpecialBounceHit

This commit is contained in:
jekyllgrim 2023-12-15 14:53:25 +03:00 committed by Christoph Oelckers
parent aec7feb48a
commit fc809cfab6
3 changed files with 12 additions and 6 deletions

View file

@ -89,6 +89,12 @@ class Actor : Thinker native
const DEFMORPHTICS = 40 * TICRATE;
const MELEEDELTA = 20;
enum EMissileHitResult
{
MHIT_DEFAULT = -1,
MHIT_DESTROY = 0,
MHIT_PASS = 1,
}
// flags are not defined here, the native fields for those get synthesized from the internal tables.
@ -540,13 +546,13 @@ class Actor : Thinker native
// This is called before a missile gets exploded.
virtual int SpecialMissileHit (Actor victim)
{
return -1;
return MHIT_DEFAULT;
}
// This is called when a missile bounces off something.
virtual int SpecialBounceHit(Actor bounceMobj, Line bounceLine, SecPlane bouncePlane)
{
return -1;
return MHIT_DEFAULT;
}
// Called when the player presses 'use' and an actor is found, except if the

View file

@ -147,7 +147,7 @@ class Lightning : Actor
tracer = thing;
}
}
return 1; // lightning zaps through all sprites
return MHIT_PASS; // lightning zaps through all sprites
}
}
@ -417,7 +417,7 @@ class LightningZap : Actor
}
}
}
return -1;
return MHIT_DEFAULT;
}
//============================================================================

View file

@ -260,9 +260,9 @@ class MageStaffFX2 : Actor
if (victim != target && !victim.player && !victim.bBoss)
{
victim.DamageMobj (self, target, 10, 'Fire');
return 1; // Keep going
return MHIT_PASS; // Keep going
}
return -1;
return MHIT_DEFAULT;
}
override bool SpecialBlastHandling (Actor source, double strength)