Skip to content

Conversation

Moldair
Copy link

@Moldair Moldair commented Jul 7, 2018

Safety check was removing all armor from the list sellitems before getting a loot decision. Found to be cause by EquipbleSlots being tested instead of Equipped Slots. Also, added feedback to the user so they know if there is nothing to buy or sell instead of just exiting silently.

Safety check was removing all armor from the list sellitems before getting a loot decision.  Found to be cause by EquipbleSlots being tested instead of Equipped Slots.  Also, added feedback to the user so they know if there is nothing to buy or sell instead of just exiting silently.
@Mag-nus
Copy link
Owner

Mag-nus commented Feb 18, 2019

In regards to this, is this a patch for an Emu bug, or did this bug also exist in retail?

I want to be careful not to change the plugin to work around emu bugs.

@Moldair
Copy link
Author

Moldair commented May 26, 2020

Honestly, I'm not sure, but I lean toward a retail bug. If I understood the code correctly, there was a safety check performed to only be able to sell items in the inventory. Items that were currently equipped could not be sold. To your point, I don't know if if the values used in the original game were the same as the ones being used now.

My change involved changing the comparison from LongValueKey.EquipableSlots, to LongValueKey.EquippedSlots.

My interpretation is the LongValueKey.EquipableSlots is a value that tells the server where it can be equipped, not necessarily is equipped. Therefore, checking an item to see if it can be equipped to a certain slot (>0) results in it being removed from the sale list. The intended function appeared to be only to remove it from the list if it was currently equipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants