-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to Value and Burden #542
Conversation
ghost
commented
Oct 20, 2017
- Created WO.StackUnitValue and WO.StackUnitBurden to be initialized by Weenie.{Value,EncumbranceVal}, with builtin null to zero initialization
- Moved WorldObject value and encumbrance calculations down to the WorldObject class, based upon WO.StackUnitValue and WO.StackUnitBurden vs WO.StackSize
@@ -215,11 +215,15 @@ public void BuyValidateTransaction(ObjectGuid vendorid, List<ItemProfile> items, | |||
foreach (WorldObject wo in uqlist) | |||
{ | |||
goldcost = goldcost + (uint)Math.Ceiling(SellRate * (wo.Value ?? 0) * (wo.StackSize ?? 1) - 0.1); | |||
wo.Value = wo.Value; // Also set the stack's value for unique items, using the builtin WO calculations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this sorta odd that these lines are required.. i would think it should have auto updated the value based on on the getter.. maybe something else is needed though..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I tested it without these lines present; however, the value and burden of the items, regardless of stack count, didn't set themselves correctly, until the stack was manipulated. I am wondering maybe item examine is one of the processes that acts upon the AO, instead of the WO, as you mentioned at one point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment about what looks odd to me, but i'm sure it works and doesn't hurt really.. just odd