RekkasGit / E3Next

10 stars 19 forks source link

/HealthMax| Fix #221

Closed MetalJacx closed 5 months ago

MetalJacx commented 5 months ago

The check for healthmax was in Heals.CS and wasn't triggering. I couldn't find a 'While" so I move over to casting.cs where there is while check for casting already. Created new method called CheckHealthMax which will check healthmax as long as it is benificial, then either catagortize as heals or Quick Heals with target type of single as to not effect AoE spells.

Tested this out on shaman and paladin on the retribution server with success.

Also need to change elseif for healthmax.

RekkasGit commented 5 months ago

It has been awhile, if I remember correctly this is part of the TargetDoesNotNeedHeals which is passed via an interrupt check during the main Heals function. I see you removed the interrupt check on casting which I am not sure that is the correct approach. Casting allows you to pass any method into it to decide to interrupt the casting of your spell.

Looks like the actual bug was using .Equals vs Starts with? again, I haven't looked super deep and you have dug into this so I await your response.

MetalJacx commented 5 months ago

Once i realized .startswith may have been the issue I stated over and I tried changing just .startswith first and kept everything else as is, but TargetDoesNotNeedHeals was still never triggering. I tried adding broadcast messages at each step and couldn't find while it wasn't triggering. Take what I say with a grain of salt as I am like 2 weeks old with c#, but I didn't see any while statements in heal.cs so I wasn't sure how it was checking while the spell was being cast. So I went over to casting.cs and saw that there was a few interrupt checks while cast was happening and figure I would move it over there. This was my logic on how to fix but I can go back and try something else. Open to learn.

RekkasGit commented 5 months ago

image

the method is passed into casting, and then it checks if there is a /nointerrupt flag. If there isn't a flag, then we check the interrupt code.

image

Are you using the remote debugging feature so that you can simply breakpoint ? :) Makes figuring out these issues way easier. I believe i have it in the wiki on how to set it up and get it running.

MetalJacx commented 5 months ago

I will give grab a new pull and try again, either later tonight or tomorrow. Thank you for the info.

RekkasGit commented 5 months ago

Sounds good, if it is still an issue I will setup my dev enviornment and help you diagnose the issue and walk you through the remote debug if you don't have it setup.

MetalJacx commented 5 months ago

Ok i think I am doing this right so let me know. Changed to startwith, only change made. Didn't do the others that were in pull request.

else if (value.StartsWith("HealthMax|", StringComparison.OrdinalIgnoreCase))
{
HealthMax = GetArgument<Int32>(value);
}

Remote Debugger is running. image

2/1/2024 11:02:27 PM Start of e3 scan loop
it took 0ms to execute CheckGC
it took 4132ms to execute StateUpdates
it took 898ms to execute RefreshCaches
CMD:/target id 1338
CMD:/stick pause
CMD:/casting "Daluda's Mending|1" "-targetid|1338"
[E3][23:02:34] Daluda's Mending 4901 Metaljacx 1338 (2.625sec)
Your Armguards of Envy shimmers briefly.
You begin casting Daluda's Mending.
Metaljacx is filled with the healing power of Daluda.
Your Rose Colored Kanleku's Gauntlets of Spirits flickers with a pale light.
You perform an exceptional heal! (3800)
Metaljacx is bathed in a healing burst.
Valeria says out of character, 'Rose Colored Rusted Wicked Faceguard . Rose Colored Shadow-woven Sleeves, Rose Colored Twin-blade of Sorrow free if anyone needs'
CMD:/stick unpause
CMD:/target id 1339
it took 8100ms to execute BeforeAdvancedSettingsCalls
it took 0ms to execute AfterAdvancedSettingsCalls
Shambu begins to cast a spell. <Focus of the Seventh>
it took 1065ms to execute ClassMethodCalls
it took 267ms to execute FinalCalls
2/1/2024 11:02:42 PM Start of e3 scan loop
it took 0ms to execute CheckGC

Set breakpoint, which I am not sure is right location: image

Testing with my shaman as Tank Heal=Daluda's Mending/HealPct|101/HealthMax|90/Gem|1 My tank at 100% health so it should be cancelling but not.

RekkasGit commented 5 months ago

Okay, I will take a look at this tomorrow (today? i need to go to bed), thank you for giving me the necessary information to reproduce it.

RekkasGit commented 5 months ago

Of course when I go setup everything up, I am running into a core issue dealing with threading primitives, this might take me a few :)

MetalJacx commented 5 months ago

No problem let me know if I can help with anything or provide any additional information.

RekkasGit commented 5 months ago

Sigh, its because on line 477 of Heals.cs, I forgot to put "TargetDoesNotNeedHeals" as the interrupt method on the .Cast. I added it to the one below but forgot there are two places.

Was lead on a wild goose chase before I could even get to that, as I had work i had started months ago that lead my dev environment in a somewhat unusable state and lead to odd errors.

So have the "Starts with" code and then add "TargetDoesNotNeedHeals" to that line 477 for Heals.cs on the .Casting and it should be corrected.

MetalJacx commented 5 months ago

Will added tomorrow. Heading out for the night.

MetalJacx commented 5 months ago

I made those changes, compiled and add it is not interrupting heal during cast still.

image image

When running normally it will just sit there and cast for days and never interrupt the cast, but when I turn on the debugger now it does nothing and won't even cast. Using Tank Heal=Daluda's Mending/HealPct|101/HealthMax|90/Gem|1 to test.

image

RekkasGit commented 5 months ago

lol, ok, i will just sync to master to make an update fix based off what you have shown. and see if it works for you. hopefully by EoD

RekkasGit commented 5 months ago

Okay, i just did a push to master to fix it. Came down to the three issues. 1) Starts with instead of Equals 2) Not adding it to both cast methods 3) yeah... greater than vs less than. you can tell no real testing was done

Try out the master branch updates and see if it works fine for you now.

RekkasGit commented 5 months ago

image

MetalJacx commented 5 months ago

Yeah just tested and it is working :), we can kill this pull request :). thanks for your help

RekkasGit commented 5 months ago

Awesome, glad to hear, will close this out :) ty again!