Skip to content

Commit

Permalink
- fixed MBF21's A_SeekTracer.
Browse files Browse the repository at this point in the history
This cannot directly call A_SeekerMissile because that has more parameters. It now maps to a wrapper that takes care of these.
  • Loading branch information
coelckers committed Jan 6, 2022
1 parent 49ab661 commit 32de663
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/sound/s_advsound.cpp
Expand Up @@ -416,7 +416,7 @@ static int S_AddSound (const char *logicalname, int lumpnum, FScanner *sc)

sfxid = soundEngine->FindSoundNoHash (logicalname);

if ((unsigned int)sfxid < S_sfx.Size())
if (sfxid > 0 && (unsigned int)sfxid < S_sfx.Size())
{ // If the sound has already been defined, change the old definition
sfxinfo_t *sfx = &S_sfx[sfxid];

Expand Down Expand Up @@ -483,7 +483,9 @@ int S_AddPlayerSound (const char *pclass, int gender, int refid,

int S_AddPlayerSound (const char *pclass, int gender, int refid, int lumpnum, bool fromskin)
{

auto &S_sfx = soundEngine->GetSounds();

FString fakename;
int id;

Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/dehsupp.txt
Expand Up @@ -1199,7 +1199,7 @@ Aliases
A_MonsterMeleeAttack, MBF21_MonsterMeleeAttack,
A_RadiusDamage, A_RadiusDamage,
A_HealChase, MBF21_HealChase,
A_SeekTracer, A_SeekerMissile,
A_SeekTracer, MBF21_SeekTracer,
A_FindTracer, A_FindTracer,
A_JumpIfHealthBelow, MBF21_JumpIfHealthBelow,
A_JumpIfTargetInSight, MBF21_JumpIfTargetInSight,
Expand Down
6 changes: 6 additions & 0 deletions wadsrc/static/zscript/actors/mbf21.zs
Expand Up @@ -503,5 +503,11 @@ extend class Weapon
player.SetPsprite(PSP_FLASH, tstate);
}

// needed to call A_SeekerMissile with proper defaults.
deprecated("2.3", "for Dehacked use only")
void MBF21_SeekTracer(int threshold, int turnmax)
{
A_SeekerMissile(threshold, turnmax);
}

}

0 comments on commit 32de663

Please sign in to comment.