aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAz@zel <azazel.kon@gmail.com>2011-05-11 11:12:26 +0600
committerAz@zel <azazel.kon@gmail.com>2011-05-11 11:12:26 +0600
commitf73c6c40bb707b5af920f322e8b8bfde27308d4c (patch)
treed8284693ea4cbd0f4d888c19cdb7493776fe34cb /src
parent09fb6f555f5cd8bd41b396e3fcc58b7cdc071925 (diff)
Core/Misc: fix compiler warnings
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp10
-rwxr-xr-xsrc/server/game/Battlegrounds/ArenaTeam.cpp4
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp70
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp2
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp6
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp4
8 files changed, 47 insertions, 55 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 732e4a42dbb..13691882459 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -155,7 +155,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
mUseTextTimer = true;
sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), mTextGUID);
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textGuid: %u",
- talker->GetName(), talker->GetGUIDLow(), mTextGUID);
+ talker->GetName(), talker->GetGUIDLow(), GUID_LOPART(mTextGUID));
break;
}
case SMART_ACTION_SIMPLE_TALK:
@@ -449,7 +449,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
(*itr)->ToPlayer()->CastedCreatureOrGO(e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell);
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_CASTCREATUREORGO: Player guidLow %u.org Creature: %u, BaseObject GUID: "UI64FMTD" , Spell: %u",
- e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell);
+ (*itr)->GetGUIDLow(), e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell);
}
}
@@ -499,8 +499,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
tempLastInvoker->InterruptNonMeleeSpells(false);
tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false);
- sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker %u casts spell % on target %u with castflags %u",
- tempLastInvoker->GetGUIDLow(), (*itr)->GetGUIDLow(), e.action.cast.spell, e.action.cast.flags);
+ sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker %u casts spell %u on target %u with castflags %u",
+ tempLastInvoker->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
}
}
@@ -873,7 +873,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
me->UpdateEntry(e.action.updateTemplate.creature, e.action.updateTemplate.team ? HORDE : ALLIANCE);
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_UPDATE_TEMPLATE: Creature %u, Template: %u, Team: %u",
- me->GetGUIDLow(), e.action.updateTemplate.team ? HORDE : ALLIANCE);
+ me->GetGUIDLow(), me->GetEntry(), e.action.updateTemplate.team ? HORDE : ALLIANCE);
break;
}
case SMART_ACTION_DIE:
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index f3ecf16f9a7..cb55ded6c4e 100755
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -127,7 +127,7 @@ bool ArenaTeam::AddMember(const uint64& playerGuid)
// Check if player is already in a similar arena team
if (player && player->GetArenaTeamId(GetSlot()) || Player::GetArenaTeamIdFromDB(playerGuid, GetType()) != 0)
{
- sLog->outError("Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), playerGuid, GetType());
+ sLog->outError("Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), GUID_LOPART(playerGuid), GetType());
return false;
}
@@ -186,7 +186,7 @@ bool ArenaTeam::AddMember(const uint64& playerGuid)
player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
}
- sLog->outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", playerName.c_str(), playerGuid, GetType(), GetId());
+ sLog->outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", playerName.c_str(), GUID_LOPART(playerGuid), GetType(), GetId());
return true;
}
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
index af8e5e8859f..e5a351fb05e 100755
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ b/src/server/game/Chat/Commands/Level3.cpp
@@ -1230,32 +1230,29 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
{
uint32 id = itr->second.Entry;
uint8 localeIndex = GetSessionDbLocaleIndex();
- if (localeIndex >= 0)
+ if (CreatureLocale const *cl = sObjectMgr->GetCreatureLocale(id))
{
- if (CreatureLocale const *cl = sObjectMgr->GetCreatureLocale(id))
+ if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty ())
{
- if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty ())
- {
- std::string name = cl->Name[localeIndex];
+ std::string name = cl->Name[localeIndex];
- if (Utf8FitTo (name, wnamepart))
+ if (Utf8FitTo (name, wnamepart))
+ {
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- if (m_session)
- PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ());
- else
- PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ());
+ if (m_session)
+ PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ());
+ else
+ PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ());
- if (!found)
- found = true;
+ if (!found)
+ found = true;
- continue;
- }
+ continue;
}
}
}
@@ -1310,32 +1307,29 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args)
for (GameObjectTemplateContainer::const_iterator itr = gotc->begin(); itr != gotc->end(); ++itr)
{
uint8 localeIndex = GetSessionDbLocaleIndex();
- if (localeIndex >= 0)
+ if (GameObjectLocale const *gl = sObjectMgr->GetGameObjectLocale(itr->second.entry))
{
- if (GameObjectLocale const *gl = sObjectMgr->GetGameObjectLocale(itr->second.entry))
+ if (gl->Name.size() > localeIndex && !gl->Name[localeIndex].empty())
{
- if (gl->Name.size() > localeIndex && !gl->Name[localeIndex].empty())
- {
- std::string name = gl->Name[localeIndex];
+ std::string name = gl->Name[localeIndex];
- if (Utf8FitTo(name, wnamepart))
+ if (Utf8FitTo(name, wnamepart))
+ {
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- if (m_session)
- PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, itr->second.entry, itr->second.entry, name.c_str());
- else
- PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, itr->second.entry, name.c_str());
+ if (m_session)
+ PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, itr->second.entry, itr->second.entry, name.c_str());
+ else
+ PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, itr->second.entry, name.c_str());
- if (!found)
- found = true;
+ if (!found)
+ found = true;
- continue;
- }
+ continue;
}
}
}
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 0ec4de19dd7..51e418b9202 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -9785,7 +9785,7 @@ uint8 Player::FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) c
}
}
- if (Item* ohWeapon = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
+ if (GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
{
if (proto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM || proto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF)
{
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 61133625cfd..4b0bafbad35 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -15323,7 +15323,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
}
}
- if (Vehicle* veh = pVictim->GetVehicle())
+ if (pVictim->GetVehicle())
pVictim->ExitVehicle();
}
@@ -15446,7 +15446,7 @@ void Unit::SetRooted(bool apply)
// AddUnitMovementFlag(MOVEMENTFLAG_ROOT);
- if (Player* thisPlr = this->ToPlayer())
+ if (GetTypeId() == TYPEID_PLAYER)
{
WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10);
data.append(GetPackGUID());
@@ -15465,7 +15465,7 @@ void Unit::SetRooted(bool apply)
{
if (!HasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect
{
- if (Player* thisPlr = this->ToPlayer())
+ if (GetTypeId() == TYPEID_PLAYER)
{
WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10);
data.append(GetPackGUID());
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index ec388ab0719..9fdb9c24fab 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1133,9 +1133,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* display
{
CreatureModelInfo const *minfo_tmp = GetCreatureModelInfo(minfo->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, minfo->modelid_other_gender);
else
{
// Model ID changed
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
index e4640b766f6..cf28c7a39fc 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
@@ -1022,7 +1022,7 @@ public:
if (!instance)
return;
- if (Creature* malygos = Unit::GetCreature(*me, instance->GetData64(DATA_MALYGOS)))
+ if (Unit::GetCreature(*me, instance->GetData64(DATA_MALYGOS)))
{
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
{
diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp
index a1308a6de86..e7c5028a16c 100644
--- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp
+++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp
@@ -298,8 +298,8 @@ class go_razorscale_harpoon : public GameObjectScript
bool OnGossipHello(Player* /*player*/, GameObject* go)
{
InstanceScript* instance = go->GetInstanceScript();
- if (Creature* razorscale = ObjectAccessor::GetCreature(*go, instance ? instance->GetData64(TYPE_RAZORSCALE) : 0))
- go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
+ if (ObjectAccessor::GetCreature(*go, instance ? instance->GetData64(TYPE_RAZORSCALE) : 0))
+ go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
return false;
}
};