diff options
| author | Spp <none@none> | 2010-08-30 23:07:14 +0200 |
|---|---|---|
| committer | Spp <none@none> | 2010-08-30 23:07:14 +0200 |
| commit | e252b8abe764e5e348e8ec89deec944729437147 (patch) | |
| tree | f131abb9ab5f0ebae01d4c0481cce237d78e33eb /src/server/game | |
| parent | a6d075dfc6691797aaa09bd119bd1a1b34034ff5 (diff) | |
Core: Fix more warnings
--HG--
branch : trunk
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/Chat/Commands/Level3.cpp | 23 | ||||
| -rw-r--r-- | src/server/game/Entities/Creature/CreatureGroups.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectAccessor.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Maps/Map.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Movement/Waypoints/WaypointManager.cpp | 3 | ||||
| -rw-r--r-- | src/server/game/Server/Protocol/Handlers/MiscHandler.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Server/Protocol/Handlers/MovementHandler.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp | 14 | ||||
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 |
10 files changed, 33 insertions, 33 deletions
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 3bc1c569889..ee1dddc966a 100644 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -2573,10 +2573,11 @@ bool ChatHandler::HandleListItemCommand(const char *args) } char* c_count = strtok(NULL, " "); - int count = c_count ? atol(c_count) : 10; + int _count = c_count ? atol(c_count) : 10; - if (count < 0) + if (_count < 0) return false; + uint32 count = uint32(_count); QueryResult_AutoPtr result; @@ -2591,7 +2592,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) "SELECT ci.item, cibag.slot AS bag, ci.slot, ci.guid, characters.account,characters.name " "FROM character_inventory AS ci LEFT JOIN character_inventory AS cibag ON (cibag.item=ci.bag),characters " "WHERE ci.item_template='%u' AND ci.guid = characters.guid LIMIT %u ", - item_id,uint32(count)); + item_id, count); if (result) { @@ -2619,7 +2620,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) item_guid,owner_name.c_str(),owner_guid,owner_acc,item_pos); } while (result->NextRow()); - int64 res_count = result->GetRowCount(); + uint32 res_count = uint32(result->GetRowCount()); if (count > res_count) count-=res_count; @@ -2640,7 +2641,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) "SELECT mail_items.item_guid, mail.sender, mail.receiver, char_s.account, char_s.name, char_r.account, char_r.name " "FROM mail,mail_items,characters as char_s,characters as char_r " "WHERE mail_items.item_template='%u' AND char_s.guid = mail.sender AND char_r.guid = mail.receiver AND mail.id=mail_items.mail_id LIMIT %u", - item_id,uint32(count)); + item_id, count); } else result = QueryResult_AutoPtr(NULL); @@ -2664,7 +2665,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) item_guid,item_s_name.c_str(),item_s,item_s_acc,item_r_name.c_str(),item_r,item_r_acc,item_pos); } while (result->NextRow()); - int64 res_count = result->GetRowCount(); + uint32 res_count = uint32(result->GetRowCount()); if (count > res_count) count-=res_count; @@ -2684,7 +2685,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) // 0 1 2 3 "SELECT auctionhouse.itemguid, auctionhouse.itemowner, characters.account, characters.name " "FROM auctionhouse,characters WHERE auctionhouse.item_template='%u' AND characters.guid = auctionhouse.itemowner LIMIT %u", - item_id,uint32(count)); + item_id, count); } else result = QueryResult_AutoPtr(NULL); @@ -2715,7 +2716,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) // 0 1 2 "SELECT gi.item_guid, gi.guildid, guild.name " "FROM guild_bank_item AS gi, guild WHERE gi.item_entry='%u' AND gi.guildid = guild.guildid LIMIT %u ", - item_id,uint32(count)); + item_id, count); if (result) { @@ -2731,7 +2732,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) PSendSysMessage(LANG_ITEMLIST_GUILD,item_guid,guild_name.c_str(),guild_guid,item_pos); } while (result->NextRow()); - int64 res_count = result->GetRowCount(); + uint32 res_count = uint32(result->GetRowCount()); if (count > res_count) count-=res_count; @@ -6112,10 +6113,10 @@ bool ChatHandler::HandlePDumpWriteCommand(const char *args) if (!file || !p2) return false; - uint32 guid; + uint64 guid; // character name can't start from number if (isNumeric(p2)) - guid = atoi(p2); + guid = MAKE_NEW_GUID(atoi(p2), 0, HIGHGUID_PLAYER); else { std::string name = extractPlayerNameFromLink(p2); diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index 97414c35529..5a35e0b537a 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -93,7 +93,7 @@ void CreatureGroupManager::LoadCreatureFormations() return; } - uint32 total_records = result->GetRowCount(); + uint64 total_records = result->GetRowCount(); barGoLink bar(total_records); Field *fields; @@ -145,7 +145,7 @@ void CreatureGroupManager::LoadCreatureFormations() while (result->NextRow()) ; sLog.outString(); - sLog.outString(">> Loaded %u creatures in formations", total_records); + sLog.outString(">> Loaded " UI64FMTD " creatures in formations", total_records); sLog.outString(); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 161addda839..1c4c19a77eb 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11085,9 +11085,9 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint scripted = true; int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); if (apBonus > DoneAdvertisedBenefit) - DoneTotal += apBonus * 0.22f; // 22% of AP per tick + DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick else - DoneTotal += DoneAdvertisedBenefit * 0.377f; //37.7% of BH per tick + DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); //37.7% of BH per tick } // Earthliving - 0.45% of normal hot coeff else if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 3245776508d..f286ddf3e2c 100644 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -223,7 +223,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse) CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); uint32 cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - sObjectMgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID()); + sObjectMgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, GUID_LOPART(corpse->GetOwnerGUID())); i_player2corpse.erase(iter); } @@ -244,7 +244,7 @@ void ObjectAccessor::AddCorpse(Corpse* corpse) CellPair cell_pair = Trinity::ComputeCellPair(corpse->GetPositionX(), corpse->GetPositionY()); uint32 cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - sObjectMgr.AddCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID(), corpse->GetInstanceId()); + sObjectMgr.AddCorpseCellData(corpse->GetMapId(), cell_id, GUID_LOPART(corpse->GetOwnerGUID()), corpse->GetInstanceId()); } } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 880044ff760..aa6b348e4c9 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1499,7 +1499,7 @@ float GridMap::getLiquidLevel(float x, float y) uint8 GridMap::getTerrainType(float x, float y) { if (!m_liquid_type) - return m_liquidType; + return 0; x = 16 * (32 - x/SIZE_OF_GRIDS); y = 16 * (32 - y/SIZE_OF_GRIDS); diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index 078d272f62a..d2d5a84cf3a 100644 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -55,9 +55,8 @@ void WaypointStore::Load() } WaypointPath* path_data = NULL; - uint32 total_records = result->GetRowCount(); - barGoLink bar(total_records); + barGoLink bar(result->GetRowCount()); uint32 count = 0; Field *fields; uint32 last_id = 0; diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index e5025aa5bd0..e47e5e917d9 100644 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -562,7 +562,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, std::string friendNote) { uint64 friendGuid; - uint64 friendAcctid; + uint32 friendAcctid; uint32 team; FriendsResult friendResult; @@ -697,7 +697,7 @@ void WorldSession::HandleSetContactNotesOpcode(WorldPacket & recv_data) uint64 guid; std::string note; recv_data >> guid >> note; - _player->GetSocial()->SetFriendNote(guid, note); + _player->GetSocial()->SetFriendNote(GUID_LOPART(guid), note); } void WorldSession::HandleBugOpcode(WorldPacket & recv_data) diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index e81cc59e0ff..05a6685105b 100644 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -157,9 +157,9 @@ void WorldSession::HandleMoveWorldportAckOpcode() { if (mapDiff->resetTime) { - if (uint32 timeReset = sInstanceSaveMgr.GetResetTimeFor(mEntry->MapID,diff)) + if (time_t timeReset = sInstanceSaveMgr.GetResetTimeFor(mEntry->MapID,diff)) { - uint32 timeleft = timeReset - time(NULL); + uint32 timeleft = uint32(timeReset - time(NULL)); GetPlayer()->SendInstanceResetWarning(mEntry->MapID, diff, timeleft); } } diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index da52ead96d0..19af7e18b01 100644 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -263,14 +263,14 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) // result == NULL also correct in case no sign yet if (result) - signs = result->GetRowCount(); + signs = uint8(result->GetRowCount()); sLog.outDebug("CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionguid_low); WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+1+signs*12)); data << uint64(petitionguid); // petition guid data << uint64(_player->GetGUID()); // owner guid - data << uint32(petitionguid_low); // guild guid (in mangos always same as GUID_LOPART(petitionguid) + data << uint32(petitionguid_low); // guild guid data << uint8(signs); // sign's count for (uint8 i = 1; i <= signs; ++i) @@ -279,7 +279,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) uint64 plguid = fields2[0].GetUInt64(); data << uint64(plguid); // Player GUID - data << (uint32)0; // there 0 ... + data << uint32(0); // there 0 ... result->NextRow(); } @@ -664,12 +664,12 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); // result == NULL also correct charter without signs if (result) - signs = result->GetRowCount(); + signs = uint8(result->GetRowCount()); WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+signs+signs*12)); data << uint64(petitionguid); // petition guid data << uint64(_player->GetGUID()); // owner guid - data << uint32(GUID_LOPART(petitionguid)); // guild guid (in mangos always same as GUID_LOPART(petition guid) + data << uint32(GUID_LOPART(petitionguid)); // guild guid data << uint8(signs); // sign's count for (uint8 i = 1; i <= signs; ++i) @@ -678,7 +678,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) plguid = fields2[0].GetUInt64(); data << uint64(plguid); // Player GUID - data << (uint32)0; // there 0 ... + data << uint32(0); // there 0 ... result->NextRow(); } @@ -750,7 +750,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) uint8 signs; result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); if (result) - signs = result->GetRowCount(); + signs = uint8(result->GetRowCount()); else signs = 0; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index aa6e3ee8c7c..3c70bfe4914 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1858,7 +1858,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const //maybe has to be sent different to client, but not by SMSG_PERIODICAURALOG SpellNonMeleeDamage damageInfo(caster, target, spellProto->Id, spellProto->SchoolMask); //no SpellDamageBonus for burn mana - caster->CalculateSpellDamageTaken(&damageInfo, gain * dmgMultiplier, spellProto); + caster->CalculateSpellDamageTaken(&damageInfo, int32(gain * dmgMultiplier), spellProto); caster->DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb); @@ -4974,7 +4974,7 @@ void AuraEffect::HandleAuraModIncreaseHealthPercent(AuraApplication const * aurA float percent = target->GetHealthPct(); target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(GetAmount()), apply); if (target->isAlive()) - target->SetHealth(target->CountPctFromMaxHealth(percent)); + target->SetHealth(target->CountPctFromMaxHealth(int32(percent))); } void AuraEffect::HandleAuraIncreaseBaseHealthPercent(AuraApplication const * aurApp, uint8 mode, bool apply) const |
