diff options
author | Nay <dnpd.dd@gmail.com> | 2012-03-28 00:38:04 +0100 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2012-03-28 00:38:24 +0100 |
commit | f44e6834df4278fece0ca9c419b644512de812a6 (patch) | |
tree | dc16093411aea0655a8919d327d39154a413ea6d /src | |
parent | 76397cf9311eb89a75d7a71b973c7d480a40b9a7 (diff) |
Core/DBLayer: Fix remaining errors in loading world tables and a couple of them in characters database
Also removed World::LoadIp2nation(), it was not doing anything.
Closes #5897
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Events/GameEventMgr.cpp | 6 | ||||
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 10 | ||||
-rwxr-xr-x | src/server/game/Instances/InstanceSaveMgr.cpp | 2 | ||||
-rwxr-xr-x | src/server/game/Movement/Waypoints/WaypointManager.cpp | 2 | ||||
-rwxr-xr-x | src/server/game/World/World.cpp | 20 | ||||
-rwxr-xr-x | src/server/game/World/World.h | 2 |
6 files changed, 10 insertions, 32 deletions
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 7224007fb2c..182aaa35c49 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -283,7 +283,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); if (event_id >= mGameEvent.size()) { @@ -469,7 +469,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); + uint16 event_id = fields[1].GetUInt8(); if (event_id >= mGameEventModelEquip.size()) { @@ -982,7 +982,7 @@ void GameEventMgr::Initialize() { Field* fields = result->Fetch(); - uint32 maxEventId = fields[0].GetUInt16(); + uint32 maxEventId = fields[0].GetUInt8(); // Id starts with 1 and vector with 0, thus increment maxEventId++; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6e0a5928c02..d8107576ee4 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2820,7 +2820,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories() uint32 uiEntry = fields[0].GetUInt32(); uint32 uiAccessory = fields[1].GetUInt32(); - int8 uiSeat = int8(fields[2].GetInt16()); + int8 uiSeat = int8(fields[2].GetInt8()); bool bMinion = fields[3].GetBool(); uint8 uiSummonType = fields[4].GetUInt8(); uint32 uiSummonTimer= fields[5].GetUInt32(); @@ -7154,11 +7154,11 @@ void ObjectMgr::LoadNPCSpellClickSpells() continue; } - uint8 userType = fields[3].GetUInt8(); + uint8 userType = fields[3].GetUInt16(); if (userType >= SPELL_CLICK_USER_MAX) sLog->outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType)); - uint8 castFlags = fields[2].GetUInt16(); + uint8 castFlags = fields[2].GetUInt8(); SpellClickInfo info; info.spellId = spellid; info.castFlags = castFlags; @@ -8240,7 +8240,7 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *s count += LoadReferenceVendor(vendor, -item_id, skip_vendors); else { - int32 maxcount = fields[1].GetUInt8(); // tinyint(3) unsigned + int32 maxcount = fields[1].GetUInt8(); uint32 incrtime = fields[2].GetUInt32(); uint32 ExtendedCost = fields[3].GetUInt32(); @@ -8290,7 +8290,7 @@ void ObjectMgr::LoadVendors() count += LoadReferenceVendor(entry, -item_id, &skip_vendors); else { - int32 maxcount = fields[2].GetInt32(); + uint32 maxcount = fields[2].GetUInt8(); uint32 incrtime = fields[3].GetUInt32(); uint32 ExtendedCost = fields[4].GetUInt32(); diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index ca39c137274..c17c7edbf0d 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -358,7 +358,7 @@ void InstanceSaveManager::LoadResetTimes() { Field* fields = result->Fetch(); uint32 mapid = fields[0].GetUInt16(); - Difficulty difficulty = Difficulty(fields[1].GetUInt32()); + Difficulty difficulty = Difficulty(fields[1].GetUInt8()); uint64 oldresettime = fields[2].GetUInt32(); MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty); diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index 93d9e2290c1..296c9eee50f 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -79,7 +79,7 @@ void WaypointMgr::Load() wp->run = fields[6].GetBool(); wp->delay = fields[7].GetUInt32(); wp->event_id = fields[8].GetUInt32(); - wp->event_chance = fields[9].GetUInt8(); + wp->event_chance = fields[9].GetInt16(); path.push_back(wp); ++count; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index cb365eefbd6..489278f63e6 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1625,9 +1625,6 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Autobroadcasts..."); LoadAutobroadcasts(); - sLog->outString("Loading Ip2nation..."); - LoadIp2nation(); - ///- Load and initialize scripts sObjectMgr->LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate sObjectMgr->LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate @@ -1884,23 +1881,6 @@ void World::LoadAutobroadcasts() sLog->outString(); } -void World::LoadIp2nation() -{ - uint32 oldMSTime = getMSTime(); - - QueryResult result = WorldDatabase.Query("SELECT count(c.code) FROM ip2nationCountries c, ip2nation i WHERE c.code = i.country"); - uint32 count = 0; - - if (result) - { - Field* fields = result->Fetch(); - count = fields[0].GetUInt32(); - } - - sLog->outString(">> Loaded %u ip2nation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); -} - /// Update the World ! void World::Update(uint32 diff) { diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 1247504678a..95e9fbda8ca 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -741,8 +741,6 @@ class World void LoadAutobroadcasts(); - void LoadIp2nation(); - void UpdateAreaDependentAuras(); void ProcessStartEvent(); |