aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2012_03_27_04_world_misc.sql3
-rwxr-xr-xsrc/server/game/Events/GameEventMgr.cpp6
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp10
-rwxr-xr-xsrc/server/game/Instances/InstanceSaveMgr.cpp2
-rwxr-xr-xsrc/server/game/Movement/Waypoints/WaypointManager.cpp2
-rwxr-xr-xsrc/server/game/World/World.cpp20
-rwxr-xr-xsrc/server/game/World/World.h2
7 files changed, 13 insertions, 32 deletions
diff --git a/sql/updates/world/2012_03_27_04_world_misc.sql b/sql/updates/world/2012_03_27_04_world_misc.sql
new file mode 100644
index 00000000000..e85350476c9
--- /dev/null
+++ b/sql/updates/world/2012_03_27_04_world_misc.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `spell_dbc` CHANGE `StackAmount` `StackAmount` int(10) unsigned NOT NULL DEFAULT '0';
+ALTER TABLE `waypoint_data` CHANGE `action_chance` `action_chance` smallint(6) NOT NULL DEFAULT '100';
+ALTER TABLE `item_loot_template` CHANGE `maxcount` `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1';
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();