aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-03-15 14:52:02 +0100
committerMachiavelli <none@none>2010-03-15 14:52:02 +0100
commitf9a3aedc14064d5f8961b428b69aaf41a08bd12e (patch)
tree3942ee1678aaf952b46fc39c71c3b5c6c0b845f1
parentc47b8a89c1ca0cba199324e0f9d67982b588ffa7 (diff)
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
-rw-r--r--src/game/Item.cpp8
-rw-r--r--src/game/Item.h4
2 files changed, 7 insertions, 5 deletions
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index 1a5dd558c8f..7c2a49e10af 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -625,12 +625,14 @@ void Item::SetState(ItemUpdateState state, Player *forplayer)
delete this;
return;
}
-
if (state != ITEM_UNCHANGED)
{
// new items must stay in new state until saved
- if (uState != ITEM_NEW) uState = state;
- AddToUpdateQueueOf(forplayer);
+ if (uState != ITEM_NEW)
+ uState = state;
+
+ if (forplayer)
+ AddToUpdateQueueOf(forplayer);
}
else
{
diff --git a/src/game/Item.h b/src/game/Item.h
index 8e504800e9a..c0156fab8b6 100644
--- a/src/game/Item.h
+++ b/src/game/Item.h
@@ -250,8 +250,8 @@ class Item : public Object
void SetInTrade(bool b = true) { mb_in_trade = b; }
bool IsInTrade() const { return mb_in_trade; }
- bool HasEnchantRequiredSkill(const Player *pPlayer) const;
- uint32 GetEnchantRequiredLevel() const;
+ bool HasEnchantRequiredSkill(const Player *pPlayer) const;
+ uint32 GetEnchantRequiredLevel() const;
bool IsFitToSpellRequirements(SpellEntry const* spellInfo) const;
bool IsTargetValidForItemUse(Unit* pUnitTarget);