From adc115dc41a7af07ab27f35db674568fd88d05db Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Feb 2012 15:56:53 +0100 Subject: Core/Vmaps: Fixed errors during loading gameobject models and improved error output (will now write to logs) --- src/server/collision/Models/GameObjectModel.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/server/collision/Models/GameObjectModel.cpp') diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 1abbc59a5b0..c0bcdd1e782 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -33,6 +33,8 @@ using G3D::Vector3; using G3D::Ray; using G3D::AABox; +#ifndef NO_CORE_FUNCS + struct GameobjectModelData { GameobjectModelData(const std::string& name_, const AABox& box) : @@ -47,23 +49,30 @@ ModelList model_list; void LoadGameObjectModelList() { + uint32 oldMSTime = getMSTime(); FILE* model_list_file = fopen((sWorld->GetDataPath() + "vmaps/" + VMAP::GAMEOBJECT_MODELS).c_str(), "rb"); if (!model_list_file) + { + sLog->outError("Unable to open '%s' file.", VMAP::GAMEOBJECT_MODELS); return; + } uint32 name_length, displayId; char buff[500]; - while (!feof(model_list_file)) + while (true) { Vector3 v1, v2; - if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1 - || fread(&name_length, sizeof(uint32), 1, model_list_file) != 1 + if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1) + if (feof(model_list_file)) // EOF flag is only set after failed reading attempt + break; + + if (fread(&name_length, sizeof(uint32), 1, model_list_file) != 1 || name_length >= sizeof(buff) || fread(&buff, sizeof(char), name_length, model_list_file) != name_length || fread(&v1, sizeof(Vector3), 1, model_list_file) != 1 || fread(&v2, sizeof(Vector3), 1, model_list_file) != 1) { - printf("\nFile '%s' seems to be corrupted", VMAP::GAMEOBJECT_MODELS); + sLog->outError("File '%s' seems to be corrupted!", VMAP::GAMEOBJECT_MODELS); break; } @@ -72,7 +81,10 @@ void LoadGameObjectModelList() ModelList::value_type( displayId, GameobjectModelData(std::string(buff,name_length),AABox(v1,v2)) ) ); } + fclose(model_list_file); + sLog->outString(">> Loaded %d GameObject models in %u ms", model_list.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } GameObjectModel::~GameObjectModel() @@ -91,7 +103,7 @@ bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayIn // ignore models with no bounds if (mdl_box == G3D::AABox::zero()) { - std::cout << "Model " << it->second.name << " has zero bounds, loading skipped" << std::endl; + sLog->outError("GameObject model %s has zero bounds, loading skipped", it->second.name); return false; } @@ -171,3 +183,5 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto } return hit; } + +#endif -- cgit v1.2.3 From 8ae3037307c9ca2ebc17fae286f59b51bc4b1c79 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Feb 2012 16:14:50 +0100 Subject: Compile fix for gcc 4.5 and higher --- src/server/collision/Models/GameObjectModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/collision/Models/GameObjectModel.cpp') diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index c0bcdd1e782..1c3a0aa639e 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -83,7 +83,7 @@ void LoadGameObjectModelList() } fclose(model_list_file); - sLog->outString(">> Loaded %d GameObject models in %u ms", model_list.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u GameObject models in %u ms", model_list.size(), GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -103,7 +103,7 @@ bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayIn // ignore models with no bounds if (mdl_box == G3D::AABox::zero()) { - sLog->outError("GameObject model %s has zero bounds, loading skipped", it->second.name); + sLog->outError("GameObject model %s has zero bounds, loading skipped", it->second.name.c_str()); return false; } -- cgit v1.2.3 From 3e622ee7ac36de3a1e137c12b03417c3880ba342 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 27 Feb 2012 11:08:34 +0100 Subject: Core: Minor cleanup in ObjectMgr and warning fixes --- src/server/collision/Models/GameObjectModel.cpp | 2 +- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 1 - src/server/game/Calendar/CalendarMgr.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 160 +++++++++------------ src/server/game/Globals/ObjectMgr.h | 5 +- src/server/game/Handlers/CalendarHandler.cpp | 2 +- src/server/game/Warden/Warden.cpp | 4 +- 7 files changed, 73 insertions(+), 103 deletions(-) (limited to 'src/server/collision/Models/GameObjectModel.cpp') diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 1c3a0aa639e..84c736c22e8 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -83,7 +83,7 @@ void LoadGameObjectModelList() } 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(); } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 4105012ac86..3fc3f233b4b 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -48,7 +48,6 @@ void SmartWaypointMgr::LoadFromDB() uint32 count = 0; uint32 total = 0; - WPPath* path = NULL; uint32 last_entry = 0; uint32 last_id = 1; diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index ea420d88516..b286abba81e 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -309,7 +309,7 @@ void CalendarMgr::AddAction(CalendarAction const& action) case CALENDAR_ACTION_REMOVE_EVENT: { uint64 eventId = action.Event.GetEventId(); - uint32 flags = action.Event.GetFlags(); + //uint32 flags = action.Event.GetFlags(); // FIXME - Use of Flags here! CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f31ce74d896..7834a1cc4a3 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -701,7 +701,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) else if (!displayScaleEntry) displayScaleEntry = displayEntry; - CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2);; + CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2); if (!modelInfo) 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) displayScaleEntry = displayEntry; - CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4);; + CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4); if (!modelInfo) 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]) continue; - ItemEntry const* dbcItem = sItemStore.LookupEntry(equipmentInfo.ItemEntry[i]); + ItemEntry const* dbcItem = sItemStore.LookupEntry(equipmentInfo.ItemEntry[i]); if (!dbcItem) { @@ -1071,25 +1071,25 @@ void ObjectMgr::ChooseCreatureFlags(const CreatureTemplate* cinfo, uint32& npcfl CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* displayID) { - CreatureModelInfo const* minfo = GetCreatureModelInfo(*displayID); - if (!minfo) + CreatureModelInfo const* modelInfo = GetCreatureModelInfo(*displayID); + if (!modelInfo) return NULL; // 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) - 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 { // Model ID changed - *displayID = minfo->modelid_other_gender; + *displayID = modelInfo->modelid_other_gender; return minfo_tmp; } } - return minfo; + return modelInfo; } void ObjectMgr::LoadCreatureModelInfo() @@ -1327,7 +1327,6 @@ void ObjectMgr::LoadLinkedRespawn() if (!error) _linkedRespawnStore[guid] = linkedGuid; - } while (result->NextRow()); @@ -1381,9 +1380,9 @@ void ObjectMgr::LoadCreatures() { 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, " - // 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 " "FROM creature " "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 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 " "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"); @@ -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 AddGameobjectToGrid(guid, &data); ++count; - } while (result->NextRow()); 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]; - if (!sObjectMgr->GetItemTemplate(item_id)) + if (!GetItemTemplate(item_id)) notFoundOutfit.insert(item_id); } } @@ -3131,7 +3129,7 @@ void ObjectMgr::LoadPlayerInfo() 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); continue; @@ -3694,7 +3692,7 @@ void ObjectMgr::LoadQuests() { Field* fields = result->Fetch(); - Quest * newQuest = new Quest(fields); + Quest* newQuest = new Quest(fields); _questTemplates[newQuest->GetQuestId()] = newQuest; } while (result->NextRow()); @@ -3712,9 +3710,7 @@ void ObjectMgr::LoadQuests() // additional quest integrity checks (GO, creature_template and item_template must be loaded already) if (qinfo->GetQuestMethod() >= 3) - { 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) { @@ -4401,7 +4397,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) do { - Field* fields = result->Fetch(); ScriptInfo tmp; tmp.type = type; @@ -4810,8 +4805,8 @@ void ObjectMgr::LoadWaypointScripts() uint32 action = fields[0].GetUInt32(); actionSet.erase(action); - - } while (result->NextRow()); + } + while (result->NextRow()); } for (std::set::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr) @@ -5164,7 +5159,6 @@ void ObjectMgr::LoadGossipText() int count = 0; if (!result) { - sLog->outString(">> Loaded %u npc texts", count); sLog->outString(); return; @@ -5299,7 +5293,6 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) uint32 returnedCount = 0; do { - Field* fields = result->Fetch(); Mail* m = new Mail; 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 - sObjectMgr->GetCreatureModelRandomGender(&mount_id); + GetCreatureModelRandomGender(&mount_id); return mount_id; } @@ -5766,10 +5759,10 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float if (MapId != entry->map_id) { // if find graveyard at different map from where entrance placed (or no entrance data), use any first - if (!mapEntry || - mapEntry->entrance_map < 0 || - uint32(mapEntry->entrance_map) != entry->map_id || - (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) + if (!mapEntry + || mapEntry->entrance_map < 0 + || uint32(mapEntry->entrance_map) != entry->map_id + || (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) { // not have any corrdinates for check distance anyway entryFar = entry; @@ -5914,8 +5907,6 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool WorldDatabase.Execute(stmt); } - - return; } void ObjectMgr::LoadAreaTriggerTeleports() @@ -5985,7 +5976,7 @@ void ObjectMgr::LoadAccessRequirements() _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"); if (!result) { @@ -6019,7 +6010,7 @@ void ObjectMgr::LoadAccessRequirements() if (ar.item) { - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ar.item); + ItemTemplate const* pProto = GetItemTemplate(ar.item); if (!pProto) { 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) { - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ar.item2); + ItemTemplate const* pProto = GetItemTemplate(ar.item2); if (!pProto) { 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; // 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 mail_items WHERE item_guid >= '%u'", _hiItemGuid); // One-time query - CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); // One-time query - CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%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); + CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); + CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _hiItemGuid); result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject"); if (result) @@ -6416,14 +6407,10 @@ void ObjectMgr::LoadGameObjectTemplate() got.size = fields[9].GetFloat(); for (uint8 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i) - { got.questItems[i] = fields[10 + i].GetUInt32(); - } for (uint8 i = 0; i < MAX_GAMEOBJECT_DATA; ++i) - { got.raw.data[i] = fields[16 + i].GetUInt32(); - } got.AIName = fields[40].GetString(); got.ScriptId = GetScriptId(fields[41].GetCString()); @@ -6432,28 +6419,28 @@ void ObjectMgr::LoadGameObjectTemplate() switch (got.type) { - case GAMEOBJECT_TYPE_DOOR: //0 + case GAMEOBJECT_TYPE_DOOR: //0 { if (got.door.lockId) CheckGOLockId(&got, got.door.lockId, 1); - CheckGONoDamageImmuneId(&got, got.door.noDamageImmune, 3); + CheckGONoDamageImmuneId(&got, got.door.noDamageImmune, 3); break; } - case GAMEOBJECT_TYPE_BUTTON: //1 + case GAMEOBJECT_TYPE_BUTTON: //1 { if (got.button.lockId) - CheckGOLockId(&got, got.button.lockId, 1); + CheckGOLockId(&got, got.button.lockId, 1); CheckGONoDamageImmuneId(&got, got.button.noDamageImmune, 4); break; } - case GAMEOBJECT_TYPE_QUESTGIVER: //2 + case GAMEOBJECT_TYPE_QUESTGIVER: //2 { if (got.questgiver.lockId) CheckGOLockId(&got, got.questgiver.lockId, 0); CheckGONoDamageImmuneId(&got, got.questgiver.noDamageImmune, 5); break; } - case GAMEOBJECT_TYPE_CHEST: //3 + case GAMEOBJECT_TYPE_CHEST: //3 { if (got.chest.lockId) CheckGOLockId(&got, got.chest.lockId, 0); @@ -6464,16 +6451,16 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLinkedTrapId(&got, got.chest.linkedTrapId, 7); break; } - case GAMEOBJECT_TYPE_TRAP: //6 + case GAMEOBJECT_TYPE_TRAP: //6 { if (got.trap.lockId) CheckGOLockId(&got, got.trap.lockId, 0); break; } - case GAMEOBJECT_TYPE_CHAIR: //7 - CheckAndFixGOChairHeightId(&got, got.chair.height, 1); - break; - case GAMEOBJECT_TYPE_SPELL_FOCUS: //8 + case GAMEOBJECT_TYPE_CHAIR: //7 + CheckAndFixGOChairHeightId(&got, got.chair.height, 1); + break; + case GAMEOBJECT_TYPE_SPELL_FOCUS: //8 { if (got.spellFocus.focusId) { @@ -6486,7 +6473,7 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLinkedTrapId(&got, got.spellFocus.linkedTrapId, 2); break; } - case GAMEOBJECT_TYPE_GOOBER: //10 + case GAMEOBJECT_TYPE_GOOBER: //10 { if (got.goober.lockId) CheckGOLockId(&got, got.goober.lockId, 0); @@ -6504,19 +6491,19 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLinkedTrapId(&got, got.goober.linkedTrapId, 12); break; } - case GAMEOBJECT_TYPE_AREADAMAGE: //12 + case GAMEOBJECT_TYPE_AREADAMAGE: //12 { if (got.areadamage.lockId) CheckGOLockId(&got, got.areadamage.lockId, 0); break; } - case GAMEOBJECT_TYPE_CAMERA: //13 + case GAMEOBJECT_TYPE_CAMERA: //13 { if (got.camera.lockId) CheckGOLockId(&got, got.camera.lockId, 0); break; } - case GAMEOBJECT_TYPE_MO_TRANSPORT: //15 + case GAMEOBJECT_TYPE_MO_TRANSPORT: //15 { if (got.moTransport.taxiPathId) { @@ -6526,37 +6513,37 @@ void ObjectMgr::LoadGameObjectTemplate() } break; } - case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 - break; - case GAMEOBJECT_TYPE_SPELLCASTER: //22 + case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 + break; + case GAMEOBJECT_TYPE_SPELLCASTER: //22 { // always must have spell CheckGOSpellId(&got, got.spellcaster.spellId, 0); break; } - case GAMEOBJECT_TYPE_FLAGSTAND: //24 + case GAMEOBJECT_TYPE_FLAGSTAND: //24 { if (got.flagstand.lockId) CheckGOLockId(&got, got.flagstand.lockId, 0); CheckGONoDamageImmuneId(&got, got.flagstand.noDamageImmune, 5); break; } - case GAMEOBJECT_TYPE_FISHINGHOLE: //25 + case GAMEOBJECT_TYPE_FISHINGHOLE: //25 { if (got.fishinghole.lockId) CheckGOLockId(&got, got.fishinghole.lockId, 4); break; } - case GAMEOBJECT_TYPE_FLAGDROP: //26 + case GAMEOBJECT_TYPE_FLAGDROP: //26 { if (got.flagdrop.lockId) CheckGOLockId(&got, got.flagdrop.lockId, 0); CheckGONoDamageImmuneId(&got, got.flagdrop.noDamageImmune, 3); break; } - case GAMEOBJECT_TYPE_BARBER_CHAIR: //32 - CheckAndFixGOChairHeightId(&got, got.barberChair.chairheight, 0); - break; + case GAMEOBJECT_TYPE_BARBER_CHAIR: //32 + CheckAndFixGOChairHeightId(&got, got.barberChair.chairheight, 0); + break; } ++count; @@ -6584,7 +6571,6 @@ void ObjectMgr::LoadExplorationBaseXP() do { - Field* fields = result->Fetch(); uint8 level = fields[0].GetUInt8(); uint32 basexp = fields[1].GetUInt32(); @@ -6626,7 +6612,6 @@ void ObjectMgr::LoadPetNames() do { - Field* fields = result->Fetch(); std::string word = fields[0].GetString(); uint32 entry = fields[1].GetUInt32(); @@ -6739,7 +6724,6 @@ void ObjectMgr::LoadReputationRewardRate() do { - Field* fields = result->Fetch(); uint32 factionId = fields[0].GetUInt32(); @@ -6877,7 +6861,6 @@ void ObjectMgr::LoadReputationSpilloverTemplate() do { - Field* fields = result->Fetch(); uint32 factionId = fields[0].GetUInt32(); @@ -6997,12 +6980,12 @@ void ObjectMgr::LoadPointsOfInterest() uint32 point_id = fields[0].GetUInt32(); PointOfInterest POI; - POI.x = fields[1].GetFloat(); - POI.y = fields[2].GetFloat(); - POI.icon = fields[3].GetUInt32(); - POI.flags = fields[4].GetUInt32(); - POI.data = fields[5].GetUInt32(); - POI.icon_name = fields[6].GetString(); + POI.x = fields[1].GetFloat(); + POI.y = fields[2].GetFloat(); + POI.icon = fields[3].GetUInt32(); + POI.flags = fields[4].GetUInt32(); + POI.data = fields[5].GetUInt32(); + POI.icon_name = fields[6].GetString(); if (!Trinity::IsValidMapCoord(POI.x, POI.y)) { @@ -7051,7 +7034,6 @@ void ObjectMgr::LoadQuestPOI() do { - fields = points->Fetch(); uint32 questId = fields[0].GetUInt32(); @@ -7176,7 +7158,7 @@ void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t _creatureRespawnTimesMutex.release(); } - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); stmt->setUInt32(0, loguid); stmt->setUInt64(1, uint64(t)); stmt->setUInt32(2, instance); @@ -7330,7 +7312,6 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, do { - uint32 id = result->Fetch()[0].GetUInt32(); uint32 quest = result->Fetch()[1].GetUInt32(); uint32 poolId = result->Fetch()[2].GetUInt32(); @@ -7653,7 +7634,7 @@ void ObjectMgr::LoadGameObjectForQuests() 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(); @@ -7695,7 +7676,6 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max if (!result) { - 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); else @@ -7783,7 +7763,6 @@ void ObjectMgr::LoadFishingBaseSkillLevel() do { - Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); int32 skill = fields[1].GetInt32(); @@ -7813,7 +7792,7 @@ bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& n bool y = true; // 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; if (!Utf8toWStr(names.name[i], wname)) @@ -7892,7 +7871,6 @@ void ObjectMgr::LoadGameTele() do { - Field* fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); @@ -7935,7 +7913,7 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const // explicit name case std::wstring wname; if (!Utf8toWStr(name, wname)) - return false; + return NULL; // converting string that we try to find to lower case wstrToLower(wname); @@ -8033,7 +8011,6 @@ void ObjectMgr::LoadMailLevelRewards() do { - Field* fields = result->Fetch(); uint8 level = fields[0].GetUInt8(); @@ -8177,7 +8154,6 @@ void ObjectMgr::LoadTrainerSpell() do { - Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); @@ -8189,8 +8165,7 @@ void ObjectMgr::LoadTrainerSpell() AddSpellToTrainer(entry, spell, spellCost, reqSkill, reqSkillValue, reqLevel); - count++; - + ++count; } while (result->NextRow()); @@ -8229,7 +8204,6 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *s vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); ++count; } - } while (result->NextRow()); return count; @@ -8280,7 +8254,6 @@ void ObjectMgr::LoadVendors() vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); ++count; } - } while (result->NextRow()); @@ -8307,7 +8280,6 @@ void ObjectMgr::LoadGossipMenu() do { - Field* fields = result->Fetch(); GossipMenus gMenu; @@ -8626,7 +8598,7 @@ void ObjectMgr::LoadDbScriptStrings() 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 // start/end reversed for negative values diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 1172f04241d..0f2b2382007 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -385,7 +385,6 @@ struct TrinityStringLocale StringVector Content; }; - typedef std::map LinkedRespawnContainer; typedef UNORDERED_MAP CreatureDataContainer; typedef UNORDERED_MAP GameObjectDataContainer; @@ -527,6 +526,7 @@ struct GraveYardData uint32 safeLocId; uint32 team; }; + typedef std::multimap GraveYardContainer; typedef UNORDERED_MAP CacheVendorItemContainer; @@ -641,7 +641,7 @@ class ObjectMgr return NULL; } - InstanceTemplate const* GetInstanceTemplate(uint32 mapID); + InstanceTemplate const* GetInstanceTemplate(uint32 mapId); PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const; @@ -1334,7 +1334,6 @@ class ObjectMgr GO_TO_GO, GO_TO_CREATURE, // GO is dependant on creature }; - }; #define sObjectMgr ACE_Singleton::instance() diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 467a84be186..c9e99af6fed 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -227,7 +227,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData) uint32 unkPackedTime; uint32 flags; uint64 inviteId = 0; - uint64 invitee; + uint64 invitee = 0; uint8 status; uint8 rank; diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index 3d625df63d0..f2fe3c4ad67 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -203,7 +203,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) _warden->DecryptData(const_cast(recvData.contents()), recvData.size()); uint8 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(); switch(opcode) @@ -228,7 +228,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MODULE_FAILED received!"); break; 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; } } -- cgit v1.2.3 From c8d20004a50d823c7acc4de97266615827af29f7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 30 Jun 2012 16:07:09 +0200 Subject: Core: Minor code style corrections --- src/server/collision/Models/GameObjectModel.cpp | 2 +- src/server/collision/RegularGrid.h | 2 +- src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 2 +- .../game/Movement/Spline/MovementPacketBuilder.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/Spell.cpp | 16 ++++----- src/server/game/Spells/SpellScript.cpp | 8 ++--- src/server/game/Warden/Warden.cpp | 2 +- src/server/game/Warden/WardenCheckMgr.cpp | 2 +- src/server/game/Warden/WardenMac.cpp | 4 +-- src/server/game/Warden/WardenWin.cpp | 4 +-- .../BlackrockSpire/boss_pyroguard_emberseer.cpp | 2 +- .../Northrend/IcecrownCitadel/boss_rotface.cpp | 2 +- .../IcecrownCitadel/boss_valithria_dreamwalker.cpp | 4 +-- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../scripts/Outland/blades_edge_mountains.cpp | 2 +- .../shared/Cryptography/WardenKeyGeneration.h | 42 ++++++++++++---------- src/server/shared/Database/PreparedStatement.cpp | 2 +- 19 files changed, 55 insertions(+), 49 deletions(-) (limited to 'src/server/collision/Models/GameObjectModel.cpp') diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 84c736c22e8..8b63620e783 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -176,7 +176,7 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto Ray modRay(p, iInvRot * ray.direction()); float distance = MaxDist * iInvScale; bool hit = iModel->IntersectRay(modRay, distance, StopAtFirstHit); - if(hit) + if (hit) { distance *= iScale; MaxDist = distance; diff --git a/src/server/collision/RegularGrid.h b/src/server/collision/RegularGrid.h index 2867b29cfc1..00d7b0cd209 100644 --- a/src/server/collision/RegularGrid.h +++ b/src/server/collision/RegularGrid.h @@ -176,7 +176,7 @@ public: } if (cell == last_cell) break; - if(tMaxX < tMaxY) + if (tMaxX < tMaxY) { tMaxX += tDeltaX; cell.x += stepX; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 4176d9f605b..9f534ab697d 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -441,7 +441,7 @@ uint32 Condition::GetSearcherTypeMaskForCondition() uint32 Condition::GetMaxAvailableConditionTargets() { // returns number of targets which are available for given source type - switch(SourceType) + switch (SourceType) { case CONDITION_SOURCE_TYPE_SPELL: case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET: diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index d26f275b864..3aee9ff0b00 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -161,7 +161,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) etime *= MINUTE; - switch(etime) + switch (etime) { case 1*MIN_AUCTION_TIME: case 2*MIN_AUCTION_TIME: diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 16f06a25058..8aef671d2d1 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -49,7 +49,7 @@ namespace Movement data << move_spline.spline.getPoint(move_spline.spline.first()); data << move_spline.GetId(); - switch(splineflags & MoveSplineFlag::Mask_Final_Facing) + switch (splineflags & MoveSplineFlag::Mask_Final_Facing) { case MoveSplineFlag::Final_Target: data << uint8(MonsterMoveFacingTarget); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index ac51fff81f6..a4acff2a47c 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5083,7 +5083,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool break; case SPELLFAMILY_ROGUE: // Tricks of the trade - switch(GetId()) + switch (GetId()) { case 59628: //Tricks of the trade buff on rogue (6sec duration) target->SetReducedThreatPercent(0,0); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e9ae93751b8..33ecd66e8f6 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -827,7 +827,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar break; } - switch(targetType.GetSelectionCategory()) + switch (targetType.GetSelectionCategory()) { case TARGET_SELECT_CATEGORY_CHANNEL: SelectImplicitChannelTargets(effIndex, targetType); @@ -845,7 +845,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar switch (targetType.GetObjectType()) { case TARGET_OBJECT_TYPE_SRC: - switch(targetType.GetReferenceType()) + switch (targetType.GetReferenceType()) { case TARGET_REFERENCE_TYPE_CASTER: m_targets.SetSrc(*m_caster); @@ -856,7 +856,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar } break; case TARGET_OBJECT_TYPE_DEST: - switch(targetType.GetReferenceType()) + switch (targetType.GetReferenceType()) { case TARGET_REFERENCE_TYPE_CASTER: SelectImplicitCasterDestTargets(effIndex, targetType); @@ -873,7 +873,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar } break; default: - switch(targetType.GetReferenceType()) + switch (targetType.GetReferenceType()) { case TARGET_REFERENCE_TYPE_CASTER: SelectImplicitCasterObjectTargets(effIndex, targetType); @@ -1367,7 +1367,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { - switch(targetType.GetTarget()) + switch (targetType.GetTarget()) { case TARGET_DEST_CASTER: m_targets.SetDst(*m_caster); @@ -1432,7 +1432,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici void Spell::SelectImplicitTargetDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { WorldObject* target = m_targets.GetObjectTarget(); - switch(targetType.GetTarget()) + switch (targetType.GetTarget()) { case TARGET_DEST_TARGET_ENEMY: case TARGET_DEST_TARGET_ANY: @@ -1465,7 +1465,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT if (!m_targets.HasDst()) m_targets.SetDst(*m_caster); - switch(targetType.GetTarget()) + switch (targetType.GetTarget()) { case TARGET_DEST_DYNOBJ_ENEMY: case TARGET_DEST_DYNOBJ_ALLY: @@ -1491,7 +1491,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType) { - switch(targetType.GetTarget()) + switch (targetType.GetTarget()) { case TARGET_UNIT_CASTER: AddUnitTarget(m_caster, 1 << effIndex, false); diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 633e08e6fb1..a19c356b9ed 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -224,8 +224,8 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType) return false; - SpellImplicitTargetInfo targetType(this->targetType); - switch (targetType.GetSelectionCategory()) + SpellImplicitTargetInfo targetInfo(targetType); + switch (targetInfo.GetSelectionCategory()) { case TARGET_SELECT_CATEGORY_CHANNEL: // SINGLE return !area; @@ -235,13 +235,13 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff case TARGET_SELECT_CATEGORY_AREA: // AREA return area; case TARGET_SELECT_CATEGORY_DEFAULT: - switch (targetType.GetObjectType()) + switch (targetInfo.GetObjectType()) { case TARGET_OBJECT_TYPE_SRC: // EMPTY case TARGET_OBJECT_TYPE_DEST: // EMPTY return false; default: - switch(targetType.GetReferenceType()) + switch (targetInfo.GetReferenceType()) { case TARGET_REFERENCE_TYPE_CASTER: // SINGLE return !area; diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index 8608701e2ee..54e56174b1a 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -211,7 +211,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size())); recvData.hexlike(); - switch(opcode) + switch (opcode) { case WARDEN_CMSG_MODULE_MISSING: _warden->SendModuleToClient(); diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index f4c7a5069cf..abd7ff8f87d 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -121,7 +121,7 @@ void WardenCheckMgr::LoadWardenChecks() if (checkType == MPQ_CHECK || checkType == MEM_CHECK) { - WardenCheckResult *wr = new WardenCheckResult(); + WardenCheckResult* wr = new WardenCheckResult(); wr->Result.SetHexStr(checkResult.c_str()); int len = checkResult.size() / 2; if (wr->Result.GetNumBytes() < len) diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index 319cda304cc..3cc95b9f3f7 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -43,8 +43,8 @@ void WardenMac::Init(WorldSession *pClient, BigNumber *K) _session = pClient; // Generate Warden Key SHA1Randx WK(K->AsByteArray(), K->GetNumBytes()); - WK.generate(_inputKey, 16); - WK.generate(_outputKey, 16); + WK.Generate(_inputKey, 16); + WK.Generate(_outputKey, 16); /* Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet) Hash: (0x04 packet) diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index a7485d7da51..9aa439ec8c0 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -47,8 +47,8 @@ void WardenWin::Init(WorldSession* session, BigNumber *k) _session = session; // Generate Warden Key SHA1Randx WK(k->AsByteArray(), k->GetNumBytes()); - WK.generate(_inputKey, 16); - WK.generate(_outputKey, 16); + WK.Generate(_inputKey, 16); + WK.Generate(_outputKey, 16); memcpy(_seed, Module.Seed, 16); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 0279f3e2834..015c13d1098 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -64,7 +64,7 @@ public: void Reset() { - if(instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS) + if (instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS) OpenDoors(false); instance->SetBossState(DATA_PYROGAURD_EMBERSEER,NOT_STARTED); // respawn any dead Blackhand Incarcerators diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 079a2ef48e1..5a0560293da 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -494,7 +494,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader { // remove targets with this aura already // tank is not on this list - targets.remove_if (Trinity::UnitAuraCheck(true, GetSpellInfo()->Id)); + targets.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id)); if (targets.empty()) return; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 82946ad1f13..826c62a4390 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1189,7 +1189,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader void FilterTargets(std::list& targets) { - targets.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); + targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); if (targets.empty()) return; @@ -1238,7 +1238,7 @@ class spell_dreamwalker_summon_suppresser : public SpellScriptLoader std::list summoners; GetCreatureListWithEntryInGrid(summoners, caster, NPC_WORLD_TRIGGER, 100.0f); - summoners.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); + summoners.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); Trinity::Containers::RandomResizeList(summoners, 2); if (summoners.empty()) return; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index ce0a61d1099..9d5adf39817 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1230,7 +1230,7 @@ public: //bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) //{ // player->PlayerTalkClass->ClearMenus(); - // switch(action) + // switch (action) // { // case GOSSIP_ACTION_INFO_DEF+1: // if (player) diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index 4ec1d04b6ad..c46757a3956 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -651,7 +651,7 @@ class npc_simon_bunny : public CreatureScript { _events.Update(diff); - switch(_events.ExecuteEvent()) + switch (_events.ExecuteEvent()) { case EVENT_SIMON_PERIODIC_PLAYER_CHECK: if (!CheckPlayer()) diff --git a/src/server/shared/Cryptography/WardenKeyGeneration.h b/src/server/shared/Cryptography/WardenKeyGeneration.h index 9b44ab1832e..f0a9905b6fe 100644 --- a/src/server/shared/Cryptography/WardenKeyGeneration.h +++ b/src/server/shared/Cryptography/WardenKeyGeneration.h @@ -21,50 +21,56 @@ #ifndef _WARDEN_KEY_GENERATION_H #define _WARDEN_KEY_GENERATION_H -class SHA1Randx { +class SHA1Randx +{ public: - SHA1Randx(uint8 *buff, uint32 size) { + SHA1Randx(uint8* buff, uint32 size) + { uint32 taken = size/2; sh.Initialize(); - sh.UpdateData(buff,taken); + sh.UpdateData(buff, taken); sh.Finalize(); - memcpy(o1,sh.GetDigest(),20); + memcpy(o1, sh.GetDigest(), 20); sh.Initialize(); - sh.UpdateData(buff+taken,size-taken); + sh.UpdateData(buff + taken, size - taken); sh.Finalize(); - memcpy(o2,sh.GetDigest(),20); + memcpy(o2, sh.GetDigest(), 20); - memset(o0,0x00,20); + memset(o0, 0x00, 20); - fillUp(); + FillUp(); } - void generate(uint8 *buf, uint32 sz) { - for(uint32 i=0;ibind_result_done) + if (m_Mstmt->bind_result_done) { delete[] m_Mstmt->bind->length; delete[] m_Mstmt->bind->is_null; -- cgit v1.2.3