blueboy / portal

This portal repo is for development purposes only
http://github.com/blueboy/portal
GNU General Public License v2.0
27 stars 24 forks source link

[bug] sell sells equipped items #28

Closed kennumen closed 12 years ago

kennumen commented 12 years ago

I looked at my warrior and druid and suddenly they were mostly naked.

Could also be a bug in the sell command listing stuff they're wearing.

This was with all gray/white gear.

Not much info to go on, I know, but this could be one disturbing bug to players who spent days getting decent gear for their playerbot alts.

kennumen commented 12 years ago

found the bug (updated the topic title)

sell sells equipped items. big no-no.

blueboy commented 12 years ago

I think I've found the cause for this one. I created the function Item* FindItem(ItemId) sometime ago, that is used to service several features that address items (auction,bank,repair,sell,quest and drop). This function returns a pointer for all item found in the bot bags and equipped. Interestingly, only 'repair' really needs to consider all items, so I have now modified the function (Item* PlayerbotAI::FindItem(uint32 ItemId, bool Equipped_too /* default = false */).

@EDIT I have now pushed the fix to the 'new-ai' branch for you to try.

kennumen commented 12 years ago

Great, thanks for the push. Works swell.

One small (non-functional) note: Sell White was being spammed (per item the bot holds, it seems). Temporary fix: https://github.com/blueboy/portal/commit/b2d6a05cd0516e984f276f9fa7eb6152ce2603c1

Please tweak to your satisfaction.

@edit Oh, now it doesn't output at all. Anyway, it's stopped driving me nuts. Have at it :)