Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
coelckers committed Oct 3, 2021
1 parent 6e9e75c commit 3c961a2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
18 changes: 0 additions & 18 deletions src/gamedata/d_dehacked.cpp
Expand Up @@ -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");
Expand Down Expand Up @@ -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,
Expand All @@ -945,7 +928,6 @@ static void (*MBFCodePointerFactories[])(FunctionCallEmitter&, int, int, MBFPara
CreatePlaySoundFunc,
CreateRandomJumpFunc,
CreateLineEffectFunc,
CreateNailBombFunc,
CreateSpawnObjectFunc,
CreateMonsterProjectileFunc,
CreateMonsterBulletAttackFunc,
Expand Down
3 changes: 1 addition & 2 deletions wadsrc/static/dehsupp.txt
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions wadsrc/static/zscript/actors/attacks.zs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/player/player.zs
Expand Up @@ -2084,7 +2084,7 @@ class PlayerPawn : Actor
me.GiveDefaultInventory();
}
}

//===========================================================================
//
// FWeaponSlot :: PickWeapon
Expand Down

0 comments on commit 3c961a2

Please sign in to comment.