- avoid multiple Dehacked mappings to the same function.

Due to some MBF21 related changes these would cause interference.
Instead the two affected functions, A_NailBomb and A_RadiusDamage are now separate script functions that just call A_Explode with the correct parameters.
This commit is contained in:
Christoph Oelckers 2021-10-03 18:16:37 +02:00
parent 6e9e75c02c
commit 3c961a2aa2
4 changed files with 14 additions and 21 deletions

View file

@ -764,22 +764,6 @@ static void CreateLineEffectFunc(FunctionCallEmitter &emitters, int value1, int
emitters.AddParameterIntConst(value2); // tag
}
// No misc, but it's basically A_Explode with an added effect
static void CreateNailBombFunc(FunctionCallEmitter &emitters, int value1, int value2, MBFParamState* state)
{ // A_Explode
// This one does not actually have MBF-style parameters. But since
// we're aliasing it to an extension of A_Explode...
emitters.AddParameterIntConst(-1); // damage
emitters.AddParameterIntConst(-1); // distance
emitters.AddParameterIntConst(1); // flags (1=XF_HURTSOURCE)
emitters.AddParameterIntConst(0); // alert
emitters.AddParameterIntConst(0); // fulldamagedistance
emitters.AddParameterIntConst(30); // nails
emitters.AddParameterIntConst(10); // naildamage
emitters.AddParameterPointerConst(PClass::FindClass(NAME_BulletPuff)); // itemtype
emitters.AddParameterIntConst(NAME_None); // damage type
}
static void CreateSpawnObjectFunc(FunctionCallEmitter& emitters, int value1, int value2, MBFParamState* state)
{
state->ValidateArgCount(8, "A_SpawnObject");
@ -936,7 +920,6 @@ static void (*MBFCodePointerFactories[])(FunctionCallEmitter&, int, int, MBFPara
{
// Die and Detonate are not in this list because these codepointers have
// no dehacked arguments and therefore do not need special handling.
// NailBomb has no argument but is implemented as new parameters for A_Explode.
CreateMushroomFunc,
CreateSpawnFunc,
CreateTurnFunc,
@ -945,7 +928,6 @@ static void (*MBFCodePointerFactories[])(FunctionCallEmitter&, int, int, MBFPara
CreatePlaySoundFunc,
CreateRandomJumpFunc,
CreateLineEffectFunc,
CreateNailBombFunc,
CreateSpawnObjectFunc,
CreateMonsterProjectileFunc,
CreateMonsterBulletAttackFunc,

View file

@ -1193,12 +1193,11 @@ Aliases
A_PlaySound, A_PlaySound,
A_RandomJump, A_Jump,
A_LineEffect, A_LineEffect,
A_NailBomb, A_Explode,
A_SpawnObject, MBF21_SpawnObject,
A_MonsterProjectile, MBF21_MonsterProjectile,
A_MonsterBulletAttack, MBF21_MonsterBulletAttack,
A_MonsterMeleeAttack, MBF21_MonsterMeleeAttack,
A_RadiusDamage, A_Explode,
A_RadiusDamage, A_RadiusDamage,
A_HealChase, MBF21_HealChase,
A_SeekTracer, A_SeekerMissile,
A_FindTracer, A_FindTracer,

View file

@ -616,6 +616,18 @@ extend class Actor
return count;
}
deprecated("2.3", "For Dehacked use only")
void A_NailBomb()
{
A_Explode(nails:30);
}
deprecated("2.3", "For Dehacked use only")
void A_RadiusDamage(int dam, int dist)
{
A_Explode(dam, dist);
}
//==========================================================================
//
// A_RadiusThrust

View file

@ -2084,7 +2084,7 @@ class PlayerPawn : Actor
me.GiveDefaultInventory();
}
}
//===========================================================================
//
// FWeaponSlot :: PickWeapon