blizzless-diiis icon indicating copy to clipboard operation
blizzless-diiis copied to clipboard

[Bug] Monk object reference

Open cfryerdev opened this issue 2 years ago • 3 comments

The following code has a unchecked null. Lets not add empty catches here... Also i believe the calcs are off as well.

Code: https://github.com/blizzless/blizzless-diiis/blob/d7bce32efbf0a51ed8e56e235c20f9e9523efd52/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Player.cs#L1138

Also, I believe the code should look something like this:

Note: Not sure if we have a spirit rate atrribute yet ?

case 209812: //TheGuardiansPath
    var weapon = Inventory.GetEquippedWeapon();
    var offhand = Inventory.GetEquippedOffHand();
    if (weapon != null && offhand != null)
    {
        Attributes[GameAttribute.Dodge_Chance_Bonus] += 0.35f;
        // Attributes[GameAttribute.Spirit_Rate] += 0.15f;
        World.BuffManager.RemoveBuffs(this, 209812);
        World.BuffManager.AddBuff(this, this, new GuardiansPathBuff());
    }
image

cfryerdev avatar Jan 26 '23 17:01 cfryerdev

Can you share how to replicate?

iamdroppy avatar Jan 26 '23 18:01 iamdroppy

I started a Monk and used the !level command to make me a higher level, and simply chose the Guardian's Path perk. Started crashing so went into debug and found that the line in question was outside of the null check condition :) Spent some more time looking into what the perk should do and made some adjustments to the code on my wide. Runs great.

cfryerdev avatar Jan 26 '23 18:01 cfryerdev

Updated code sample, not sure if there is a way to increase the spirit rate but left that comment in.

cfryerdev avatar Jan 31 '23 18:01 cfryerdev