From c7927a7796525b958140b0f58bd08851c9215ed3 Mon Sep 17 00:00:00 2001 From: faramir118 Date: Wed, 11 Apr 2012 19:54:35 +0200 Subject: Tools/MapExtractor: proper type for string literals Signed-off-by: Machiavelli --- src/tools/map_extractor/System.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index bbde9f4675e..cf2f2188a70 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -71,7 +71,7 @@ float CONF_flat_height_delta_limit = 0.005f; // If max - min less this value - s float CONF_flat_liquid_delta_limit = 0.001f; // If max - min less this value - liquid surface is flat // List MPQ for extract from -char *CONF_mpq_list[]={ +const char *CONF_mpq_list[]={ "common.MPQ", "common-2.MPQ", "lichking.MPQ", @@ -83,7 +83,7 @@ char *CONF_mpq_list[]={ "patch-5.MPQ", }; -static char* const langs[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU" }; +static const char* const langs[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU" }; #define LANG_COUNT 12 void CreateDir( const std::string& Path ) -- cgit v1.2.3 From e56b2cdd59c5c7673da1aaac5fe8a99d4891e260 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 17:58:35 +0100 Subject: Core: Fix a few compile warnings --- src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Maps/Map.cpp | 2 +- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/tools/map_extractor/System.cpp | 18 +++++++++--------- src/tools/map_extractor/adt.cpp | 12 ++++++------ src/tools/map_extractor/loadlib.cpp | 2 +- src/tools/map_extractor/mpq_libmpq04.h | 4 ++-- src/tools/map_extractor/wdt.cpp | 6 +++--- 9 files changed, 27 insertions(+), 27 deletions(-) (limited to 'src/tools') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 96f454fd3e2..4176d9f605b 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -190,7 +190,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) } case CONDITION_OBJECT_ENTRY: { - if (object->GetTypeId() == ConditionValue1) + if (uint32(object->GetTypeId()) == ConditionValue1) condMeets = (!ConditionValue2) || (object->GetEntry() == ConditionValue2); break; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d38489ef5a9..f5f336a2402 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12019,7 +12019,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje Map const* map = lootedObject->GetMap(); if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) - if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty())) lootedObjectInDungeon = true; if (!lootedObjectInDungeon) @@ -17658,7 +17658,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) } else if (IsBagPos(item->GetPos())) - if (Bag* pBag = item->ToBag()) + if (item->IsBag()) invalidBagMap[item->GetGUIDLow()] = item; } else @@ -17811,7 +17811,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F GameEventMgr::ActiveEvents const& activeEventsList = sGameEventMgr->GetActiveEventList(); for (GameEventMgr::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr) { - if (events[*itr].holiday_id == proto->HolidayId) + if (uint32(events[*itr].holiday_id) == proto->HolidayId) { remove = false; break; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index a1b3d913c99..162dd12d121 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2470,7 +2470,7 @@ bool InstanceMap::AddPlayerToMap(Player* player) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) if (LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin()))) - if (uint32(dungeon->map) == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM) + if (uint32(dungeon->map) == GetId() && dungeon->difficulty == uint32(GetDifficulty()) && randomDungeon->type == uint32(LFG_TYPE_RANDOM)) player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 501c7c47676..0c879cfb029 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1513,7 +1513,7 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader if (group->isLFGGroup()) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) - if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty())) if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM) return; // in correct dungeon diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index cf2f2188a70..3deb9f44dd7 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -221,7 +221,7 @@ uint32 ReadMapDBC() map_ids[x].id = dbc.getRecord(x).getUInt(0); strcpy(map_ids[x].name, dbc.getRecord(x).getString(1)); } - printf("Done! (%u maps loaded)\n", map_count); + printf("Done! (%d maps loaded)\n", map_count); return map_count; } @@ -246,7 +246,7 @@ void ReadAreaTableDBC() maxAreaId = dbc.getMaxId(); - printf("Done! (%u areas loaded)\n", area_count); + printf("Done! (%d areas loaded)\n", area_count); } void ReadLiquidTypeTableDBC() @@ -259,15 +259,15 @@ void ReadLiquidTypeTableDBC() exit(1); } - size_t LiqType_count = dbc.getRecordCount(); - size_t LiqType_maxid = dbc.getMaxId(); - LiqType = new uint16[LiqType_maxid + 1]; - memset(LiqType, 0xff, (LiqType_maxid + 1) * sizeof(uint16)); + size_t liqTypeCount = dbc.getRecordCount(); + size_t liqTypeMaxId = dbc.getMaxId(); + LiqType = new uint16[liqTypeMaxId + 1]; + memset(LiqType, 0xff, (liqTypeMaxId + 1) * sizeof(uint16)); - for(uint32 x = 0; x < LiqType_count; ++x) + for(uint32 x = 0; x < liqTypeCount; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); - printf("Done! (%u LiqTypes loaded)\n", LiqType_count); + printf("Done! (%d LiqTypes loaded)\n", liqTypeCount); } // @@ -364,7 +364,7 @@ uint8 liquid_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE]; float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; -bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 build) +bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, /*int cell_x*/, uint32 build) { ADT_file adt; diff --git a/src/tools/map_extractor/adt.cpp b/src/tools/map_extractor/adt.cpp index fde70681113..66134180cb0 100644 --- a/src/tools/map_extractor/adt.cpp +++ b/src/tools/map_extractor/adt.cpp @@ -53,7 +53,7 @@ bool ADT_file::prepareLoadedData() bool adt_MHDR::prepareLoadedData() { - if (fcc != 'MHDR') + if (fcc != "MHDR") return false; if (size!=sizeof(adt_MHDR)-8) @@ -72,7 +72,7 @@ bool adt_MHDR::prepareLoadedData() bool adt_MCIN::prepareLoadedData() { - if (fcc != 'MCIN') + if (fcc != "MCIN") return false; // Check cells data @@ -86,7 +86,7 @@ bool adt_MCIN::prepareLoadedData() bool adt_MH2O::prepareLoadedData() { - if (fcc != 'MH2O') + if (fcc != "MH2O") return false; // Check liquid data @@ -98,7 +98,7 @@ bool adt_MH2O::prepareLoadedData() bool adt_MCNK::prepareLoadedData() { - if (fcc != 'MCNK') + if (fcc != "MCNK") return false; // Check height map @@ -113,7 +113,7 @@ bool adt_MCNK::prepareLoadedData() bool adt_MCVT::prepareLoadedData() { - if (fcc != 'MCVT') + if (fcc != "MCVT") return false; if (size != sizeof(adt_MCVT)-8) @@ -124,7 +124,7 @@ bool adt_MCVT::prepareLoadedData() bool adt_MCLQ::prepareLoadedData() { - if (fcc != 'MCLQ') + if (fcc != "MCLQ") return false; return true; diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp index 465eb04083f..77dca04d4c8 100644 --- a/src/tools/map_extractor/loadlib.cpp +++ b/src/tools/map_extractor/loadlib.cpp @@ -49,7 +49,7 @@ bool FileLoader::prepareLoadedData() { // Check version version = (file_MVER *) data; - if (version->fcc != 'MVER') + if (version->fcc != "MVER") return false; if (version->ver != FILE_FORMAT_VERSION) return false; diff --git a/src/tools/map_extractor/mpq_libmpq04.h b/src/tools/map_extractor/mpq_libmpq04.h index 1f3b259bbfc..89f715e9e87 100644 --- a/src/tools/map_extractor/mpq_libmpq04.h +++ b/src/tools/map_extractor/mpq_libmpq04.h @@ -60,8 +60,8 @@ class MPQFile libmpq__off_t pointer,size; // disable copying - MPQFile(const MPQFile &f) {} - void operator=(const MPQFile &f) {} + MPQFile(const MPQFile& /*f*/) {} + void operator=(const MPQFile& /*f*/) {} public: MPQFile(const char* filename); // filenames are not case sensitive diff --git a/src/tools/map_extractor/wdt.cpp b/src/tools/map_extractor/wdt.cpp index dedefbb64e5..d9ad0f4c7d3 100644 --- a/src/tools/map_extractor/wdt.cpp +++ b/src/tools/map_extractor/wdt.cpp @@ -4,21 +4,21 @@ bool wdt_MWMO::prepareLoadedData() { - if (fcc != 'MWMO') + if (fcc != "MWMO") return false; return true; } bool wdt_MPHD::prepareLoadedData() { - if (fcc != 'MPHD') + if (fcc != "MPHD") return false; return true; } bool wdt_MAIN::prepareLoadedData() { - if (fcc != 'MAIN') + if (fcc != "MAIN") return false; return true; } -- cgit v1.2.3 From 23be8c4fd719bb67e6a2dc9bc4114766bd62507f Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 18:22:34 +0100 Subject: Scripts/VH: Add an 1 minute pause after each boss fight (instead of 5 seconds) Revert one of the warning fixes (non standard C++) --- src/server/game/Spells/SpellInfo.cpp | 2 +- .../scripts/Northrend/VioletHold/instance_violet_hold.cpp | 3 ++- src/tools/map_extractor/adt.cpp | 12 ++++++------ src/tools/map_extractor/loadlib.cpp | 2 +- src/tools/map_extractor/wdt.cpp | 6 +++--- 5 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src/tools') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index e9e1b0eee8d..a931f759163 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -351,7 +351,7 @@ bool SpellEffectInfo::IsEffect() const bool SpellEffectInfo::IsEffect(SpellEffects effectName) const { - return Effect == effectName; + return Effect == uint32(effectName); } bool SpellEffectInfo::IsAura() const diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 79c54880430..37a13388b5f 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -690,7 +690,8 @@ public: { AddWave(); bActive = false; - uiActivationTimer = 5000; + // 1 minute waiting time after each boss fight + uiActivationTimer = (uiWaveCount == 6 || uiWaveCount == 12) ? 60000 : 5000; } else uiActivationTimer -= diff; } diff --git a/src/tools/map_extractor/adt.cpp b/src/tools/map_extractor/adt.cpp index 66134180cb0..fde70681113 100644 --- a/src/tools/map_extractor/adt.cpp +++ b/src/tools/map_extractor/adt.cpp @@ -53,7 +53,7 @@ bool ADT_file::prepareLoadedData() bool adt_MHDR::prepareLoadedData() { - if (fcc != "MHDR") + if (fcc != 'MHDR') return false; if (size!=sizeof(adt_MHDR)-8) @@ -72,7 +72,7 @@ bool adt_MHDR::prepareLoadedData() bool adt_MCIN::prepareLoadedData() { - if (fcc != "MCIN") + if (fcc != 'MCIN') return false; // Check cells data @@ -86,7 +86,7 @@ bool adt_MCIN::prepareLoadedData() bool adt_MH2O::prepareLoadedData() { - if (fcc != "MH2O") + if (fcc != 'MH2O') return false; // Check liquid data @@ -98,7 +98,7 @@ bool adt_MH2O::prepareLoadedData() bool adt_MCNK::prepareLoadedData() { - if (fcc != "MCNK") + if (fcc != 'MCNK') return false; // Check height map @@ -113,7 +113,7 @@ bool adt_MCNK::prepareLoadedData() bool adt_MCVT::prepareLoadedData() { - if (fcc != "MCVT") + if (fcc != 'MCVT') return false; if (size != sizeof(adt_MCVT)-8) @@ -124,7 +124,7 @@ bool adt_MCVT::prepareLoadedData() bool adt_MCLQ::prepareLoadedData() { - if (fcc != "MCLQ") + if (fcc != 'MCLQ') return false; return true; diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp index 77dca04d4c8..465eb04083f 100644 --- a/src/tools/map_extractor/loadlib.cpp +++ b/src/tools/map_extractor/loadlib.cpp @@ -49,7 +49,7 @@ bool FileLoader::prepareLoadedData() { // Check version version = (file_MVER *) data; - if (version->fcc != "MVER") + if (version->fcc != 'MVER') return false; if (version->ver != FILE_FORMAT_VERSION) return false; diff --git a/src/tools/map_extractor/wdt.cpp b/src/tools/map_extractor/wdt.cpp index d9ad0f4c7d3..dedefbb64e5 100644 --- a/src/tools/map_extractor/wdt.cpp +++ b/src/tools/map_extractor/wdt.cpp @@ -4,21 +4,21 @@ bool wdt_MWMO::prepareLoadedData() { - if (fcc != "MWMO") + if (fcc != 'MWMO') return false; return true; } bool wdt_MPHD::prepareLoadedData() { - if (fcc != "MPHD") + if (fcc != 'MPHD') return false; return true; } bool wdt_MAIN::prepareLoadedData() { - if (fcc != "MAIN") + if (fcc != 'MAIN') return false; return true; } -- cgit v1.2.3 From 36ea485f9a62bedf7b1114f0536322f241fed2e1 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 20 May 2012 18:37:10 +0100 Subject: Tools: Fix a typo and printf formats (there's no standard format for size_t) --- src/tools/map_extractor/System.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tools') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 3deb9f44dd7..1505f2c2cee 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -221,7 +221,7 @@ uint32 ReadMapDBC() map_ids[x].id = dbc.getRecord(x).getUInt(0); strcpy(map_ids[x].name, dbc.getRecord(x).getString(1)); } - printf("Done! (%d maps loaded)\n", map_count); + printf("Done! (%u maps loaded)\n", map_count); return map_count; } @@ -246,7 +246,7 @@ void ReadAreaTableDBC() maxAreaId = dbc.getMaxId(); - printf("Done! (%d areas loaded)\n", area_count); + printf("Done! (%u areas loaded)\n", area_count); } void ReadLiquidTypeTableDBC() @@ -267,7 +267,7 @@ void ReadLiquidTypeTableDBC() for(uint32 x = 0; x < liqTypeCount; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); - printf("Done! (%d LiqTypes loaded)\n", liqTypeCount); + printf("Done! (%u LiqTypes loaded)\n", liqTypeCount); } // @@ -364,7 +364,7 @@ uint8 liquid_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE]; float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; -bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, /*int cell_x*/, uint32 build) +bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, uint32 build) { ADT_file adt; -- cgit v1.2.3 From 50bd43661ca2e70a6f068ae8ba7c63e3ede646c0 Mon Sep 17 00:00:00 2001 From: click Date: Wed, 13 Jun 2012 18:38:21 +0200 Subject: Core: Remove a few silly warnings here and there (and adjust a comment to allow System.cpp to show properly in the nano-editor) --- src/server/game/AI/CoreAI/GameObjectAI.h | 2 +- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/tools/map_extractor/System.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/tools') diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index 21466f8c796..fbc8675cc47 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -54,7 +54,7 @@ class GameObjectAI virtual void SetData(uint32 /*id*/, uint32 /*value*/) {} virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {} virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) {} - virtual void EventInform(uint32 eventId) {} + virtual void EventInform(uint32 /*eventId*/) {} }; class NullGameObjectAI : public GameObjectAI diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 07e9546173d..5b65d0ca763 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2691,7 +2691,7 @@ public: { PrepareSpellScript(spell_gen_touch_the_nightmare_SpellScript); - void HandleDamageCalc(SpellEffIndex effIndex) + void HandleDamageCalc(SpellEffIndex /*effIndex*/) { uint32 bp = GetCaster()->GetMaxHealth() * 0.3f; SetHitDamage(bp); diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 1505f2c2cee..d64276c6363 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -48,9 +48,9 @@ char output_path[128] = "."; char input_path[128] = "."; uint32 maxAreaId = 0; -//************************************************** +// ************************************************** // Extractor options -//************************************************** +// ************************************************** enum Extract { EXTRACT_MAP = 1, @@ -221,7 +221,7 @@ uint32 ReadMapDBC() map_ids[x].id = dbc.getRecord(x).getUInt(0); strcpy(map_ids[x].name, dbc.getRecord(x).getString(1)); } - printf("Done! (%u maps loaded)\n", map_count); + printf("Done! (%zu maps loaded)\n", map_count); return map_count; } @@ -246,7 +246,7 @@ void ReadAreaTableDBC() maxAreaId = dbc.getMaxId(); - printf("Done! (%u areas loaded)\n", area_count); + printf("Done! (%zu areas loaded)\n", area_count); } void ReadLiquidTypeTableDBC() @@ -267,7 +267,7 @@ void ReadLiquidTypeTableDBC() for(uint32 x = 0; x < liqTypeCount; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); - printf("Done! (%u LiqTypes loaded)\n", liqTypeCount); + printf("Done! (%zu LiqTypes loaded)\n", liqTypeCount); } // @@ -572,7 +572,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, // Try store as packed in uint16 or uint8 values if (!(heightHeader.flags & MAP_HEIGHT_NO_HEIGHT)) { - float step; + float step = 0; // Try Store as uint values if (CONF_allow_float_to_int) { -- cgit v1.2.3 From fb1ac16b0ce27567dc4bb435ee4fa0b0b228e4ad Mon Sep 17 00:00:00 2001 From: Chaplain Date: Mon, 20 Aug 2012 11:05:50 +0200 Subject: Core/Misc: Some fixes here and there Closes #7277 --- src/server/collision/Maps/TileAssembler.cpp | 8 +++++++- src/server/game/DungeonFinding/LFGMgr.cpp | 4 ++-- src/tools/vmap4_extractor/vmapexport.cpp | 22 +++++++++++----------- 3 files changed, 20 insertions(+), 14 deletions(-) (limited to 'src/tools') diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index 3bfed7d322d..207b652a4d6 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -336,9 +336,15 @@ namespace VMAP void TileAssembler::exportGameobjectModels() { FILE* model_list = fopen((iSrcDir + "/" + "temp_gameobject_models").c_str(), "rb"); + if (!model_list) + return; + FILE* model_list_copy = fopen((iDestDir + "/" + GAMEOBJECT_MODELS).c_str(), "wb"); - if (!model_list || !model_list_copy) + if (!model_list_copy) + { + fclose(model_list); return; + } uint32 name_length, displayId; char buff[500]; diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index a7dd677313e..bb6c1dfdcc1 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1239,11 +1239,11 @@ LfgAnswer LFGMgr::GetCompatibles(std::string key) void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, const PlayerSet& players, LfgLockPartyMap& lockMap) { lockMap.clear(); - for (PlayerSet::const_iterator it = players.begin(); it != players.end() && dungeons.size(); ++it) + for (PlayerSet::const_iterator it = players.begin(); it != players.end() && !dungeons.empty(); ++it) { uint64 guid = (*it)->GetGUID(); LfgLockMap cachedLockMap = GetLockedDungeons(guid); - for (LfgLockMap::const_iterator it2 = cachedLockMap.begin(); it2 != cachedLockMap.end() && dungeons.size(); ++it2) + for (LfgLockMap::const_iterator it2 = cachedLockMap.begin(); it2 != cachedLockMap.end() && !dungeons.empty(); ++it2) { uint32 dungeonId = (it2->first & 0x00FFFFFF); // Compare dungeon ids LfgDungeonSet::iterator itDungeon = dungeons.find(dungeonId); diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index e60a773c6de..126a543400c 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -382,9 +382,9 @@ bool processArgv(int argc, char ** argv, const char *versionString) { bool result = true; hasInputPathParam = false; - bool preciseVectorData = false; + preciseVectorData = false; - for(int i=1; i< argc; ++i) + for(int i = 1; i < argc; ++i) { if(strcmp("-s",argv[i]) == 0) { @@ -447,7 +447,7 @@ int main(int argc, char ** argv) const char *versionString = "V4.00 2012_02"; // Use command line arguments, when some - if(!processArgv(argc, argv, versionString)) + if (!processArgv(argc, argv, versionString)) return 1; // some simple check if working dir is dirty @@ -469,7 +469,7 @@ int main(int argc, char ** argv) printf("Extract %s. Beginning work ....\n",versionString); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // Create the working directory - if(mkdir(szWorkDirWmo + if (mkdir(szWorkDirWmo #ifdef __linux__ , 0711 #endif @@ -482,11 +482,11 @@ int main(int argc, char ** argv) for (size_t i=0; i < archiveNames.size(); ++i) { MPQArchive *archive = new MPQArchive(archiveNames[i].c_str()); - if(!gOpenArchives.size() || gOpenArchives.front() != archive) + if (gOpenArchives.empty() || gOpenArchives.front() != archive) delete archive; } - if(gOpenArchives.empty()) + if (gOpenArchives.empty()) { printf("FATAL ERROR: None MPQ archive found by path '%s'. Use -d option with proper path.\n",input_path); return 1; @@ -494,15 +494,15 @@ int main(int argc, char ** argv) ReadLiquidTypeTableDBC(); // extract data - if(success) + if (success) success = ExtractWmo(); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //map.dbc - if(success) + if (success) { DBCFile * dbc = new DBCFile("DBFilesClient\\Map.dbc"); - if(!dbc->open()) + if (!dbc->open()) { delete dbc; printf("FATAL ERROR: Map.dbc not found in data file.\n"); @@ -510,7 +510,7 @@ int main(int argc, char ** argv) } map_count=dbc->getRecordCount (); map_ids=new map_id[map_count]; - for(unsigned int x=0;xgetRecord (x).getUInt(0); strcpy(map_ids[x].name,dbc->getRecord(x).getString(1)); @@ -527,7 +527,7 @@ int main(int argc, char ** argv) } printf("\n"); - if(!success) + if (!success) { printf("ERROR: Extract %s. Work NOT complete.\n Precise vector data=%d.\nPress any key.\n",versionString, preciseVectorData); getchar(); -- cgit v1.2.3 From 9e0907874e3f461aa5650f7122af880301025b7f Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 20 Aug 2012 21:54:36 +0100 Subject: Core: Fix 4 warnings / SQL: Rename two SQL files --- sql/updates/world/2011_07_05_00_world_achievement_criteria_data.sql | 4 ---- sql/updates/world/2011_07_05_00_world_disables.sql | 1 - sql/updates/world/2012_08_20_08_world_achievement_criteria_data.sql | 4 ++++ sql/updates/world/2012_08_20_09_world_disables.sql | 1 + src/server/game/Battlefield/Zones/BattlefieldWG.cpp | 4 ++-- src/tools/vmap4_extractor/mpq_libmpq04.h | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 sql/updates/world/2011_07_05_00_world_achievement_criteria_data.sql delete mode 100644 sql/updates/world/2011_07_05_00_world_disables.sql create mode 100644 sql/updates/world/2012_08_20_08_world_achievement_criteria_data.sql create mode 100644 sql/updates/world/2012_08_20_09_world_disables.sql (limited to 'src/tools') diff --git a/sql/updates/world/2011_07_05_00_world_achievement_criteria_data.sql b/sql/updates/world/2011_07_05_00_world_achievement_criteria_data.sql deleted file mode 100644 index fa995e7804f..00000000000 --- a/sql/updates/world/2011_07_05_00_world_achievement_criteria_data.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE FROM `achievement_criteria_data` WHERE criteria_id = 7703; -INSERT INTO `achievement_criteria_data` VALUES -(7703, 6, 4197, 0, ''), -(7703, 11, 0, 0, 'achievement_wg_didnt_stand_a_chance'); diff --git a/sql/updates/world/2011_07_05_00_world_disables.sql b/sql/updates/world/2011_07_05_00_world_disables.sql deleted file mode 100644 index fa5010b669f..00000000000 --- a/sql/updates/world/2011_07_05_00_world_disables.sql +++ /dev/null @@ -1 +0,0 @@ -DELETE FROM `disables` WHERE `entry` = 7703 AND `sourceType` = 4; diff --git a/sql/updates/world/2012_08_20_08_world_achievement_criteria_data.sql b/sql/updates/world/2012_08_20_08_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..fa995e7804f --- /dev/null +++ b/sql/updates/world/2012_08_20_08_world_achievement_criteria_data.sql @@ -0,0 +1,4 @@ +DELETE FROM `achievement_criteria_data` WHERE criteria_id = 7703; +INSERT INTO `achievement_criteria_data` VALUES +(7703, 6, 4197, 0, ''), +(7703, 11, 0, 0, 'achievement_wg_didnt_stand_a_chance'); diff --git a/sql/updates/world/2012_08_20_09_world_disables.sql b/sql/updates/world/2012_08_20_09_world_disables.sql new file mode 100644 index 00000000000..fa5010b669f --- /dev/null +++ b/sql/updates/world/2012_08_20_09_world_disables.sql @@ -0,0 +1 @@ +DELETE FROM `disables` WHERE `entry` = 7703 AND `sourceType` = 4; diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index c57f2bf0597..48d6b59d007 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -574,7 +574,7 @@ void BattlefieldWG::OnCreatureCreate(Creature* creature) } } -void BattlefieldWG::OnCreatureRemove(Creature* creature) +void BattlefieldWG::OnCreatureRemove(Creature* /*creature*/) { /* possibly can be used later if (IsWarTime()) @@ -896,7 +896,7 @@ void BattlefieldWG::SendInitWorldStatesToAll() player->GetSession()->SendPacket(&data); } -void BattlefieldWG::BrokenWallOrTower(TeamId team) +void BattlefieldWG::BrokenWallOrTower(TeamId /*team*/) { // might be some use for this in the future. old code commented out below. KL /* if (team == GetDefenderTeam()) diff --git a/src/tools/vmap4_extractor/mpq_libmpq04.h b/src/tools/vmap4_extractor/mpq_libmpq04.h index ed51022de78..89f715e9e87 100644 --- a/src/tools/vmap4_extractor/mpq_libmpq04.h +++ b/src/tools/vmap4_extractor/mpq_libmpq04.h @@ -24,7 +24,7 @@ public: void close(); void GetFileListTo(vector& filelist) { - uint32 filenum; + uint32_t filenum; if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; libmpq__off_t size, transferred; libmpq__file_unpacked_size(mpq_a, filenum, &size); @@ -60,8 +60,8 @@ class MPQFile libmpq__off_t pointer,size; // disable copying - MPQFile(const MPQFile &f) {} - void operator=(const MPQFile &f) {} + MPQFile(const MPQFile& /*f*/) {} + void operator=(const MPQFile& /*f*/) {} public: MPQFile(const char* filename); // filenames are not case sensitive -- cgit v1.2.3