Core: Fix a few compile warnings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user