diff options
author | megamage <none@none> | 2009-01-03 11:06:51 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-03 11:06:51 -0600 |
commit | 9438625a19c070ec20d392fa57f1de6a61b7b985 (patch) | |
tree | e4d7fc1ea493a8fb86bd4729b5c6940a2c771d27 /src/game/ObjectMgr.cpp | |
parent | a1a52b710c6563105d1c24112b1fa2699f3fbdfe (diff) |
[7015] Implement support -1 in item_template.stackable and item_template.maxcount fields. By VladimirMangos.
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r-- | src/game/ObjectMgr.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index da79a656db2..3ec944f7f22 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1800,11 +1800,22 @@ void ObjectMgr::LoadItemPrototypes() else if(proto->RequiredReputationRank > MIN_REPUTATION_RANK) sLog.outErrorDb("Item (Entry: %u) has RequiredReputationFaction ==0 but RequiredReputationRank > 0, rank setting is useless.",i); + if(proto->MaxCount < -1) + { + sLog.outErrorDb("Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.",i,proto->MaxCount); + const_cast<ItemPrototype*>(proto)->MaxCount = -1; + } + if(proto->Stackable==0) { - sLog.outErrorDb("Item (Entry: %u) has wrong value in stackable (%u), replace by default 1.",i,proto->Stackable); + sLog.outErrorDb("Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.",i,proto->Stackable); const_cast<ItemPrototype*>(proto)->Stackable = 1; } + else if(proto->Stackable < -1) + { + sLog.outErrorDb("Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.",i,proto->Stackable); + const_cast<ItemPrototype*>(proto)->Stackable = -1; + } else if(proto->Stackable > 255) { sLog.outErrorDb("Item (Entry: %u) has too large value in stackable (%u), replace by hardcoded upper limit (255).",i,proto->Stackable); |