- block off the Substitute function by making it private to the 3 classes that really need it.

This commit is contained in:
Christoph Oelckers 2020-04-19 21:06:51 +02:00
parent bd3f4e7347
commit 4fb6b7c7d4
3 changed files with 21 additions and 1 deletions

View File

@ -1614,6 +1614,22 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, Substitute, StaticPointerSubstitution)
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(_PlayerPawn, Substitute, StaticPointerSubstitution)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT(replace, AActor);
StaticPointerSubstitution(self, replace);
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(_MorphedMonster, Substitute, StaticPointerSubstitution)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT(replace, AActor);
StaticPointerSubstitution(self, replace);
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetSpawnableType, P_GetSpawnableType)
{
PARAM_PROLOGUE;

View File

@ -459,7 +459,7 @@ class Actor : Thinker native
virtual native void Die(Actor source, Actor inflictor, int dmgflags = 0, Name MeansOfDeath = 'none');
virtual native bool Slam(Actor victim);
virtual native void Touch(Actor toucher);
native void Substitute(Actor replacement);
private native void Substitute(Actor replacement);
native ui void DisplayNameTag();
// Called by inventory items to see if this actor is capable of touching them.

View File

@ -1,5 +1,7 @@
extend class PlayerPawn
{
private native void Substitute(PlayerPawn replacement);
//===========================================================================
//
// EndAllPowerupEffects
@ -503,6 +505,8 @@ class MorphedMonster : Actor
+FLOORCLIP
}
private native void Substitute(Actor replacement);
override void OnDestroy ()
{
if (UnmorphedMe != NULL)