Skip to content
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

Merged
merged 3 commits into from Oct 21, 2017
Merged

Fix to Value and Burden #542

merged 3 commits into from Oct 21, 2017

Conversation

ghost
Copy link

@ghost 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
Copy link
Member

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..

Copy link
Author

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.

LtRipley36706
LtRipley36706 previously approved these changes Oct 21, 2017
Copy link
Member

@LtRipley36706 LtRipley36706 left a 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

@LtRipley36706 LtRipley36706 merged commit ef56279 into ACEmulator:master Oct 21, 2017
@ghost ghost deleted the FixValueBurden branch March 11, 2018 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants