Ankh glitch

Duck123

Loreseeker
Joined
13/05/2017
Messages
346
For clerics with intervention there is a glitch where if your mana and health hit 0 at the same time the ankh doesn’t activate and you die
 

VDX_360

Staff member
Moderator
Joined
20/01/2017
Messages
6,126
That's not good.

Intervention has a few odd outcomes when used in certain situations, and I -think- it has to do with the order of operations for how things are triggered, but only David would know for sure.

Hopefully you weren't on Ironman....
 

DavidBVal

Developer
Staff member
Administrator
Joined
28/02/2015
Messages
7,427
ouchies. I'll look into it, and sorry, you have my condolences. That death won't be in vain!
 

DavidBVal

Developer
Staff member
Administrator
Joined
28/02/2015
Messages
7,427
Well, I looked at the code and... it looks alright.

If you are dropped to 0hp, the code checks if you have the intervention skill AND have mana.

If neither of those things happen, it should check for the Ankh normally.

Looking at the code I can't find any way for this to fail, do you remember any details on what happened just before the death?
 

Duck123

Loreseeker
Joined
13/05/2017
Messages
346
I don’t know. I didn’t do anything special I don’t think. I entered the vending machine in the reactor and got surprised by 4 of the spiders. I activated battle prayer and while it was casting I died. Then It game-overed me.
 

DavidBVal

Developer
Staff member
Administrator
Joined
28/02/2015
Messages
7,427
while you were casting... that could be it. I'll try to add some extra check to make sure it doesn't happen.
 

VDX_360

Staff member
Moderator
Joined
20/01/2017
Messages
6,126
I tried to re-create this using my Cleric and got it to happen once.

It seems that --sometimes-- if you use a skill that depletes your mana while you hit zero HP, you die even with the Ankh. There seems to be a pretty narrow window that might only be possible if you have multiple incoming damage sources.

I checked to see if there was a related issue where you could use up the Ankh without actually needing it (taking damage to zero hp while heal is in effect) and I didn't see that happen but that could be a timing thing as well. I might explore that more later but my Cleric needs a break from being a Training Dummy for Arc enemies.
 

VDX_360

Staff member
Moderator
Joined
20/01/2017
Messages
6,126
I wonder, and this is just wild speculation, I wonder if incoming damage from multiple sources throws off the internal timing for the Ankh check?
 

DavidBVal

Developer
Staff member
Administrator
Joined
28/02/2015
Messages
7,427
I wonder, and this is just wild speculation, I wonder if incoming damage from multiple sources throws off the internal timing for the Ankh check?

Damage is received on your character as timed "events", which can overlap if you receive lots of attacks.

Current code checks if you have mana and know the Intervention skill, then casts it and, (as it assumes you're now alive) bypasses the Ankh check.

Theoretically it is possible, although very rare, that a damage "event" arrives between the mana check and the actual attempt to use the skill. It's one line of code followed by another, so chances of it happening are extremely low, but I can't think of a different explanation.

I added an extra check after calling Intervention skill, and only if you're now in positive HP it bypasses the Ankh check. It'd be nice to test Intervention extensively when beta testing is available, to make sure this doesn't have any unexpected consequences (I doubt it, but paranoia is always good in my line of business)
 

Top