Don't call Item::AddToUpdateQueueOf if no player is specified as parameter for Item::SetState, since in this case, only data stored in the item_instance table is altered, not that of character_inventory.

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-03-15 14:52:02 +01:00
parent c47b8a89c1
commit f9a3aedc14
2 changed files with 7 additions and 5 deletions
+5 -3
View File
@@ -625,12 +625,14 @@ void Item::SetState(ItemUpdateState state, Player *forplayer)
delete this; delete this;
return; return;
} }
if (state != ITEM_UNCHANGED) if (state != ITEM_UNCHANGED)
{ {
// new items must stay in new state until saved // new items must stay in new state until saved
if (uState != ITEM_NEW) uState = state; if (uState != ITEM_NEW)
AddToUpdateQueueOf(forplayer); uState = state;
if (forplayer)
AddToUpdateQueueOf(forplayer);
} }
else else
{ {
+2 -2
View File
@@ -250,8 +250,8 @@ class Item : public Object
void SetInTrade(bool b = true) { mb_in_trade = b; } void SetInTrade(bool b = true) { mb_in_trade = b; }
bool IsInTrade() const { return mb_in_trade; } bool IsInTrade() const { return mb_in_trade; }
bool HasEnchantRequiredSkill(const Player *pPlayer) const; bool HasEnchantRequiredSkill(const Player *pPlayer) const;
uint32 GetEnchantRequiredLevel() const; uint32 GetEnchantRequiredLevel() const;
bool IsFitToSpellRequirements(SpellEntry const* spellInfo) const; bool IsFitToSpellRequirements(SpellEntry const* spellInfo) const;
bool IsTargetValidForItemUse(Unit* pUnitTarget); bool IsTargetValidForItemUse(Unit* pUnitTarget);