diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index 0b4f25576..6cb5b99bb 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -2696,6 +2696,8 @@ static int PatchCodePtrs (int dummy) // This skips the action table and goes directly to the internal symbol table // DEH compatible functions are easy to recognize. + // Note that A_CPosAttack needs to be remapped because it differs from the original and cannot be renamed anymore. + if (!symname.CompareNoCase("A_CPosAttack")) symname = "A_CPosAttackDehacked"; PFunction *sym = dyn_cast(PClass::FindActor(NAME_Weapon)->FindSymbol(symname, true)); if (sym == NULL) { @@ -3371,7 +3373,8 @@ static bool LoadDehSupp () // all relevant code pointers are either defined in Weapon // or Actor so this will find all of them. FString name = "A_"; - name << sc.String; + if (sc.Compare("CPosAttack")) name << "CPosAttackDehacked"; + else name << sc.String; PFunction *sym = dyn_cast(wcls->FindSymbol(name, true)); if (sym == NULL) { diff --git a/wadsrc/static/zscript/actors/doom/possessed.zs b/wadsrc/static/zscript/actors/doom/possessed.zs index eef344ab8..4fa9e0f7e 100644 --- a/wadsrc/static/zscript/actors/doom/possessed.zs +++ b/wadsrc/static/zscript/actors/doom/possessed.zs @@ -315,12 +315,12 @@ extend class Actor } } - void A_CPosAttack() + private void A_CPosAttackInternal(Sound snd) { if (target) { if (bStealth) visdir = 1; - A_StartSound(AttackSound, CHAN_WEAPON); + A_StartSound(snd, CHAN_WEAPON); A_FaceTarget(); double slope = AimLineAttack(angle, MISSILERANGE); double ang = angle + Random2[CPosAttack]() * (22.5/256); @@ -328,6 +328,17 @@ extend class Actor LineAttack(ang, MISSILERANGE, slope, damage, "Hitscan", "Bulletpuff"); } } + + void A_CPosAttack() + { + A_CPosAttackInternal(AttackSound); + } + + void A_CPosAttackDehacked() + { + A_CPosAttackInternal("chainguy/attack"); + } + void A_CPosRefire() {