[Fixed] [Hexen] Fighter's Axe attacks too fast when out of ammo

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

[Hexen] Fighter's Axe attacks too fast when out of ammo

Postby Virathas » Thu Oct 24, 2019 9:26 am

I have noticed that when Fighter uses Timon's Axe without mana, and hits a monster, most of the Fire state is skipped and can be nearly instantly refired after dealing damage. This issue does not occur when hitting walls or when attacking while having mana. This issue is present since a long time, and i can confirm that it occured since at least 3.2.5 and is still present on 4.2.3. This was probably introduced with the Zscript update, as the function F_AxeAttack() seems to malfunction, however, I still do not have enough experience with ZScript to verify how it should work.

Repro Steps:
1. Launch the game with Hexen IWAD
2. Start a new game
3. Use Give Weapons cheat and Take ammo
4. Use Timon's axe against Ettins around

Observed Results:
Several Attack frames after damaging an enemy are skipped, resulting in way too fast attacks.

Expected Results:
Animation continues flawlessly and no frames are skipped.

Repro Rate: 10/10

Other Notes:
In some very old zdoom version (2.8.1) it did work as expected, no frames skipped.

Game Version:
GZDoom: g4.2.3
User avatar
Joined: 10 Aug 2017

Re: [Hexen] Fighter's Axe attacks too fast when out of ammo

Postby Rip and Tear » Fri Oct 25, 2019 7:43 am

I believe this is the offending ZScript.

Code: Select allExpand view
if ((weapon.Ammo1 == null || weapon.Ammo1.Amount == 0) &&
   (!(weapon.bPrimary_Uses_Both) ||
      weapon.Ammo2 == null || weapon.Ammo2.Amount == 0))
   player.SetPsprite(PSP_WEAPON, weapon.FindState("EndAttack"));

Compared with the original Hexen source:

Code: Select allExpand view
if(useMana == 2)
   player->mana[MANA_1] -=
   if(player->mana[MANA_1] <= 0)
      P_SetPsprite(player, ps_weapon, S_FAXEATK_5);
User avatar
Rip and Tear
I <3 ZScript
Joined: 02 May 2017
Operating System: Mac OS X 10.8 or later
Graphics Processor: Intel (Modern GZDoom)

Re: [Hexen] Fighter's Axe attacks too fast when out of ammo

Postby _mental_ » Sat Oct 26, 2019 2:33 am

Fixed in 10078f5.
Joined: 07 Aug 2011

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 3 guests