Core: Minor cleanup in ObjectMgr and warning fixes

This commit is contained in:
Spp
2012-02-27 11:08:34 +01:00
parent 95d3ea5512
commit 3e622ee7ac
7 changed files with 73 additions and 103 deletions
@@ -83,7 +83,7 @@ void LoadGameObjectModelList()
} }
fclose(model_list_file); fclose(model_list_file);
sLog->outString(">> Loaded %u GameObject models in %u ms", model_list.size(), GetMSTimeDiffToNow(oldMSTime)); sLog->outString(">> Loaded %u GameObject models in %u ms", uint32(model_list.size()), GetMSTimeDiffToNow(oldMSTime));
sLog->outString(); sLog->outString();
} }
@@ -48,7 +48,6 @@ void SmartWaypointMgr::LoadFromDB()
uint32 count = 0; uint32 count = 0;
uint32 total = 0; uint32 total = 0;
WPPath* path = NULL;
uint32 last_entry = 0; uint32 last_entry = 0;
uint32 last_id = 1; uint32 last_id = 1;
+1 -1
View File
@@ -309,7 +309,7 @@ void CalendarMgr::AddAction(CalendarAction const& action)
case CALENDAR_ACTION_REMOVE_EVENT: case CALENDAR_ACTION_REMOVE_EVENT:
{ {
uint64 eventId = action.Event.GetEventId(); uint64 eventId = action.Event.GetEventId();
uint32 flags = action.Event.GetFlags(); //uint32 flags = action.Event.GetFlags();
// FIXME - Use of Flags here! // FIXME - Use of Flags here!
CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER);
+66 -94
View File
@@ -701,7 +701,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
else if (!displayScaleEntry) else if (!displayScaleEntry)
displayScaleEntry = displayEntry; displayScaleEntry = displayEntry;
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2);; CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2);
if (!modelInfo) if (!modelInfo)
sLog->outErrorDb("No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry); sLog->outErrorDb("No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry);
} }
@@ -733,7 +733,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
else if (!displayScaleEntry) else if (!displayScaleEntry)
displayScaleEntry = displayEntry; displayScaleEntry = displayEntry;
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4);; CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4);
if (!modelInfo) if (!modelInfo)
sLog->outErrorDb("No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry); sLog->outErrorDb("No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry);
} }
@@ -992,7 +992,7 @@ void ObjectMgr::LoadEquipmentTemplates()
if (!equipmentInfo.ItemEntry[i]) if (!equipmentInfo.ItemEntry[i])
continue; continue;
ItemEntry const* dbcItem = sItemStore.LookupEntry(equipmentInfo.ItemEntry[i]); ItemEntry const* dbcItem = sItemStore.LookupEntry(equipmentInfo.ItemEntry[i]);
if (!dbcItem) if (!dbcItem)
{ {
@@ -1071,25 +1071,25 @@ void ObjectMgr::ChooseCreatureFlags(const CreatureTemplate* cinfo, uint32& npcfl
CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* displayID) CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* displayID)
{ {
CreatureModelInfo const* minfo = GetCreatureModelInfo(*displayID); CreatureModelInfo const* modelInfo = GetCreatureModelInfo(*displayID);
if (!minfo) if (!modelInfo)
return NULL; return NULL;
// If a model for another gender exists, 50% chance to use it // If a model for another gender exists, 50% chance to use it
if (minfo->modelid_other_gender != 0 && urand(0, 1) == 0) if (modelInfo->modelid_other_gender != 0 && urand(0, 1) == 0)
{ {
CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(minfo->modelid_other_gender); CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->modelid_other_gender);
if (!minfo_tmp) if (!minfo_tmp)
sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, minfo->modelid_other_gender); sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender);
else else
{ {
// Model ID changed // Model ID changed
*displayID = minfo->modelid_other_gender; *displayID = modelInfo->modelid_other_gender;
return minfo_tmp; return minfo_tmp;
} }
} }
return minfo; return modelInfo;
} }
void ObjectMgr::LoadCreatureModelInfo() void ObjectMgr::LoadCreatureModelInfo()
@@ -1327,7 +1327,6 @@ void ObjectMgr::LoadLinkedRespawn()
if (!error) if (!error)
_linkedRespawnStore[guid] = linkedGuid; _linkedRespawnStore[guid] = linkedGuid;
} }
while (result->NextRow()); while (result->NextRow());
@@ -1381,9 +1380,9 @@ void ObjectMgr::LoadCreatures()
{ {
uint32 oldMSTime = getMSTime(); uint32 oldMSTime = getMSTime();
// 0 1 2 3 4 5 6 7 8 9 10 // 0 1 2 3 4 5 6 7 8 9 10
QueryResult result = WorldDatabase.Query("SELECT creature.guid, id, map, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, " QueryResult result = WorldDatabase.Query("SELECT creature.guid, id, map, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, "
// 11 12 13 14 15 16 17 18 19 20 21 // 11 12 13 14 15 16 17 18 19 20 21
"currentwaypoint, curhealth, curmana, MovementType, spawnMask, phaseMask, eventEntry, pool_entry, creature.npcflag, creature.unit_flags, creature.dynamicflags " "currentwaypoint, curhealth, curmana, MovementType, spawnMask, phaseMask, eventEntry, pool_entry, creature.npcflag, creature.unit_flags, creature.dynamicflags "
"FROM creature " "FROM creature "
"LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid " "LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid "
@@ -1694,7 +1693,7 @@ void ObjectMgr::LoadGameobjects()
// 0 1 2 3 4 5 6 // 0 1 2 3 4 5 6
QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation, " QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation, "
// 7 8 9 10 11 12 13 14 15 16 17 // 7 8 9 10 11 12 13 14 15 16 17
"rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, pool_entry " "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, pool_entry "
"FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid " "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid "
"LEFT OUTER JOIN pool_gameobject ON gameobject.guid = pool_gameobject.guid"); "LEFT OUTER JOIN pool_gameobject ON gameobject.guid = pool_gameobject.guid");
@@ -1821,7 +1820,6 @@ void ObjectMgr::LoadGameobjects()
if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system
AddGameobjectToGrid(guid, &data); AddGameobjectToGrid(guid, &data);
++count; ++count;
} while (result->NextRow()); } while (result->NextRow());
sLog->outString(">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime)); sLog->outString(">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime));
@@ -2628,7 +2626,7 @@ void ObjectMgr::LoadItemTemplates()
uint32 item_id = entry->ItemId[j]; uint32 item_id = entry->ItemId[j];
if (!sObjectMgr->GetItemTemplate(item_id)) if (!GetItemTemplate(item_id))
notFoundOutfit.insert(item_id); notFoundOutfit.insert(item_id);
} }
} }
@@ -3131,7 +3129,7 @@ void ObjectMgr::LoadPlayerInfo()
uint32 item_id = fields[2].GetUInt32(); uint32 item_id = fields[2].GetUInt32();
if (!sObjectMgr->GetItemTemplate(item_id)) if (!GetItemTemplate(item_id))
{ {
sLog->outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class); sLog->outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class);
continue; continue;
@@ -3694,7 +3692,7 @@ void ObjectMgr::LoadQuests()
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
Quest * newQuest = new Quest(fields); Quest* newQuest = new Quest(fields);
_questTemplates[newQuest->GetQuestId()] = newQuest; _questTemplates[newQuest->GetQuestId()] = newQuest;
} while (result->NextRow()); } while (result->NextRow());
@@ -3712,9 +3710,7 @@ void ObjectMgr::LoadQuests()
// additional quest integrity checks (GO, creature_template and item_template must be loaded already) // additional quest integrity checks (GO, creature_template and item_template must be loaded already)
if (qinfo->GetQuestMethod() >= 3) if (qinfo->GetQuestMethod() >= 3)
{
sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod());
}
if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED)
{ {
@@ -4401,7 +4397,6 @@ void ObjectMgr::LoadScripts(ScriptsType type)
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
ScriptInfo tmp; ScriptInfo tmp;
tmp.type = type; tmp.type = type;
@@ -4810,8 +4805,8 @@ void ObjectMgr::LoadWaypointScripts()
uint32 action = fields[0].GetUInt32(); uint32 action = fields[0].GetUInt32();
actionSet.erase(action); actionSet.erase(action);
}
} while (result->NextRow()); while (result->NextRow());
} }
for (std::set<uint32>::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr) for (std::set<uint32>::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr)
@@ -5164,7 +5159,6 @@ void ObjectMgr::LoadGossipText()
int count = 0; int count = 0;
if (!result) if (!result)
{ {
sLog->outString(">> Loaded %u npc texts", count); sLog->outString(">> Loaded %u npc texts", count);
sLog->outString(); sLog->outString();
return; return;
@@ -5299,7 +5293,6 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
uint32 returnedCount = 0; uint32 returnedCount = 0;
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
Mail* m = new Mail; Mail* m = new Mail;
m->messageID = fields[0].GetUInt32(); m->messageID = fields[0].GetUInt32();
@@ -5618,7 +5611,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
} }
// minfo is not actually used but the mount_id was updated // minfo is not actually used but the mount_id was updated
sObjectMgr->GetCreatureModelRandomGender(&mount_id); GetCreatureModelRandomGender(&mount_id);
return mount_id; return mount_id;
} }
@@ -5766,10 +5759,10 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
if (MapId != entry->map_id) if (MapId != entry->map_id)
{ {
// if find graveyard at different map from where entrance placed (or no entrance data), use any first // if find graveyard at different map from where entrance placed (or no entrance data), use any first
if (!mapEntry || if (!mapEntry
mapEntry->entrance_map < 0 || || mapEntry->entrance_map < 0
uint32(mapEntry->entrance_map) != entry->map_id || || uint32(mapEntry->entrance_map) != entry->map_id
(mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) || (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0))
{ {
// not have any corrdinates for check distance anyway // not have any corrdinates for check distance anyway
entryFar = entry; entryFar = entry;
@@ -5914,8 +5907,6 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
WorldDatabase.Execute(stmt); WorldDatabase.Execute(stmt);
} }
return;
} }
void ObjectMgr::LoadAreaTriggerTeleports() void ObjectMgr::LoadAreaTriggerTeleports()
@@ -5985,7 +5976,7 @@ void ObjectMgr::LoadAccessRequirements()
_accessRequirementStore.clear(); // need for reload case _accessRequirementStore.clear(); // need for reload case
// 0 1 2 3 4 5 6 7 8 9 // 0 1 2 3 4 5 6 7 8 9
QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement"); QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement");
if (!result) if (!result)
{ {
@@ -6019,7 +6010,7 @@ void ObjectMgr::LoadAccessRequirements()
if (ar.item) if (ar.item)
{ {
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ar.item); ItemTemplate const* pProto = GetItemTemplate(ar.item);
if (!pProto) if (!pProto)
{ {
sLog->outError("Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty); sLog->outError("Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty);
@@ -6029,7 +6020,7 @@ void ObjectMgr::LoadAccessRequirements()
if (ar.item2) if (ar.item2)
{ {
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ar.item2); ItemTemplate const* pProto = GetItemTemplate(ar.item2);
if (!pProto) if (!pProto)
{ {
sLog->outError("Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty); sLog->outError("Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty);
@@ -6136,10 +6127,10 @@ void ObjectMgr::SetHighestGuids()
_hiItemGuid = (*result)[0].GetUInt32()+1; _hiItemGuid = (*result)[0].GetUInt32()+1;
// Cleanup other tables from not existed guids ( >= _hiItemGuid) // Cleanup other tables from not existed guids ( >= _hiItemGuid)
CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", _hiItemGuid); // One-time query CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", _hiItemGuid);
CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", _hiItemGuid); // One-time query CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", _hiItemGuid);
CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); // One-time query CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid);
CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _hiItemGuid); // One-time query CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _hiItemGuid);
result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject"); result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject");
if (result) if (result)
@@ -6416,14 +6407,10 @@ void ObjectMgr::LoadGameObjectTemplate()
got.size = fields[9].GetFloat(); got.size = fields[9].GetFloat();
for (uint8 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i) for (uint8 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i)
{
got.questItems[i] = fields[10 + i].GetUInt32(); got.questItems[i] = fields[10 + i].GetUInt32();
}
for (uint8 i = 0; i < MAX_GAMEOBJECT_DATA; ++i) for (uint8 i = 0; i < MAX_GAMEOBJECT_DATA; ++i)
{
got.raw.data[i] = fields[16 + i].GetUInt32(); got.raw.data[i] = fields[16 + i].GetUInt32();
}
got.AIName = fields[40].GetString(); got.AIName = fields[40].GetString();
got.ScriptId = GetScriptId(fields[41].GetCString()); got.ScriptId = GetScriptId(fields[41].GetCString());
@@ -6432,28 +6419,28 @@ void ObjectMgr::LoadGameObjectTemplate()
switch (got.type) switch (got.type)
{ {
case GAMEOBJECT_TYPE_DOOR: //0 case GAMEOBJECT_TYPE_DOOR: //0
{ {
if (got.door.lockId) if (got.door.lockId)
CheckGOLockId(&got, got.door.lockId, 1); CheckGOLockId(&got, got.door.lockId, 1);
CheckGONoDamageImmuneId(&got, got.door.noDamageImmune, 3); CheckGONoDamageImmuneId(&got, got.door.noDamageImmune, 3);
break; break;
} }
case GAMEOBJECT_TYPE_BUTTON: //1 case GAMEOBJECT_TYPE_BUTTON: //1
{ {
if (got.button.lockId) if (got.button.lockId)
CheckGOLockId(&got, got.button.lockId, 1); CheckGOLockId(&got, got.button.lockId, 1);
CheckGONoDamageImmuneId(&got, got.button.noDamageImmune, 4); CheckGONoDamageImmuneId(&got, got.button.noDamageImmune, 4);
break; break;
} }
case GAMEOBJECT_TYPE_QUESTGIVER: //2 case GAMEOBJECT_TYPE_QUESTGIVER: //2
{ {
if (got.questgiver.lockId) if (got.questgiver.lockId)
CheckGOLockId(&got, got.questgiver.lockId, 0); CheckGOLockId(&got, got.questgiver.lockId, 0);
CheckGONoDamageImmuneId(&got, got.questgiver.noDamageImmune, 5); CheckGONoDamageImmuneId(&got, got.questgiver.noDamageImmune, 5);
break; break;
} }
case GAMEOBJECT_TYPE_CHEST: //3 case GAMEOBJECT_TYPE_CHEST: //3
{ {
if (got.chest.lockId) if (got.chest.lockId)
CheckGOLockId(&got, got.chest.lockId, 0); CheckGOLockId(&got, got.chest.lockId, 0);
@@ -6464,16 +6451,16 @@ void ObjectMgr::LoadGameObjectTemplate()
CheckGOLinkedTrapId(&got, got.chest.linkedTrapId, 7); CheckGOLinkedTrapId(&got, got.chest.linkedTrapId, 7);
break; break;
} }
case GAMEOBJECT_TYPE_TRAP: //6 case GAMEOBJECT_TYPE_TRAP: //6
{ {
if (got.trap.lockId) if (got.trap.lockId)
CheckGOLockId(&got, got.trap.lockId, 0); CheckGOLockId(&got, got.trap.lockId, 0);
break; break;
} }
case GAMEOBJECT_TYPE_CHAIR: //7 case GAMEOBJECT_TYPE_CHAIR: //7
CheckAndFixGOChairHeightId(&got, got.chair.height, 1); CheckAndFixGOChairHeightId(&got, got.chair.height, 1);
break; break;
case GAMEOBJECT_TYPE_SPELL_FOCUS: //8 case GAMEOBJECT_TYPE_SPELL_FOCUS: //8
{ {
if (got.spellFocus.focusId) if (got.spellFocus.focusId)
{ {
@@ -6486,7 +6473,7 @@ void ObjectMgr::LoadGameObjectTemplate()
CheckGOLinkedTrapId(&got, got.spellFocus.linkedTrapId, 2); CheckGOLinkedTrapId(&got, got.spellFocus.linkedTrapId, 2);
break; break;
} }
case GAMEOBJECT_TYPE_GOOBER: //10 case GAMEOBJECT_TYPE_GOOBER: //10
{ {
if (got.goober.lockId) if (got.goober.lockId)
CheckGOLockId(&got, got.goober.lockId, 0); CheckGOLockId(&got, got.goober.lockId, 0);
@@ -6504,19 +6491,19 @@ void ObjectMgr::LoadGameObjectTemplate()
CheckGOLinkedTrapId(&got, got.goober.linkedTrapId, 12); CheckGOLinkedTrapId(&got, got.goober.linkedTrapId, 12);
break; break;
} }
case GAMEOBJECT_TYPE_AREADAMAGE: //12 case GAMEOBJECT_TYPE_AREADAMAGE: //12
{ {
if (got.areadamage.lockId) if (got.areadamage.lockId)
CheckGOLockId(&got, got.areadamage.lockId, 0); CheckGOLockId(&got, got.areadamage.lockId, 0);
break; break;
} }
case GAMEOBJECT_TYPE_CAMERA: //13 case GAMEOBJECT_TYPE_CAMERA: //13
{ {
if (got.camera.lockId) if (got.camera.lockId)
CheckGOLockId(&got, got.camera.lockId, 0); CheckGOLockId(&got, got.camera.lockId, 0);
break; break;
} }
case GAMEOBJECT_TYPE_MO_TRANSPORT: //15 case GAMEOBJECT_TYPE_MO_TRANSPORT: //15
{ {
if (got.moTransport.taxiPathId) if (got.moTransport.taxiPathId)
{ {
@@ -6526,37 +6513,37 @@ void ObjectMgr::LoadGameObjectTemplate()
} }
break; break;
} }
case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18
break; break;
case GAMEOBJECT_TYPE_SPELLCASTER: //22 case GAMEOBJECT_TYPE_SPELLCASTER: //22
{ {
// always must have spell // always must have spell
CheckGOSpellId(&got, got.spellcaster.spellId, 0); CheckGOSpellId(&got, got.spellcaster.spellId, 0);
break; break;
} }
case GAMEOBJECT_TYPE_FLAGSTAND: //24 case GAMEOBJECT_TYPE_FLAGSTAND: //24
{ {
if (got.flagstand.lockId) if (got.flagstand.lockId)
CheckGOLockId(&got, got.flagstand.lockId, 0); CheckGOLockId(&got, got.flagstand.lockId, 0);
CheckGONoDamageImmuneId(&got, got.flagstand.noDamageImmune, 5); CheckGONoDamageImmuneId(&got, got.flagstand.noDamageImmune, 5);
break; break;
} }
case GAMEOBJECT_TYPE_FISHINGHOLE: //25 case GAMEOBJECT_TYPE_FISHINGHOLE: //25
{ {
if (got.fishinghole.lockId) if (got.fishinghole.lockId)
CheckGOLockId(&got, got.fishinghole.lockId, 4); CheckGOLockId(&got, got.fishinghole.lockId, 4);
break; break;
} }
case GAMEOBJECT_TYPE_FLAGDROP: //26 case GAMEOBJECT_TYPE_FLAGDROP: //26
{ {
if (got.flagdrop.lockId) if (got.flagdrop.lockId)
CheckGOLockId(&got, got.flagdrop.lockId, 0); CheckGOLockId(&got, got.flagdrop.lockId, 0);
CheckGONoDamageImmuneId(&got, got.flagdrop.noDamageImmune, 3); CheckGONoDamageImmuneId(&got, got.flagdrop.noDamageImmune, 3);
break; break;
} }
case GAMEOBJECT_TYPE_BARBER_CHAIR: //32 case GAMEOBJECT_TYPE_BARBER_CHAIR: //32
CheckAndFixGOChairHeightId(&got, got.barberChair.chairheight, 0); CheckAndFixGOChairHeightId(&got, got.barberChair.chairheight, 0);
break; break;
} }
++count; ++count;
@@ -6584,7 +6571,6 @@ void ObjectMgr::LoadExplorationBaseXP()
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
uint8 level = fields[0].GetUInt8(); uint8 level = fields[0].GetUInt8();
uint32 basexp = fields[1].GetUInt32(); uint32 basexp = fields[1].GetUInt32();
@@ -6626,7 +6612,6 @@ void ObjectMgr::LoadPetNames()
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
std::string word = fields[0].GetString(); std::string word = fields[0].GetString();
uint32 entry = fields[1].GetUInt32(); uint32 entry = fields[1].GetUInt32();
@@ -6739,7 +6724,6 @@ void ObjectMgr::LoadReputationRewardRate()
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
uint32 factionId = fields[0].GetUInt32(); uint32 factionId = fields[0].GetUInt32();
@@ -6877,7 +6861,6 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
uint32 factionId = fields[0].GetUInt32(); uint32 factionId = fields[0].GetUInt32();
@@ -6997,12 +6980,12 @@ void ObjectMgr::LoadPointsOfInterest()
uint32 point_id = fields[0].GetUInt32(); uint32 point_id = fields[0].GetUInt32();
PointOfInterest POI; PointOfInterest POI;
POI.x = fields[1].GetFloat(); POI.x = fields[1].GetFloat();
POI.y = fields[2].GetFloat(); POI.y = fields[2].GetFloat();
POI.icon = fields[3].GetUInt32(); POI.icon = fields[3].GetUInt32();
POI.flags = fields[4].GetUInt32(); POI.flags = fields[4].GetUInt32();
POI.data = fields[5].GetUInt32(); POI.data = fields[5].GetUInt32();
POI.icon_name = fields[6].GetString(); POI.icon_name = fields[6].GetString();
if (!Trinity::IsValidMapCoord(POI.x, POI.y)) if (!Trinity::IsValidMapCoord(POI.x, POI.y))
{ {
@@ -7051,7 +7034,6 @@ void ObjectMgr::LoadQuestPOI()
do do
{ {
fields = points->Fetch(); fields = points->Fetch();
uint32 questId = fields[0].GetUInt32(); uint32 questId = fields[0].GetUInt32();
@@ -7176,7 +7158,7 @@ void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t
_creatureRespawnTimesMutex.release(); _creatureRespawnTimesMutex.release();
} }
PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN);
stmt->setUInt32(0, loguid); stmt->setUInt32(0, loguid);
stmt->setUInt64(1, uint64(t)); stmt->setUInt64(1, uint64(t));
stmt->setUInt32(2, instance); stmt->setUInt32(2, instance);
@@ -7330,7 +7312,6 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table,
do do
{ {
uint32 id = result->Fetch()[0].GetUInt32(); uint32 id = result->Fetch()[0].GetUInt32();
uint32 quest = result->Fetch()[1].GetUInt32(); uint32 quest = result->Fetch()[1].GetUInt32();
uint32 poolId = result->Fetch()[2].GetUInt32(); uint32 poolId = result->Fetch()[2].GetUInt32();
@@ -7653,7 +7634,7 @@ void ObjectMgr::LoadGameObjectForQuests()
sLog->outString(); sLog->outString();
} }
bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max_value) bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value)
{ {
uint32 oldMSTime = getMSTime(); uint32 oldMSTime = getMSTime();
@@ -7695,7 +7676,6 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max
if (!result) if (!result)
{ {
if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings
sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table); sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table);
else else
@@ -7783,7 +7763,6 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32(); uint32 entry = fields[0].GetUInt32();
int32 skill = fields[1].GetInt32(); int32 skill = fields[1].GetInt32();
@@ -7813,7 +7792,7 @@ bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& n
bool y = true; bool y = true;
// check declined names // check declined names
for (uint8 i =0; i < MAX_DECLINED_NAME_CASES; ++i) for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
{ {
std::wstring wname; std::wstring wname;
if (!Utf8toWStr(names.name[i], wname)) if (!Utf8toWStr(names.name[i], wname))
@@ -7892,7 +7871,6 @@ void ObjectMgr::LoadGameTele()
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
uint32 id = fields[0].GetUInt32(); uint32 id = fields[0].GetUInt32();
@@ -7935,7 +7913,7 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
// explicit name case // explicit name case
std::wstring wname; std::wstring wname;
if (!Utf8toWStr(name, wname)) if (!Utf8toWStr(name, wname))
return false; return NULL;
// converting string that we try to find to lower case // converting string that we try to find to lower case
wstrToLower(wname); wstrToLower(wname);
@@ -8033,7 +8011,6 @@ void ObjectMgr::LoadMailLevelRewards()
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
uint8 level = fields[0].GetUInt8(); uint8 level = fields[0].GetUInt8();
@@ -8177,7 +8154,6 @@ void ObjectMgr::LoadTrainerSpell()
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32(); uint32 entry = fields[0].GetUInt32();
@@ -8189,8 +8165,7 @@ void ObjectMgr::LoadTrainerSpell()
AddSpellToTrainer(entry, spell, spellCost, reqSkill, reqSkillValue, reqLevel); AddSpellToTrainer(entry, spell, spellCost, reqSkill, reqSkillValue, reqLevel);
count++; ++count;
} }
while (result->NextRow()); while (result->NextRow());
@@ -8229,7 +8204,6 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *s
vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); vList.AddItem(item_id, maxcount, incrtime, ExtendedCost);
++count; ++count;
} }
} while (result->NextRow()); } while (result->NextRow());
return count; return count;
@@ -8280,7 +8254,6 @@ void ObjectMgr::LoadVendors()
vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); vList.AddItem(item_id, maxcount, incrtime, ExtendedCost);
++count; ++count;
} }
} }
while (result->NextRow()); while (result->NextRow());
@@ -8307,7 +8280,6 @@ void ObjectMgr::LoadGossipMenu()
do do
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
GossipMenus gMenu; GossipMenus gMenu;
@@ -8626,7 +8598,7 @@ void ObjectMgr::LoadDbScriptStrings()
sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr); sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr);
} }
bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value) bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value)
{ {
// MAX_DB_SCRIPT_STRING_ID is max allowed negative value for scripts (scrpts can use only more deep negative values // MAX_DB_SCRIPT_STRING_ID is max allowed negative value for scripts (scrpts can use only more deep negative values
// start/end reversed for negative values // start/end reversed for negative values
+2 -3
View File
@@ -385,7 +385,6 @@ struct TrinityStringLocale
StringVector Content; StringVector Content;
}; };
typedef std::map<uint64, uint64> LinkedRespawnContainer; typedef std::map<uint64, uint64> LinkedRespawnContainer;
typedef UNORDERED_MAP<uint32, CreatureData> CreatureDataContainer; typedef UNORDERED_MAP<uint32, CreatureData> CreatureDataContainer;
typedef UNORDERED_MAP<uint32, GameObjectData> GameObjectDataContainer; typedef UNORDERED_MAP<uint32, GameObjectData> GameObjectDataContainer;
@@ -527,6 +526,7 @@ struct GraveYardData
uint32 safeLocId; uint32 safeLocId;
uint32 team; uint32 team;
}; };
typedef std::multimap<uint32, GraveYardData> GraveYardContainer; typedef std::multimap<uint32, GraveYardData> GraveYardContainer;
typedef UNORDERED_MAP<uint32, VendorItemData> CacheVendorItemContainer; typedef UNORDERED_MAP<uint32, VendorItemData> CacheVendorItemContainer;
@@ -641,7 +641,7 @@ class ObjectMgr
return NULL; return NULL;
} }
InstanceTemplate const* GetInstanceTemplate(uint32 mapID); InstanceTemplate const* GetInstanceTemplate(uint32 mapId);
PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const; PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const;
@@ -1334,7 +1334,6 @@ class ObjectMgr
GO_TO_GO, GO_TO_GO,
GO_TO_CREATURE, // GO is dependant on creature GO_TO_CREATURE, // GO is dependant on creature
}; };
}; };
#define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance() #define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance()
+1 -1
View File
@@ -227,7 +227,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData)
uint32 unkPackedTime; uint32 unkPackedTime;
uint32 flags; uint32 flags;
uint64 inviteId = 0; uint64 inviteId = 0;
uint64 invitee; uint64 invitee = 0;
uint8 status; uint8 status;
uint8 rank; uint8 rank;
+2 -2
View File
@@ -203,7 +203,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData)
_warden->DecryptData(const_cast<uint8*>(recvData.contents()), recvData.size()); _warden->DecryptData(const_cast<uint8*>(recvData.contents()), recvData.size());
uint8 opcode; uint8 opcode;
recvData >> opcode; recvData >> opcode;
sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, recvData.size()); sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size()));
recvData.hexlike(); recvData.hexlike();
switch(opcode) switch(opcode)
@@ -228,7 +228,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData)
sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MODULE_FAILED received!"); sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MODULE_FAILED received!");
break; break;
default: default:
sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, recvData.size() - 1); sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, uint32(recvData.size() - 1));
break; break;
} }
} }