From 3c961a2aa26ec8548b15b066d74fc8d89a09bdca Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 3 Oct 2021 18:16:37 +0200 Subject: [PATCH] - 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. --- src/gamedata/d_dehacked.cpp | 18 ------------------ wadsrc/static/dehsupp.txt | 3 +-- wadsrc/static/zscript/actors/attacks.zs | 12 ++++++++++++ wadsrc/static/zscript/actors/player/player.zs | 2 +- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index 85c167fe00..a82146ad54 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -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, diff --git a/wadsrc/static/dehsupp.txt b/wadsrc/static/dehsupp.txt index 744e65dc0e..8525d11644 100644 --- a/wadsrc/static/dehsupp.txt +++ b/wadsrc/static/dehsupp.txt @@ -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, diff --git a/wadsrc/static/zscript/actors/attacks.zs b/wadsrc/static/zscript/actors/attacks.zs index 102451abdc..edefdd24fe 100644 --- a/wadsrc/static/zscript/actors/attacks.zs +++ b/wadsrc/static/zscript/actors/attacks.zs @@ -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 diff --git a/wadsrc/static/zscript/actors/player/player.zs b/wadsrc/static/zscript/actors/player/player.zs index a3f94408f3..c5795537a5 100644 --- a/wadsrc/static/zscript/actors/player/player.zs +++ b/wadsrc/static/zscript/actors/player/player.zs @@ -2084,7 +2084,7 @@ class PlayerPawn : Actor me.GiveDefaultInventory(); } } - + //=========================================================================== // // FWeaponSlot :: PickWeapon