diff --git a/data/sql/updates/pending_db_world/rev_1770900184961304377.sql b/data/sql/updates/pending_db_world/rev_1770900184961304377.sql new file mode 100644 index 000000000..d155998d1 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1770900184961304377.sql @@ -0,0 +1,8 @@ +-- +-- uint8 to uint32 conversion for maxcount in npc_vendor +-- game_event_npc_vendor does not need to be updated +ALTER TABLE `npc_vendor` MODIFY COLUMN `maxcount` int unsigned DEFAULT 0 NOT NULL; + +DELETE FROM `npc_vendor` WHERE (`entry` = 29561) AND (`item` IN (21177)); +INSERT INTO `npc_vendor` (`entry`, `slot`, `item`, `maxcount`, `incrtime`, `ExtendedCost`, `VerifiedBuild`) VALUES +(29561, 0, 21177, 300, 600, 0, 0); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 1d0b5bdfe..d2e3c8ee5 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -9799,7 +9799,7 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set* s count += LoadReferenceVendor(vendor, -item_id, skip_vendors); else { - int32 maxcount = fields[1].Get(); + uint32 maxcount = fields[1].Get(); uint32 incrtime = fields[2].Get(); uint32 ExtendedCost = fields[3].Get(); @@ -9849,7 +9849,7 @@ void ObjectMgr::LoadVendors() count += LoadReferenceVendor(entry, -item_id, &skip_vendors); else { - uint32 maxcount = fields[2].Get(); + uint32 maxcount = fields[2].Get(); uint32 incrtime = fields[3].Get(); uint32 ExtendedCost = fields[4].Get(); @@ -9998,7 +9998,7 @@ void ObjectMgr::LoadGossipMenuItems() LOG_INFO("server.loading", " "); } -void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist /*= true*/) +void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, uint32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist /*= true*/) { VendorItemData& vList = _cacheVendorItemStore[entry]; vList.AddItem(item, maxcount, incrtime, extendedCost); @@ -10039,7 +10039,7 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool persist /*= tru return true; } -bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* player, std::set* /*skip_vendors*/, uint32 /*ORnpcflag*/) const +bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* player, std::set* /*skip_vendors*/, uint32 /*ORnpcflag*/) const { /* CreatureTemplate const* cInfo = GetCreatureTemplate(vendor_entry); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index d9f458293..0afcfdc5b 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1417,9 +1417,9 @@ public: return &iter->second; } - void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist = true); // for event + void AddVendorItem(uint32 entry, uint32 item, uint32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist = true); // for event bool RemoveVendorItem(uint32 entry, uint32 item, bool persist = true); // for event - bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* player = nullptr, std::set* skip_vendors = nullptr, uint32 ORnpcflag = 0) const; + bool IsVendorItemValid(uint32 vendor_entry, uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* player = nullptr, std::set* skip_vendors = nullptr, uint32 ORnpcflag = 0) const; void LoadScriptNames(); ScriptNameContainer& GetScriptNames() { return _scriptNamesStore; }