Warning Fixes

Code Style cleanup
Fix linux compile

--HG--
branch : trunk
This commit is contained in:
Spp
2010-04-29 23:12:16 +02:00
parent 35af94d4b5
commit cb0cb96283
17 changed files with 44 additions and 38 deletions
+1 -1
View File
@@ -1993,7 +1993,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria);
m_AchievementCriteriaListByAchievement[criteria->referredAchievement].push_back(criteria);
if(criteria->timeLimit)
if (criteria->timeLimit)
m_AchievementCriteriasByTimedType[criteria->timedType].push_back(criteria);
}
+3 -2
View File
@@ -20,6 +20,7 @@
#include "CombatAI.h"
#include "SpellMgr.h"
#include "Vehicle.h"
int AggressorAI::Permissible(const Creature *creature)
{
@@ -292,13 +293,13 @@ void AOEAI::UpdateAI(const uint32 /*diff*/)
//////////////
//NOTE: VehicleAI::UpdateAI runs even while the vehicle is mounted
void VehicleAI::UpdateAI(const uint32 diff)
void VehicleAI::UpdateAI(const uint32 /*diff*/)
{
}
void VehicleAI::Reset()
{
m_vehicle->Reset();
m_vehicle->Reset();
}
void VehicleAI::OnCharmed(bool apply)
+1 -1
View File
@@ -105,7 +105,7 @@ struct VehicleAI : public CreatureAI
{
public:
explicit VehicleAI(Creature *c) : CreatureAI(c), m_vehicle(c->GetVehicleKit()), m_IsVehicleInUse(false) {}
void UpdateAI(const uint32 diff);
static int Permissible(const Creature *);
void Reset();
+4 -4
View File
@@ -94,10 +94,10 @@ enum AchievementCriteriaTimedTypes
{
ACHIEVEMENT_TIMED_TYPE_EVENT = 1, // Timer is started by internal event with id in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_QUEST = 2, // Timer is started by acceting quest with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_SPELL_CASTER = 5, // Timer is started by casting a spell with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET = 6, // Timer is started by being target of spell with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_CREATURE = 7, // Timer is started by killing creature with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_ITEM = 9, // Timer is started by using item with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_SPELL_CASTER = 5, // Timer is started by casting a spell with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET = 6, // Timer is started by being target of spell with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_CREATURE = 7, // Timer is started by killing creature with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_ITEM = 9, // Timer is started by using item with entry in timerStartEvent
ACHIEVEMENT_TIMED_TYPE_MAX,
};
+1 -1
View File
@@ -413,7 +413,7 @@ void LoadDBCStores(const std::string& dataPath)
if (spellDiff->SpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
sLog.outErrorDb("spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x);
newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0
} else newEntry.SpellID[x] = spellDiff->SpellID[x];
} else newEntry.SpellID[x] = spellDiff->SpellID[x];
}
if (newEntry.SpellID[0] <= 0 || newEntry.SpellID[1] <= 0)//id0-1 must be always set!
continue;
+13 -13
View File
@@ -5940,7 +5940,7 @@ void Player::SendActionButtons(uint32 state) const
sLog.outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec);
WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4));
data << uint8(state);
data << uint8(state);
/*
state can be 0, 1, 2
0 - Looks to be sent when initial action buttons get sent, however on Trinity we use 1 since 0 had some difficulties
@@ -6043,7 +6043,7 @@ ActionButton const* Player::GetActionButton(uint8 button)
return &buttonItr->second;
}
bool Player::SetPosition(float x, float y, float z, float orientation, bool teleport)
{
if (!Unit::SetPosition(x, y, z, orientation, teleport))
@@ -12015,7 +12015,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
bool isRefundable = pSrcItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
if (isRefundable)
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() - count);
// change item amount before check (for unique max count check)
pSrcItem->SetCount(pSrcItem->GetCount() - count);
@@ -12052,7 +12052,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
bool isRefundable = pSrcItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
if (isRefundable)
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() - count);
// change item amount before check (for unique max count check)
pSrcItem->SetCount(pSrcItem->GetCount() - count);
@@ -12062,7 +12062,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
{
if (isRefundable)
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() + count);
delete pNewItem;
pSrcItem->SetCount(pSrcItem->GetCount() + count);
SendEquipError(msg, pSrcItem, NULL);
@@ -23389,22 +23389,22 @@ void Player::UpdateSpecCount(uint8 count)
uint32 curCount = GetSpecsCount();
if (curCount == count)
return;
if (m_activeSpec >= count)
ActivateSpec(0);
// Copy spec data
// Copy spec data
if (count > curCount)
{
_SaveActions(); // make sure the button list is cleaned up
for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end(); ++itr)
CharacterDatabase.PExecute("INSERT INTO character_action (guid,button,action,type,spec) VALUES ('%u', '%u', '%u', '%u', '%u')",
GetGUIDLow(), uint32(itr->first), uint32(itr->second.GetAction()), uint32(itr->second.GetType()), 1);
}
// Delete spec data for removed spec.
else if (count < curCount)
{
{
_SaveActions();
CharacterDatabase.PExecute("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'",m_activeSpec, GetGUIDLow());
m_activeSpec = 0;
@@ -23541,10 +23541,10 @@ void Player::ActivateSpec(uint8 spec)
m_usedTalentCount = spentTalents;
InitTalentForLevel();
if (QueryResult_AutoPtr result =
if (QueryResult_AutoPtr result =
CharacterDatabase.PQuery("SELECT button,action,type FROM character_action WHERE guid = '%u' AND spec = '%u' ORDER BY button", GetGUIDLow(), m_activeSpec))
_LoadActions(result);
ResummonPetTemporaryUnSummonedIfAny();
SendActionButtons(1);
@@ -23606,7 +23606,7 @@ void Player::DeleteRefundReference(uint64 it)
if (itr != m_refundableItems.end())
{
m_refundableItems.erase(itr);
}
}
}
void Player::AlterRefundReferenceCount(uint64 it, uint32 newCount)
@@ -23615,5 +23615,5 @@ void Player::AlterRefundReferenceCount(uint64 it, uint32 newCount)
if (itr != m_refundableItems.end())
{
itr->second = newCount;
}
}
}
+7 -2
View File
@@ -558,8 +558,13 @@ void Aura::UpdateOwner(uint32 diff, WorldObject * owner)
Player * modOwner = NULL;
if (caster)
{
if ((modOwner = caster->GetSpellModOwner()) && (modSpell = modOwner->FindCurrentSpellBySpellId(GetId())))
modOwner->SetSpellModTakingSpell(modSpell, true);
modOwner = caster->GetSpellModOwner();
if (modOwner)
{
modSpell = modOwner->FindCurrentSpellBySpellId(GetId());
if (modSpell)
modOwner->SetSpellModTakingSpell(modSpell, true);
}
}
Update(diff, caster);
+1 -1
View File
@@ -4500,7 +4500,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
case SPELLFAMILY_ROGUE:
{
// Fan of Knives, Hemorrhage, Ghostly Strike
if ((m_spellInfo->SpellFamilyFlags[1] & 0x40000)
if ((m_spellInfo->SpellFamilyFlags[1] & 0x40000)
|| (m_spellInfo->SpellFamilyFlags[0] & 0x6000000))
{
// Hemorrhage
+2 -2
View File
@@ -1320,9 +1320,9 @@ class SpellMgr
return false;
return true;
}
uint32 GetSpellDifficultyId(uint32 spellId)
uint32 GetSpellDifficultyId(uint32 spellId)
{
SpellDifficultySearcherMap::const_iterator i = mSpellDifficultySearcherMap.find(spellId);
SpellDifficultySearcherMap::const_iterator i = mSpellDifficultySearcherMap.find(spellId);
return i == mSpellDifficultySearcherMap.end() ? 0 : (*i).second;
}
void SetSpellDifficultyId(uint32 spellId, uint32 id) { mSpellDifficultySearcherMap[spellId] = id; }
+3 -3
View File
@@ -180,7 +180,7 @@ bool WorldSession::Update(uint32 /*diff*/)
LookupOpcodeName(packet->GetOpcode()),
packet->GetOpcode());
#endif*/
if (packet->GetOpcode() >= NUM_MSG_TYPES)
{
sLog.outError("SESSION: received non-existed opcode %s (0x%.4X)",
@@ -287,10 +287,10 @@ bool WorldSession::Update(uint32 /*diff*/)
if (!m_Socket || (ShouldLogOut(currTime) && !m_playerLoading))
LogoutPlayer(true);
///- If necessary, kick the player from the character select screen
///- If necessary, kick the player from the character select screen
if (IsConnectionIdle())
return false;
if (!m_Socket)
return false; //Will remove this session from the world session map
+2 -2
View File
@@ -284,7 +284,7 @@ class WorldSession
uint32 GetLatency() const { return m_latency; }
void SetLatency(uint32 latency) { m_latency = latency; }
uint32 getDialogStatus(Player *pPlayer, Object* questgiver, uint32 defstatus);
time_t m_timeOutTime;
void UpdateTimeOutTime(bool b)
{
@@ -299,7 +299,7 @@ class WorldSession
return true;
return false;
}
public: // opcodes handlers
+1 -1
View File
@@ -675,7 +675,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
*/
else if (opcode == CMSG_PLAYER_LOGIN)
m_Session->UpdateTimeOutTime(false);
// OK ,give the packet to WorldSession
aptr.release ();
// WARNINIG here we call it with locks held.