Melee attacks not always using ammo (with autoaim off)

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Melee attacks not always using ammo (with autoaim off)

Postby Ichor » Sat Sep 30, 2017 11:49 am

I've noticed that attacks such as A_CustomPunch and FAxeAttack won't always use ammo. After some testing, I discovered that if you hit something at an odd angle, it will do the damage and spawn the puff, but it might not use up the ammo.

In this example map for Hexen, I have modified a pot to have a ton of health and make it non-pushable, and I gave the fighter's axe an alt-fire which uses CustomPunch instead of FAxeAttack, but otherwise it does the same thing. First, turn off autoaim (with autoaim on, hitting the pot will always use mana). Then get right up to the pot and aim at the very top of it with either fire mode and even though it will hit the pot, no mana is used.
Attachments
punchtest.wad
(5.47 KiB) Downloaded 10 times
User avatar
Ichor
The fun cannot be halted
 
Joined: 23 Jul 2003

Re: Melee attacks not always using ammo (with autoaim off)

Postby Ichor » Wed Oct 04, 2017 5:37 pm

Here is a video of the bug. I also noticed that for the times the ammo isn't used, you don't have that sudden jerk that you normally would have.

User avatar
Ichor
The fun cannot be halted
 
Joined: 23 Jul 2003

Re: Melee attacks not always using ammo (with autoaim off)

Postby _mental_ » Wed Nov 01, 2017 4:36 am

I managed to track it down to a particular change. This was introduced in r4253, this line to be precise.
Before that commit presence of DF2_NOAUTOAIM in dmflags2 was ignored in P_AimLineAttack() function. But now with autoaim turned off vrange will be always zero.
I don't know was it intentional or not but something close to old behavior can restored by userinfo_t::GetAutoaim() function (BTW clamping will be no longer needed) instead of GetAimDist().
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Melee attacks not always using ammo (with autoaim off)

Postby Ichor » Wed Nov 01, 2017 7:23 am

4 years old, eh? I haven't used autoaim for longer than that. I'm surprised I never noticed it sooner. At first I thought it had something to do with my weapon decorate code. I tried to track down the problem, but it resisted all attempts. That's when I began to suspect that it was an actual ZDoom bug.
User avatar
Ichor
The fun cannot be halted
 
Joined: 23 Jul 2003


Return to Bugs

Who is online

Users browsing this forum: No registered users and 2 guests