devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

fix infinite attack loop when force attacking a non-hostile character

Open alanbirtles opened this issue 3 years ago • 13 comments

Not sure if this is the right fix but fixes the problem for me. Reproduce by standing next to a non hostile character (I found the bug with Lachdanan), putting the cursor the opposite side of them then force attack. An infinite loop of attacks starts and there doesn't seem to be any way to break out of it.

alanbirtles avatar Mar 12 '21 19:03 alanbirtles

is this a vanilla bug?

qndel avatar Mar 12 '21 19:03 qndel

could well be, its not one I remember encountering but it was 20 years ago!

alanbirtles avatar Mar 12 '21 19:03 alanbirtles

can't you test in vanilla? :P

qndel avatar Mar 12 '21 19:03 qndel

don't think it runs on my machine

alanbirtles avatar Mar 12 '21 19:03 alanbirtles

By "force attack" do you mean shift click in the opposite direction? Does this happen with every class/weapon? Does it happen consistently regardless of save (did you check with different characters)?

julealgon avatar Mar 13 '21 00:03 julealgon

looks like a reasonable fix, i actually found something similar the other day. If attack a barral next to Lachdanan and then click him before the animation is over you will perform attacks on him (he wong get hit)

AJenbo avatar Mar 13 '21 01:03 AJenbo

Tested in vanilla, I can't reproduce this bug.

Couldn't reproduce in DevilX either. Tried with Lachdanan

galaxyhaxz avatar Mar 13 '21 05:03 galaxyhaxz

This was with bard dual welding swords, I didn't try other characters. Yes I do mean shift clicking, note that shift clicking on the character directly doesn't trigger an attack, you have to click behind the character so that you are attacking in their direction but not attempting to attack them directly. Looking at the code I imagine this will happen with any melee weapon.

alanbirtles avatar Mar 13 '21 06:03 alanbirtles

Ok, so most likely it's specific to the barbarian and changes made with hellfire.

galaxyhaxz avatar Mar 13 '21 09:03 galaxyhaxz

yes, it does seem to only affect the bard, I couldn't reproduce with a warrior. With a bard it happens with single or dual wielded melee weapons

alanbirtles avatar Mar 13 '21 09:03 alanbirtles

Fix looks a bit arbitrary/hacky to me. I wonder if there is a cleaner way to go about this. If the problem only occurs with bard, it doesn't make sense to me to do this this way. Why does it happen only with the bard in the first place?

I don't feel comfortable in making fixes while we don't clearly understand the problem at hand.

julealgon avatar Mar 13 '21 14:03 julealgon

@alanbirtles can you please provide a save file that can easily repro this issue?

julealgon avatar May 16 '21 21:05 julealgon

3 year old PR for an issue nobody except the author can reproduce. Close? @AJenbo

kphoenix137 avatar Mar 13 '24 19:03 kphoenix137