diff options
author | Spp <none@none> | 2010-04-07 18:09:10 +0200 |
---|---|---|
committer | Spp <none@none> | 2010-04-07 18:09:10 +0200 |
commit | b27ce42704c33e292bda390265bb8fd01a433505 (patch) | |
tree | 29b2df222a2c1be3325e3d6fab75206100b578fd /src/game | |
parent | f490ad5ac259712e323f0a52e608ff1383b2fc41 (diff) |
Code Style: Remove trailing spaces
--HG--
branch : trunk
Diffstat (limited to 'src/game')
48 files changed, 264 insertions, 264 deletions
diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp index 1e910521457..bbf034e0ac4 100644 --- a/src/game/ArenaTeam.cpp +++ b/src/game/ArenaTeam.cpp @@ -199,7 +199,7 @@ bool ArenaTeam::LoadArenaTeamFromDB(QueryResult_AutoPtr arenaTeamDataResult) m_stats.games_season = fields[12].GetUInt32(); m_stats.wins_season = fields[13].GetUInt32(); m_stats.rank = fields[14].GetUInt32(); - + return true; } @@ -322,7 +322,7 @@ void ArenaTeam::Disband(WorldSession *session) // Removing from members is done in DelMember. DelMember(m_members.front().guid); } - + if (session) { if(Player *player = session->GetPlayer()) diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index 4a97ca0d0f7..78a9409764c 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -615,7 +615,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data ) return; } - //check if any arena enabled + //check if any arena enabled if (!sBattleGroundMgr.isAnyArenaEnabled()) { SendBattleGroundOrArenaJoinError(BG_JOIN_ERR_ARENA_DISABLED); diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 0b75155e1d0..93cd6ed4277 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1394,9 +1394,9 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg) case BATTLEGROUND_RL: case BATTLEGROUND_SA: *data << uint32(2); - *data << uint32(((BattleGroundSAScore*)itr->second)->demolishers_destroyed); - *data << uint32(((BattleGroundSAScore*)itr->second)->gates_destroyed); - break; + *data << uint32(((BattleGroundSAScore*)itr->second)->demolishers_destroyed); + *data << uint32(((BattleGroundSAScore*)itr->second)->gates_destroyed); + break; case BATTLEGROUND_DS: // wotlk case BATTLEGROUND_RV: // wotlk case BATTLEGROUND_IC: // wotlk @@ -1534,7 +1534,7 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI { if (!isAnyArenaEnabled()) // it's checked in handler but just to be sure return NULL; - uint8 size = m_EnabledArenas.size() - 1; + uint8 size = m_EnabledArenas.size() - 1; bgTypeId = m_EnabledArenas[urand(0,size)]; bg_template = GetBattleGroundTemplate(bgTypeId); if (!bg_template) @@ -1781,7 +1781,7 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution() { sLog.outDebug("Initializing Automatic Arena Point Distribution"); uint64 wstime = sWorld.getWorldState(WS_ARENA_DISTRIBUTION_TIME); - + if (!wstime) { sLog.outDebug("Battleground: Next arena point distribution time not found, reseting it now."); diff --git a/src/game/BattleGroundSA.cpp b/src/game/BattleGroundSA.cpp index ec39710a2c6..33630f340df 100644 --- a/src/game/BattleGroundSA.cpp +++ b/src/game/BattleGroundSA.cpp @@ -52,7 +52,7 @@ void BattleGroundSA::Reset() bool BattleGroundSA::SetupBattleGround() { - return ResetObjs(); + return ResetObjs(); } bool BattleGroundSA::ResetObjs() @@ -66,7 +66,7 @@ bool BattleGroundSA::ResetObjs() for(uint8 i = 0; i < BG_SA_MAXNPC; i++) DelCreature(i); - + for(uint8 i = BG_SA_MAXNPC; i < BG_SA_MAXNPC + BG_SA_MAX_GY; i++) DelCreature(i); @@ -93,7 +93,7 @@ bool BattleGroundSA::ResetObjs() } OverrideGunFaction(); - + for(uint8 i = 0; i <= BG_SA_TITAN_RELIC; i++) { SpawnBGObject(i, RESPAWN_IMMEDIATELY); @@ -125,7 +125,7 @@ bool BattleGroundSA::ResetObjs() { sLog.outError("SOTA: Can't find GY entry %u",BG_SA_GYEntries[i]); return false; - } + } if(i == BG_SA_BEACH_GY) { @@ -143,7 +143,7 @@ bool BattleGroundSA::ResetObjs() //GY capture points for(uint8 i = BG_SA_CENTRAL_FLAG; i < BG_SA_MAXOBJ; i++) { - AddObject(i, BG_SA_ObjEntries[i] - (attackers == TEAM_ALLIANCE ? 1:0), + AddObject(i, BG_SA_ObjEntries[i] - (attackers == TEAM_ALLIANCE ? 1:0), BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], 0,0,0,0,RESPAWN_ONE_DAY); @@ -154,21 +154,21 @@ bool BattleGroundSA::ResetObjs() UpdateWorldState(BG_SA_RIGHT_GY_HORDE , GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE?1:0 ); UpdateWorldState(BG_SA_LEFT_GY_HORDE , GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE?1:0 ); UpdateWorldState(BG_SA_CENTER_GY_HORDE , GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE?1:0 ); - + UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE , GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE?1:0 ); UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE , GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE?1:0 ); UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE , GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE?1:0 ); - + if(attackers == TEAM_ALLIANCE) { UpdateWorldState(BG_SA_ALLY_ATTACKS, 1); UpdateWorldState(BG_SA_HORDE_ATTACKS, 0); - + UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_ALL, 1); UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_ALL, 1); UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 0); UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_HRD, 0); - + UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN,1); UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN,0); } @@ -176,7 +176,7 @@ bool BattleGroundSA::ResetObjs() { UpdateWorldState(BG_SA_HORDE_ATTACKS, 1); UpdateWorldState(BG_SA_ALLY_ATTACKS, 0); - + UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_ALL, 0); UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_ALL, 0); UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 1); @@ -192,7 +192,7 @@ bool BattleGroundSA::ResetObjs() UpdateWorldState(BG_SA_GREEN_GATEWS, 1); UpdateWorldState(BG_SA_YELLOW_GATEWS, 1); UpdateWorldState(BG_SA_ANCIENT_GATEWS, 1); - + TeleportPlayers(); return true; } @@ -265,7 +265,7 @@ void BattleGroundSA::Update(uint32 diff) { RoundScores[1].time = TotalTime; RoundScores[1].winner = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE; - + if (RoundScores[0].time == RoundScores[1].time) EndBattleGround(NULL); else if(RoundScores[0].time < RoundScores[1].time) @@ -339,12 +339,12 @@ void BattleGroundSA::AddPlayer(Player *plr) if(plr->GetTeamId() == attackers) { plr->CastSpell(plr,12438,true);//Without this player falls before boat loads... - + if(urand(0,1)) plr->TeleportTo(607, 2682.936f, -830.368f, 50.0f, 2.895f, 0); else plr->TeleportTo(607, 2577.003f, 980.261f, 50.0f, 0.807f, 0); - + } else plr->TeleportTo(607, 1209.7f, -65.16f, 70.1f, 0.0f, 0); @@ -408,11 +408,11 @@ void BattleGroundSA::TeleportPlayers() if(plr->GetTeamId() == attackers) { plr->CastSpell(plr,12438,true); //Without this player falls before boat loads... - + if(urand(0,1)) plr->TeleportTo(607, 2682.936f, -830.368f, 50.0f, 2.895f, 0); else - plr->TeleportTo(607, 2577.003f, 980.261f, 50.0f, 0.807f, 0); + plr->TeleportTo(607, 2577.003f, 980.261f, 50.0f, 0.807f, 0); } else plr->TeleportTo(607, 1209.7f, -65.16f, 70.1f, 0.0f, 0); @@ -464,13 +464,13 @@ void BattleGroundSA::OverrideGunFaction() { if(!m_BgCreatures[0]) return; - + for(uint8 i = BG_SA_GUN_1; i <= BG_SA_GUN_10;i++) { if(Creature* gun = GetBGCreature(i)) gun->setFaction(BG_SA_Factions[attackers? TEAM_ALLIANCE : TEAM_HORDE]); } - + for(uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_4;i++) { if(Creature* dem = GetBGCreature(i)) @@ -513,7 +513,7 @@ void BattleGroundSA::DestroyGate(uint32 i, Player* pl) ASSERT(false); break; } - + if(i < 5) DelObject(i+9); UpdateWorldState(uws, GateStatus[i]); @@ -598,7 +598,7 @@ void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i) case BG_SA_LEFT_CAPTURABLE_GY: SpawnBGObject(BG_SA_LEFT_FLAG,RESPAWN_ONE_DAY); npc = BG_SA_NPC_RIGSPARK; - AddCreature(BG_SA_NpcEntries[npc], npc, attackers, + AddCreature(BG_SA_NpcEntries[npc], npc, attackers, BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1], BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]); UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0)); @@ -607,7 +607,7 @@ void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i) case BG_SA_RIGHT_CAPTURABLE_GY: SpawnBGObject(BG_SA_RIGHT_FLAG, RESPAWN_ONE_DAY); npc = BG_SA_NPC_SPARKLIGHT; - AddCreature(BG_SA_NpcEntries[npc], npc, attackers, + AddCreature(BG_SA_NpcEntries[npc], npc, attackers, BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1], BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]); UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0)); @@ -668,7 +668,7 @@ void BattleGroundSA::EndBattleGround(uint32 winner) RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); else if (winner == HORDE) RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); - + //complete map_end rewards (even if no team wins) RewardHonorToTeam(GetBonusHonorFromKill(2), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(2), HORDE); diff --git a/src/game/BattleGroundSA.h b/src/game/BattleGroundSA.h index e695b75dab5..01a76ab7a1a 100644 --- a/src/game/BattleGroundSA.h +++ b/src/game/BattleGroundSA.h @@ -61,14 +61,14 @@ enum BG_SA_WorldStates BG_SA_TIMER_SEC_DECS = 3561, BG_SA_ALLY_ATTACKS = 4352, BG_SA_HORDE_ATTACKS = 4353, - + BG_SA_PURPLE_GATEWS = 3614, BG_SA_RED_GATEWS = 3617, BG_SA_BLUE_GATEWS = 3620, BG_SA_GREEN_GATEWS = 3623, BG_SA_YELLOW_GATEWS = 3638, BG_SA_ANCIENT_GATEWS = 3849, - + BG_SA_LEFT_GY_ALLIANCE = 3635, BG_SA_RIGHT_GY_ALLIANCE = 3636, @@ -112,7 +112,7 @@ enum BG_SA_NPCs BG_SA_MAXNPC }; -const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] = +const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] = { 27894, 27894, @@ -134,18 +134,18 @@ const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] = 29262, }; -const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC][4] = +const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC][4] = { //Cannons - { 1436.429f, 110.05f, 41.407f, 5.4f }, + { 1436.429f, 110.05f, 41.407f, 5.4f }, { 1404.9023f, 84.758f, 41.183f, 5.46f }, - { 1068.693f, -86.951f, 93.81f, 0.02f }, + { 1068.693f, -86.951f, 93.81f, 0.02f }, { 1068.83f, -127.56f, 96.45f, 0.0912f }, - { 1422.115f, -196.433f, 42.1825f, 1.0222f }, + { 1422.115f, -196.433f, 42.1825f, 1.0222f }, { 1454.887f, -220.454f, 41.956f, 0.9627f }, - { 1232.345f, -187.517f, 66.945f, 0.45f }, + { 1232.345f, -187.517f, 66.945f, 0.45f }, { 1249.634f, -224.189f, 66.72f, 0.635f }, - { 1236.213f, 92.287f, 64.965f, 5.751f }, + { 1236.213f, 92.287f, 64.965f, 5.751f }, { 1215.11f, 57.772f, 64.739f, 5.78f } , //Demolishers { 1611.597656,-117.270073,8.719355,2.513274}, @@ -182,7 +182,7 @@ enum BG_SA_Objects BG_SA_MAXOBJ }; -const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = +const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = { { 1411.57f, 108.163f, 28.692f, 5.441f }, { 1055.452f, -108.1f, 82.134f, 0.034f }, @@ -234,17 +234,17 @@ const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ] = 192834, 193182, 193185, - 192687, - 192685, - 192689, - 192690, + 192687, + 192685, + 192689, + 192690, 192691, 191311, 191311, 191311, 191310, 191306, - 191308, + 191308, }; const uint32 BG_SA_Factions[2] = @@ -333,7 +333,7 @@ class BattleGroundSA : public BattleGround BG_SA_GateState GateStatus[6]; BG_SA_Status status; TeamId GraveyardStatus[BG_SA_MAX_GY]; - BG_SA_RoundScore RoundScores[2]; + BG_SA_RoundScore RoundScores[2]; bool TimerEnabled; }; #endif diff --git a/src/game/CombatAI.cpp b/src/game/CombatAI.cpp index 625fb1adcba..0f330b216bb 100644 --- a/src/game/CombatAI.cpp +++ b/src/game/CombatAI.cpp @@ -258,7 +258,7 @@ void TurretAI::UpdateAI(const uint32 diff) AOEAI::AOEAI(Creature *c) : CreatureAI(c) { - ASSERT(me->m_spells[0]); + ASSERT(me->m_spells[0]); me->SetVisibility(VISIBILITY_ON);//visible to see all spell anims me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);//can't be targeted me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1);//can't be damaged diff --git a/src/game/Creature.h b/src/game/Creature.h index 4d74e03d60f..737da768302 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -529,7 +529,7 @@ class Creature : public Unit, public GridObject<Creature> bool lootForPickPocketed; bool lootForBody; Player *GetLootRecipient() const; - bool hasLootRecipient() const { return m_lootRecipient != 0; } + bool hasLootRecipient() const { return m_lootRecipient != 0; } bool isTappedBy(Player *player) const; // return true if the creature is tapped by the player or a member of his party. void SetLootRecipient (Unit* unit); @@ -638,7 +638,7 @@ class Creature : public Unit, public GridObject<Creature> void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; } bool IsReputationGainDisabled() { return DisableReputationGain; } - bool IsDamageEnoughForLootingAndReward() const { return m_PlayerDamageReq == 0; } + bool IsDamageEnoughForLootingAndReward() const { return m_PlayerDamageReq == 0; } void LowerPlayerDamageReq(uint32 unDamage) { if(m_PlayerDamageReq) diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp index 503c7ce033d..1451cf46d6f 100644 --- a/src/game/CreatureAI.cpp +++ b/src/game/CreatureAI.cpp @@ -107,7 +107,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature) // scripts does not take care about MoveInLineOfSight loops // MoveInLineOfSight can be called inside another MoveInLineOfSight and cause stack overflow void CreatureAI::MoveInLineOfSight_Safe(Unit *who) -{ +{ if(m_MoveInLineOfSight_locked == true) return; m_MoveInLineOfSight_locked = true; diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index 6ae5472b8d0..e1203ef35cc 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -582,13 +582,13 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { m_creature->addUnitState(UNIT_STAT_MELEE_ATTACKING); m_creature->SendMeleeAttackStart(victim); - } + } if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE) m_creature->GetMotionMaster()->MoveChase(victim, AttackDistance, AttackAngle); // Targeted movement generator will start melee automatically, no need to send it explicitly } } else - { + { if (m_creature->isInCombat()) { Unit* victim = m_creature->getVictim(); @@ -596,7 +596,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { m_creature->clearUnitState(UNIT_STAT_MELEE_ATTACKING); m_creature->SendMeleeAttackStop(victim); - } + } if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) m_creature->GetMotionMaster()->MoveIdle(); } diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index f0cfec6e40b..38192d92ee8 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -337,7 +337,7 @@ void LoadDBCStores(const std::string& dataPath) if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS) assert(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestXPStore, dbcPath,"QuestXP.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestXPStore, dbcPath,"QuestXP.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestFactionRewardStore, dbcPath,"QuestFactionReward.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sRandomPropertiesPointsStore, dbcPath,"RandPropPoints.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatDistributionStore, dbcPath,"ScalingStatDistribution.dbc"); diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 4b1598a211c..7c3c7c9fca4 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1487,7 +1487,7 @@ struct SpellEntry //float unk_320_4[3]; // 235-237 3.2.0 //uint32 spellDescriptionVariableID; // 238 3.2.0 //uint32 SpellDifficultyId; // 239 3.3.0 - /* + /* flag96 EffectSpellClassMask[MAX_SPELL_EFFECTS]; // 127-136 uint32 SpellVisual[2]; // 137-138 m_spellVisualID uint32 SpellIconID; // 139 m_spellIconID diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 1e71eb7159d..ac2c4b8ada4 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -92,7 +92,7 @@ bool DynamicObject::Create(uint32 guidlow, Unit *caster, uint32 spellId, const P // The lower word of DYNAMICOBJECT_BYTES must be 0x0001. This value means that the visual radius will be overriden // by client for most of the "ground patch" visual effect spells and a few "skyfall" ones like Hurricane. // If any other value is used, the client will _always_ use the radius provided in DYNAMICOBJECT_RADIUS, but - // precompensation is necessary (eg radius *= 2) for many spells. Anyway, blizz sends 0x0001 for all the spells + // precompensation is necessary (eg radius *= 2) for many spells. Anyway, blizz sends 0x0001 for all the spells // I saw sniffed... SetUInt32Value( DYNAMICOBJECT_BYTES, 0x00000001 ); SetUInt32Value( DYNAMICOBJECT_SPELLID, spellId ); @@ -166,7 +166,7 @@ int32 DynamicObject::GetDuration() const if (!m_aura) return m_duration; else - return m_aura->GetDuration(); + return m_aura->GetDuration(); } void DynamicObject::SetDuration(int32 newDuration) diff --git a/src/game/Group.cpp b/src/game/Group.cpp index e53e65ee6d0..62ace59bffa 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -565,10 +565,10 @@ void Group::SendLooter(Creature *pCreature, Player *pLooter) { assert(pCreature); - WorldPacket data(SMSG_LOOT_LIST, (8+8)); + WorldPacket data(SMSG_LOOT_LIST, (8+8)); data << uint64(pCreature->GetGUID()); data << uint8(0); // unk1 - + if (pLooter) data.append(pLooter->GetPackGUID()); else @@ -628,12 +628,12 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) RollId.push_back(r); - if (Creature* creature = dynamic_cast<Creature *>(pLootedObject)) + if (Creature* creature = dynamic_cast<Creature *>(pLootedObject)) { creature->m_groupLootTimer = 60000; creature->lootingGroupLeaderGUID = GetLeaderGUID(); } - else if (GameObject* go = dynamic_cast<GameObject *>(pLootedObject)) + else if (GameObject* go = dynamic_cast<GameObject *>(pLootedObject)) { go->m_groupLootTimer = 60000; go->lootingGroupLeaderGUID = GetLeaderGUID(); @@ -693,7 +693,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) RollId.push_back(r); - if (Creature* creature = dynamic_cast<Creature *>(pLootedObject)) + if (Creature* creature = dynamic_cast<Creature *>(pLootedObject)) { creature->m_groupLootTimer = 60000; creature->lootingGroupLeaderGUID = GetLeaderGUID(); @@ -924,7 +924,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers) // remove is_blocked so that the item is lootable by all players LootItem *item = &(roll->getLoot()->items[roll->itemSlot]); - if (item) + if (item) item->is_blocked = false; } RollId.erase(rollI); @@ -1022,7 +1022,7 @@ void Group::SendUpdate() if (citr->guid == citr2->guid) continue; Player* member = objmgr.GetPlayer(citr2->guid); - + uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE; onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0); @@ -1334,7 +1334,7 @@ bool Group::_setMainTank(const uint64 &guid, const bool &apply) RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINTANK); // Remove main tank flag from current if any. ToggleGroupMemberFlag(slot, MEMBER_FLAG_MAINTANK, apply); // And apply main tank flag on new main tank. - + if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE group_member SET memberFlags='%u' WHERE memberGuid='%u'", slot->flags, GUID_LOPART(guid)); return true; @@ -1412,7 +1412,7 @@ void Group::ChangeMembersGroup(Player *player, const uint8 &group) // If the RR player is not yet set for the group, the first group member becomes the round-robin player. // If the RR player is set, the next player in group becomes the round-robin player. // -// If ifneed is true, +// If ifneed is true, // the current RR player is checked to be near the looted object. // if yes, no update done. // if not, he looses his turn. diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index 3cf0b99906e..188fbf9cebc 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -234,7 +234,7 @@ bool Guild::LoadGuildFromDB(QueryResult_AutoPtr guildDataResult) } bool Guild::CheckGuildStructure() -{ +{ // Repair the structure of guild // If the guildmaster doesn't exist or isn't the member of guild // attempt to promote another member @@ -359,7 +359,7 @@ bool Guild::LoadMembersFromDB(QueryResult_AutoPtr guildMembersResult) if (guildId > m_Id) //we loaded all members for this guild already, break cycle break; - + MemberSlot newmember; uint64 guid = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER); newmember.RankId = fields[2].GetUInt32(); diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp index a56ff683378..e5d846b6130 100644 --- a/src/game/InstanceSaveMgr.cpp +++ b/src/game/InstanceSaveMgr.cpp @@ -675,7 +675,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b SetResetTimeFor(mapid, difficulty, next_reset); ScheduleReset(true, time_t(next_reset-3600), InstResetEvent(1, mapid, difficulty, -1)); - + // update it in the DB CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%d' AND difficulty = '%d'", next_reset, mapid, difficulty); } diff --git a/src/game/Item.cpp b/src/game/Item.cpp index 4a70e9340ce..f2971b98dc6 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -248,7 +248,7 @@ Item::Item( ) m_lootGenerated = false; mb_in_trade = false; m_lastPlayedTimeUpdate = time(NULL); - + m_refundRecipient = 0; m_paidMoney = 0; m_paidExtendedCost = 0; @@ -277,7 +277,7 @@ bool Item::Create( uint32 guidlow, uint32 itemid, Player const* owner) SetUInt32Value(ITEM_FIELD_FLAGS, itemProto->Flags); SetUInt32Value(ITEM_FIELD_DURATION, abs(itemProto->Duration)); - + SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, 0); return true; @@ -418,7 +418,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result SetOwnerGUID(owner_guid); need_save = true; } - + if (need_save) // normal item changed state set not work at loading { std::ostringstream ss; @@ -638,7 +638,7 @@ void Item::SetState(ItemUpdateState state, Player *forplayer) // new items must stay in new state until saved if (uState != ITEM_NEW) uState = state; - + AddToUpdateQueueOf(forplayer); } else @@ -748,8 +748,8 @@ uint32 Item::GetEnchantRequiredLevel() const if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) if (enchantEntry->requiredLevel > level) level = enchantEntry->requiredLevel; - - return level; + + return level; } bool Item::IsBoundByEnchant() const @@ -834,7 +834,7 @@ void Item::SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration, Player* return; SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET,duration); - SetState(ITEM_CHANGED, owner); + SetState(ITEM_CHANGED, owner); // Cannot use GetOwner() here, has to be passed as an argument to avoid freeze due to hashtable locking } @@ -1061,7 +1061,7 @@ void Item::SaveRefundDataToDB() ss << GetPaidMoney() << ","; ss << GetPaidExtendedCost(); ss << ")"; - + CharacterDatabase.Execute(ss.str().c_str()); } @@ -1079,12 +1079,12 @@ void Item::SetNotRefundable(Player *owner, bool changestate) // Following is not applicable in the trading procedure if (changestate) SetState(ITEM_CHANGED, owner); - + SetRefundRecipient(0); SetPaidMoney(0); SetPaidExtendedCost(0); - DeleteRefundDataFromDB(); - + DeleteRefundDataFromDB(); + owner->DeleteRefundReference(GetGUID()); } diff --git a/src/game/Item.h b/src/game/Item.h index f1fd798d1e8..33018faefb8 100644 --- a/src/game/Item.h +++ b/src/game/Item.h @@ -330,11 +330,11 @@ class Item : public Object uint32 GetRefundRecipient() { return m_refundRecipient; } uint32 GetPaidMoney() { return m_paidMoney; } uint32 GetPaidExtendedCost() { return m_paidExtendedCost; } - + void UpdatePlayedTime(Player *owner); uint32 GetPlayedTime(); bool IsRefundExpired(); - + void BuildUpdate(UpdateDataMapType& ); private: diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 5c577c87afa..8d7b06227c3 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -1361,13 +1361,13 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) // This function call unsets ITEM_FLAGS_REFUNDABLE if played time is over 2 hours. item->UpdatePlayedTime(GetPlayer()); - + if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE)) { sLog.outDebug("Item refund: item not refundable!"); return; } - + if (GetPlayer()->GetGUIDLow() != item->GetRefundRecipient()) // Formerly refundable item got traded { sLog.outDebug("Item refund: item was traded!"); @@ -1381,7 +1381,7 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) sLog.outDebug("Item refund: cannot find extendedcost data."); return; } - + WorldPacket data(SMSG_ITEM_REFUND_INFO_RESPONSE, 8+4+4+4+4*4+4*4+4+4); data << uint64(guid); // item guid data << uint32(item->GetPaidMoney()); // money cost @@ -1432,14 +1432,14 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) item->SetNotRefundable(GetPlayer()); return; } - + ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(item->GetPaidExtendedCost()); if (!iece) { sLog.outDebug("Item refund: cannot find extendedcost data."); return; } - + uint32 moneyRefund = item->GetPaidMoney(); bool store_error = false; @@ -1447,7 +1447,7 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) { uint32 count = iece->reqitemcount[i]; uint32 itemid = iece->reqitem[i]; - + if (count && itemid) { ItemPosCountVec dest; @@ -1457,9 +1457,9 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) store_error = true; break; } - } + } } - + if (store_error) { WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4); @@ -1487,7 +1487,7 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) // Destroy item _player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); - + // Grant back extendedcost items for (uint8 i = 0; i < 5; ++i) { @@ -1502,7 +1502,7 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) _player->SendNewItem(it, count, true, false, true); } } - + // Grant back money if (moneyRefund) _player->ModifyMoney(moneyRefund); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 5a86f6082d6..d1293c710ae 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -1461,7 +1461,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char *args) SetSentErrorMessage(true); return false; } - + // Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1 if (gmRealmID == -1) { @@ -1487,7 +1487,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char *args) loginDatabase.PExecute("DELETE FROM account_access WHERE id = '%u'", targetAccountId); else loginDatabase.PExecute("DELETE FROM account_access WHERE id = '%u' AND (RealmID = '%d' OR RealmID = '-1')", targetAccountId, realmID); - + if (gm != 0) loginDatabase.PExecute("INSERT INTO account_access VALUES ('%u','%d','%d')", targetAccountId, gm, realmID); PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm); @@ -5361,7 +5361,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args) } CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin); - + ObjectAccessor::Guard guard(*HashMapHolder<Player>::GetLock()); HashMapHolder<Player>::MapType const& plist = ObjectAccessor::Instance().GetPlayers(); for (HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) @@ -6867,7 +6867,7 @@ bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/) bool ChatHandler::HandleGMListFullCommand(const char* /*args*/) { ///- Get the accounts with GM Level >0 - QueryResult_AutoPtr result = loginDatabase.Query("SELECT a.username,aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel > 0"); + QueryResult_AutoPtr result = loginDatabase.Query("SELECT a.username,aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel > 0"); if(result) { SendSysMessage(LANG_GMLIST); diff --git a/src/game/LootHandler.cpp b/src/game/LootHandler.cpp index 57c233ffe72..1b7ee1940c8 100644 --- a/src/game/LootHandler.cpp +++ b/src/game/LootHandler.cpp @@ -445,7 +445,7 @@ void WorldSession::DoLootRelease(uint64 lguid) pCreature->SetLootRecipient(NULL); loot->clear(); } - else + else { // if the round robin player release, reset it. if (player->GetGUID() == loot->roundRobinPlayer) diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 7c4bb2d219c..755d3c06a6f 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -784,7 +784,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) slot_type = LOOT_SLOT_TYPE_ROLL_ONGOING; else if (l.roundRobinPlayer == 0 || !l.items[i].is_underthreshold || lv.viewer->GetGUID() == l.roundRobinPlayer) { - // no round robin owner or he has released the loot + // no round robin owner or he has released the loot // or it IS the round robin group owner // => item is lootable slot_type = LOOT_SLOT_TYPE_ALLOW_LOOT; diff --git a/src/game/Map.cpp b/src/game/Map.cpp index dc20e33047c..dae351d5eff 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -360,7 +360,7 @@ void Map::EnsureGridLoadedAtEnter(const Cell &cell, Player *player) { EnsureGridLoaded(cell); - NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); + NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); assert( grid != NULL ); if (player) diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index f138b42c486..13dc0a39fa2 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -564,7 +564,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) _player->m_movementInfo = mi; - /* + /* ReadMovementInfo(recv_data, &_player->m_mover->m_movementInfo);*/ _player->ExitVehicle(); } @@ -574,7 +574,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) sLog.outDebug("WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); recv_data.hexlike(); - Unit* vehicle_base = GetPlayer()->GetVehicleBase(); + Unit* vehicle_base = GetPlayer()->GetVehicleBase(); if(!vehicle_base) return; diff --git a/src/game/Object.h b/src/game/Object.h index a780898b499..c7a1ca76bf7 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -397,9 +397,9 @@ struct Position void GetPosition(float &x, float &y, float &z, float &o) const { x = m_positionX; y = m_positionY; z = m_positionZ; o = m_orientation; } void GetPosition(Position *pos) const - { - if (pos) - pos->Relocate(m_positionX, m_positionY, m_positionZ, m_orientation); + { + if (pos) + pos->Relocate(m_positionX, m_positionY, m_positionZ, m_orientation); } bool IsPositionValid() const; @@ -423,7 +423,7 @@ struct Position float GetAngle(const Position *pos) const; float GetAngle(float x, float y) const; - float GetRelativeAngle(const Position *pos) const + float GetRelativeAngle(const Position *pos) const { return GetAngle(pos) - m_orientation; } float GetRelativeAngle(float x, float y) const { return GetAngle(x, y) - m_orientation; } void GetSinCos(float x, float y, float &vsin, float &vcos) const; @@ -532,27 +532,27 @@ class WorldObject : public Object, public WorldLocation virtual const char* GetNameForLocaleIdx(int32 /*locale_idx*/) const { return GetName(); } float GetDistance(const WorldObject *obj) const - { + { float d = GetExactDist(obj) - GetObjectSize() - obj->GetObjectSize(); return d > 0.0f ? d : 0.0f; } float GetDistance(const Position &pos) const - { + { float d = GetExactDist(&pos) - GetObjectSize(); return d > 0.0f ? d : 0.0f; } float GetDistance(float x, float y, float z) const - { + { float d = GetExactDist(x, y, z) - GetObjectSize(); return d > 0.0f ? d : 0.0f; } float GetDistance2d(const WorldObject* obj) const - { + { float d = GetExactDist2d(obj) - GetObjectSize() - obj->GetObjectSize(); return d > 0.0f ? d : 0.0f; } float GetDistance2d(float x, float y) const - { + { float d = GetExactDist2d(x, y) - GetObjectSize(); return d > 0.0f ? d : 0.0f; } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index b0429804f44..d237e044395 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -3285,7 +3285,7 @@ void ObjectMgr::LoadGuilds() { Guild *newGuild; uint32 count = 0; - + // 0 1 2 3 4 5 6 QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT guild.guildid,guild.name,leaderguid,EmblemStyle,EmblemColor,BorderStyle,BorderColor," // 7 8 9 10 11 12 @@ -4083,8 +4083,8 @@ void ObjectMgr::LoadQuests() sLog.outErrorDb("Quest %u has `RewRepFaction%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(),j+1,qinfo->RewRepFaction[j] ,qinfo->RewRepFaction[j] ); qinfo->RewRepFaction[j] = 0; // quest will not reward this } - } - + } + else if(qinfo->RewRepValue[j]!=0) { @@ -6745,28 +6745,28 @@ void ObjectMgr::LoadPointsOfInterest() void ObjectMgr::LoadQuestPOI() { uint32 count = 0; - + // 0 1 2 3 QueryResult_AutoPtr result = WorldDatabase.Query("SELECT questId, id, objIndex, mapid, WorldMapAreaId, FloorId, unk3, unk4 FROM quest_poi order by questId"); - + if(!result) { barGoLink bar(1); - + bar.step(); - + sLog.outString(); sLog.outErrorDb(">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); return; } - + barGoLink bar(result->GetRowCount()); - + do { Field *fields = result->Fetch(); bar.step(); - + uint32 questId = fields[0].GetUInt32(); uint32 id = fields[1].GetUInt32(); int32 objIndex = fields[2].GetInt32(); @@ -6777,9 +6777,9 @@ void ObjectMgr::LoadQuestPOI() uint32 unk4 = fields[7].GetUInt32(); QuestPOI POI(id, objIndex, mapId, WorldMapAreaId, FloorId, unk3, unk4); - + QueryResult_AutoPtr points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND id='%i'", questId, id); - + if(points) { do @@ -6791,12 +6791,12 @@ void ObjectMgr::LoadQuestPOI() POI.points.push_back(point); } while (points->NextRow()); } - + mQuestPOIMap[questId].push_back(POI); - + ++count; } while (result->NextRow()); - + sLog.outString(); sLog.outString(">> Loaded %u quest POI definitions", count); } @@ -8209,7 +8209,7 @@ bool ObjectMgr::AddSpellToTrainer(int32 entry, int32 spell, Field *fields, std:: if (trainerSpell.learnedSpell[0] == spell) trainerSpell.learnedSpell[0] = 0; // player must be able to cast spell on himself - if (spellinfo->EffectImplicitTargetA[i] != 0 && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_TARGET_ALLY + if (spellinfo->EffectImplicitTargetA[i] != 0 && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_TARGET_ALLY && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_TARGET_ANY && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_CASTER) { sLog.outErrorDb("Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry); diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 0657040e9fd..72271a75d7b 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -712,12 +712,12 @@ void Pet::GivePetXP(uint32 xp) // Subtract newXP from amount needed for nextlevel newXP -= nextLvlXP; GivePetLevel(level+1); - SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(level+1)*PET_XP_FACTOR); + SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(level+1)*PET_XP_FACTOR); // Make sure we're working with the upgraded levels for the pet XP-levels level = getLevel(); nextLvlXP = GetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP); - + // Hitting the pet/playerlevel combolimitation, set UNIT_FIELD_PETEXPERIENCE (current XP) to 0 if ( level >= GetOwner()->getLevel() ) { newXP = 0; diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 38cfd65fa83..227c8ee2331 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -58,7 +58,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) sLog.outError("HandlePetAction.Pet %u isn't pet of player %s.", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName() ); return; } - + if (!pet->isAlive()) return; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 1e629a9fb1a..390d94e861f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -7956,7 +7956,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) bool groupRules = (group && go->GetGOInfo()->type == GAMEOBJECT_TYPE_CHEST && go->GetGOInfo()->chest.groupLootRules); // check current RR player and get next if necessary - if (groupRules) + if (groupRules) group->UpdateLooterGuid(go, true); loot->FillLoot(lootid, LootTemplates_Gameobject, this, !groupRules, false, go->GetLootMode()); @@ -8012,7 +8012,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) break; } } - else + else permission = ALL_PERMISSION; } } @@ -11597,7 +11597,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) RemoveEnchantmentDurations(pItem); RemoveItemDurations(pItem); - + pItem->SetNotRefundable(this); ItemRemovedQuestCheck( pItem->GetEntry(), pItem->GetCount() ); @@ -14088,7 +14088,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver if (pQuest->GetRewArenaPoints()) ModifyArenaPoints(pQuest->GetRewArenaPoints()); - + // Send reward mail if (uint32 mail_template_id = pQuest->GetRewMailTemplateId()) MailDraft(mail_template_id).SendMailTo(this, questGiver, MAIL_CHECK_MASK_NONE, pQuest->GetRewMailDelaySecs()); @@ -15540,11 +15540,11 @@ float Player::GetFloatValueFromDB(uint16 index, uint64 guid) bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) { - //// 0 1 2 3 4 5 6 7 8 9 10 11 12 + //// 0 1 2 3 4 5 6 7 8 9 10 11 12 //QueryResult *result = CharacterDatabase.PQuery("SELECT guid, account, data, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags," - // 13 14 15 16 17 18 19 20 21 22 23 24 25 + // 13 14 15 16 17 18 19 20 21 22 23 24 25 //"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost," - // 26 27 28 29 30 31 32 33 34 35 36 37 38 39 + // 26 27 28 29 30 31 32 33 34 35 36 37 38 39 //"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty," // 40 41 42 43 44 45 46 47 48 49 50 //"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk," @@ -15600,7 +15600,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) SetUInt32Value(UNIT_FIELD_LEVEL, fields[7].GetUInt8()); SetUInt32Value(PLAYER_XP, fields[8].GetUInt32()); - + uint32 money = fields[9].GetUInt32(); if (money > MAX_MONEY_AMOUNT) money = MAX_MONEY_AMOUNT; @@ -16189,7 +16189,7 @@ bool Player::isAllowedToLoot(const Creature* creature) // or if there are free/quest/conditional item for the player if (loot->roundRobinPlayer == 0 || loot->roundRobinPlayer == GetGUID()) return true; - + return loot->hasItemFor(this); case GROUP_LOOT: case NEED_BEFORE_GREED: @@ -16429,13 +16429,13 @@ void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff) item->GetGUIDLow(), GetGUIDLow()); if (!result2) { - sLog.outDebug("Item::LoadFromDB, " + sLog.outDebug("Item::LoadFromDB, " "Item GUID: %u has field flags & ITEM_FLAGS_REFUNDABLE but has no data in item_refund_instance, removing flag.", item->GetGUIDLow()); RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE); } else - { + { fields = result2->Fetch(); item->SetRefundRecipient(fields[0].GetUInt32()); item->SetPaidMoney(fields[1].GetUInt32()); @@ -16444,7 +16444,7 @@ void Player::_LoadInventory(QueryResult_AutoPtr result, uint32 timediff) } } } - + bool success = true; if (!bag_guid) @@ -17363,7 +17363,7 @@ void Player::SaveToDB() ss << (uint64)m_deathExpireTime << ", '"; ss << m_taxi.SaveTaxiDestinationsToString() << "', "; - + ss << GetArenaPoints() << ", "; ss << GetHonorPoints() << ", "; @@ -17539,11 +17539,11 @@ void Player::_SaveInventory() { iPtr->UpdatePlayedTime(this); continue; - } + } else { sLog.outError("Can't find item guid " UI64FMTD " but is in refundable storage for player %u ! Removing.", (*itr), GetGUIDLow()); - m_refundableItems.erase(itr); + m_refundableItems.erase(itr); } } @@ -19368,7 +19368,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint } ModifyMoney( -(int32)price ); - + if (crItem->ExtendedCost) // case for new honor system { ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost); @@ -19396,7 +19396,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint data << uint32(count); GetSession()->SendPacket(&data); SendNewItem(it, pProto->BuyCount*count, true, false, false); - + if (it->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE) && crItem->ExtendedCost) { it->SetRefundRecipient(GetGUIDLow()); diff --git a/src/game/Player.h b/src/game/Player.h index 29e279ec7bd..460de713491 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1189,7 +1189,7 @@ class Player : public Unit, public GridObject<Player> uint8 _CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const; uint8 _CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item *pItem = NULL, bool swap = false, uint32* no_space_count = NULL ) const; - + void AddRefundReference(uint64 it); void DeleteRefundReference(uint64 it); diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp index 6a148b58d66..6a63102ccce 100644 --- a/src/game/PoolHandler.cpp +++ b/src/game/PoolHandler.cpp @@ -255,7 +255,7 @@ void PoolGroup<T>::SpawnObject(SpawnedPoolData& spawns, uint32 limit, uint32 tri int count = limit - spawns.GetSpawnedObjects(poolId); // If triggered from some object respawn this object is still marked as spawned - // and also counted into m_SpawnedPoolAmount so we need increase count to be + // and also counted into m_SpawnedPoolAmount so we need increase count to be // spawned by 1 if (triggerFrom) ++count; diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index e6647fce9ac..b23b77a8be2 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -476,29 +476,29 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) { uint32 count; recv_data >> count; // quest count, max=25 - + if(count >= MAX_QUEST_LOG_SIZE) return; - + WorldPacket data(SMSG_QUEST_POI_QUERY_RESPONSE, 4+(4+4)*count); data << uint32(count); // count - + for(int i = 0; i < count; ++i) { uint32 questId; recv_data >> questId; // quest id - + bool questOk = false; - + uint16 questSlot = _player->FindQuestSlot(questId); - + if(questSlot != MAX_QUEST_LOG_SIZE) questOk =_player->GetQuestSlotQuestId(questSlot) == questId; - + if(questOk) { QuestPOIVector const *POI = objmgr.GetQuestPOIVector(questId); - + if(POI) { data << uint32(questId); // quest ID @@ -514,7 +514,7 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) data << uint32(itr->Unk3); // unknown data << uint32(itr->Unk4); // unknown data << uint32(itr->points.size()); // POI points count - + for(std::vector<QuestPOIPoint>::const_iterator itr2 = itr->points.begin(); itr2 != itr->points.end(); ++itr2) { data << int32(itr2->x); // POI point x @@ -534,6 +534,6 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) data << uint32(0); // POI count } } - + SendPacket(&data); }
\ No newline at end of file diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp index 95e54e18ec8..97ff3024bb5 100644 --- a/src/game/QuestDef.cpp +++ b/src/game/QuestDef.cpp @@ -65,52 +65,52 @@ Quest::Quest(Field * questRecord) RequestItemsText = questRecord[38].GetCppString(); EndText = questRecord[39].GetCppString(); CompletedText = questRecord[40].GetCppString(); - + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) ObjectiveText[i] = questRecord[41+i].GetCppString(); - + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) ReqItemId[i] = questRecord[45+i].GetUInt32(); - + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) ReqItemCount[i] = questRecord[51+i].GetUInt32(); - + for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) ReqSourceId[i] = questRecord[57+i].GetUInt32(); - + for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) ReqSourceCount[i] = questRecord[61+i].GetUInt32(); - + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) ReqCreatureOrGOId[i] = questRecord[65+i].GetInt32(); - + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) ReqCreatureOrGOCount[i] = questRecord[69+i].GetUInt32(); - + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) ReqSpell[i] = questRecord[73+i].GetUInt32(); - + for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) RewChoiceItemId[i] = questRecord[77+i].GetUInt32(); - + for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) RewChoiceItemCount[i] = questRecord[83+i].GetUInt32(); - + for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) RewItemId[i] = questRecord[89+i].GetUInt32(); - + for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) RewItemCount[i] = questRecord[93+i].GetUInt32(); - + for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) RewRepFaction[i] = questRecord[97+i].GetUInt32(); - + for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) RewRepValueId[i] = questRecord[102+i].GetInt32(); - + for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) RewRepValue[i] = questRecord[107+i].GetInt32(); - + RewHonorableKills = questRecord[112].GetUInt32(); RewHonorMultiplier = questRecord[113].GetFloat(); RewOrReqMoney = questRecord[114].GetInt32(); @@ -123,22 +123,22 @@ Quest::Quest(Field * questRecord) PointX = questRecord[121].GetFloat(); PointY = questRecord[122].GetFloat(); PointOpt = questRecord[123].GetUInt32(); - + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) DetailsEmote[i] = questRecord[124+i].GetUInt32(); - + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) DetailsEmoteDelay[i] = questRecord[128+i].GetUInt32(); - + IncompleteEmote = questRecord[132].GetUInt32(); CompleteEmote = questRecord[133].GetUInt32(); - + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) OfferRewardEmote[i] = questRecord[134+i].GetInt32(); - + for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) OfferRewardEmoteDelay[i] = questRecord[138+i].GetInt32(); - + QuestStartScript = questRecord[142].GetUInt32(); QuestCompleteScript = questRecord[143].GetUInt32(); @@ -184,7 +184,7 @@ uint32 Quest::XPValue( Player *pPlayer ) const xpentry = sQuestXPStore.LookupEntry(quest_level); if(!xpentry) return 0; - + int diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20; if (diffFactor < 1) diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index 0f2836c161e..ae412f61b5d 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -35,11 +35,11 @@ struct TSpellSummary { ScriptMgr::ScriptMgr() { - + } ScriptMgr::~ScriptMgr() { - + } void ScriptMgr::ScriptsInit() diff --git a/src/game/ScriptMgr.h b/src/game/ScriptMgr.h index 056dd712fdb..a9965b2766a 100644 --- a/src/game/ScriptMgr.h +++ b/src/game/ScriptMgr.h @@ -37,7 +37,7 @@ struct Script pOnGetMoney(NULL), pOnPlayerChat(NULL), pOnServerStartup(NULL), pOnServerShutdown(NULL), pOnAreaChange(NULL), pOnItemClick(NULL), pOnItemOpen(NULL), pOnGoClick(NULL), pOnCreatureKill(NULL), pGossipHello(NULL), pQuestAccept(NULL), pGossipSelect(NULL), pGossipSelectWithCode(NULL), - pGOSelect(NULL), pGOSelectWithCode(NULL), + pGOSelect(NULL), pGOSelectWithCode(NULL), pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), pChooseReward(NULL), pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pItemQuestAccept(NULL), pGOQuestAccept(NULL), pGOChooseReward(NULL),pItemUse(NULL), pItemExpire(NULL), @@ -96,10 +96,10 @@ class ScriptMgr public: ScriptMgr(); ~ScriptMgr(); - + void ScriptsInit(); void LoadDatabase(); - char const* ScriptsVersion(); + char const* ScriptsVersion(); //event handlers void OnLogin(Player *pPlayer); diff --git a/src/game/ScriptedCreature.h b/src/game/ScriptedCreature.h index 9174db84435..ff7495c9bd6 100644 --- a/src/game/ScriptedCreature.h +++ b/src/game/ScriptedCreature.h @@ -170,8 +170,8 @@ struct ScriptedAI : public CreatureAI bool EnterEvadeIfOutOfCombatArea(const uint32 uiDiff); // return true for heroic mode. i.e. - // - for dungeon in mode 10-heroic, - // - for raid in mode 10-Heroic + // - for dungeon in mode 10-heroic, + // - for raid in mode 10-Heroic // - for raid in mode 25-heroic // DO NOT USE to check raid in mode 25-normal. bool IsHeroic() { return m_heroicMode; } @@ -228,7 +228,7 @@ struct ScriptedAI : public CreatureAI private: bool m_bCombatMovement; uint32 m_uiEvadeCheckCooldown; - + bool m_heroicMode; Difficulty m_difficulty; }; diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 5b170092cd2..f0d3992fa73 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -815,11 +815,11 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const * triggeredByAura) m_procEx= PROC_EX_NONE; // Hunter trap spells - activation proc for Lock and Load, Entrapment and Misdirection - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && + if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && (m_spellInfo->SpellFamilyFlags[0] & 0x18 || // Freezing and Frost Trap, Freezing Arrow m_spellInfo->Id == 57879 || // Snake Trap - done this way to avoid double proc m_spellInfo->SpellFamilyFlags[2] & 0x00024000)) // Explosive and Immolation Trap - + m_procAttacker |= PROC_FLAG_ON_TRAP_ACTIVATION; /* @@ -1210,7 +1210,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_triggeredByAuraSpell); // Failed Pickpocket, reveal rogue - if (missInfo == SPELL_MISS_RESIST + if (missInfo == SPELL_MISS_RESIST && m_customAttr & SPELL_ATTR_CU_PICKPOCKET && unitTarget->GetTypeId() == TYPEID_UNIT) { @@ -1371,7 +1371,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool if(m_originalCaster) { - if (m_spellAura = Aura::TryCreate(aurSpellInfo, effectMask, unit, + if (m_spellAura = Aura::TryCreate(aurSpellInfo, effectMask, unit, m_originalCaster,(aurSpellInfo == m_spellInfo)? &m_currentBasePoints[0] : &basePoints[0], m_CastItem)) { // Now Reduce spell duration using data received at spell hit @@ -2981,7 +2981,7 @@ void Spell::cast(bool skipCheck) } // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()... - SendSpellGo(); + SendSpellGo(); // Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells if (m_spellInfo->speed > 0.0f && !IsChanneledSpell(m_spellInfo) || m_spellInfo->Id == 14157) @@ -3609,9 +3609,9 @@ void Spell::SendSpellGo() && m_spellInfo->powerType != POWER_HEALTH ) castFlags |= CAST_FLAG_POWER_LEFT_SELF; // should only be sent to self, but the current messaging doesn't make that possible - if((m_caster->GetTypeId() == TYPEID_PLAYER) - && (m_caster->getClass() == CLASS_DEATH_KNIGHT) - && m_spellInfo->runeCostID + if((m_caster->GetTypeId() == TYPEID_PLAYER) + && (m_caster->getClass() == CLASS_DEATH_KNIGHT) + && m_spellInfo->runeCostID && m_spellInfo->powerType == POWER_RUNE) { castFlags |= CAST_FLAG_UNKNOWN_19; // same as in SMSG_SPELL_START @@ -3640,7 +3640,7 @@ void Spell::SendSpellGo() if ((m_spellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION) && m_targets.HasSrc()) m_targets.setTargetMask(m_targets.getTargetMask() | TARGET_FLAG_SOURCE_LOCATION); - else + else m_targets.setTargetMask(m_targets.getTargetMask() & ~TARGET_FLAG_SOURCE_LOCATION); if ((m_spellInfo->Targets & TARGET_FLAG_DEST_LOCATION) && m_targets.HasDst()) @@ -4588,7 +4588,7 @@ SpellCastResult Spell::CheckCast(bool strict) // Lay on Hands - cannot be self-cast on paladin with Forbearance or after using Avenging Wrath if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags[0] & 0x0008000) if (target->HasAura(61988)) // Immunity shield marker - return SPELL_FAILED_TARGET_AURASTATE; + return SPELL_FAILED_TARGET_AURASTATE; } } @@ -4644,7 +4644,7 @@ SpellCastResult Spell::CheckCast(bool strict) } */ - if(target) + if(target) if(IsPositiveSpell(m_spellInfo->Id)) if(target->IsImmunedToSpell(m_spellInfo)) return SPELL_FAILED_TARGET_AURASTATE; @@ -5216,11 +5216,11 @@ SpellCastResult Spell::CheckCast(bool strict) { if (m_caster->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_DONT_REPORT; - + Unit* target = m_targets.getUnitTarget(); if (!target || target->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_BAD_TARGETS; - + if (!m_caster->ToPlayer()->IsInSameRaidWith(target->ToPlayer())) return SPELL_FAILED_TARGET_NOT_IN_RAID; @@ -6106,7 +6106,7 @@ SpellCastResult Spell::CheckItems() if (pProto->Spells[x].SpellCharges != 0 && pitem->GetSpellCharges(x) == pProto->Spells[x].SpellCharges) return SPELL_FAILED_ITEM_AT_MAX_CHARGES; } - break; + break; } default: break; diff --git a/src/game/Spell.h b/src/game/Spell.h index d615f224f8c..71815d4eef4 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -61,7 +61,7 @@ enum SpellCastTargetFlags TARGET_FLAG_CORPSE = 0x00008000, // pguid, resurrection spells TARGET_FLAG_UNK2 = 0x00010000, // pguid, not used in any spells as of 3.2.2a (can be set dynamically) TARGET_FLAG_GLYPH = 0x00020000, // used in glyph spells - TARGET_FLAG_UNK3 = 0x00040000, // + TARGET_FLAG_UNK3 = 0x00040000, // TARGET_FLAG_UNK4 = 0x00080000 // uint32, loop { vec3, guid -> if guid == 0 break } }; @@ -161,7 +161,7 @@ class SpellCastTargets uint32 getTargetMask() const { return m_targetMask; } void setTargetMask(uint32 newMask) { m_targetMask = newMask; } uint32 getIntTargetFlags() const { return m_intTargetFlags; } - + uint64 getUnitTargetGUID() const { return m_unitTargetGUID; } Unit *getUnitTarget() const { return m_unitTarget; } void setUnitTarget(Unit *target); @@ -460,7 +460,7 @@ class Spell void HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i); void HandleThreatSpells(uint32 spellId); - + const SpellEntry * const m_spellInfo; int32 m_currentBasePoints[3]; // cache SpellEntry::EffectBasePoints and use for set custom base points Item* m_CastItem; diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp index 7d107203c94..02a25fd3f6e 100644 --- a/src/game/SpellAuraEffects.cpp +++ b/src/game/SpellAuraEffects.cpp @@ -41,7 +41,7 @@ class Aura; // // EFFECT HANDLER NOTES -// +// // in aura handler there should be check for modes: // AURA_EFFECT_HANDLE_REAL set - aura mod is just applied/removed on the target // AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK set - aura is just applied/removed, or aura packet request is made @@ -504,8 +504,8 @@ int32 AuraEffect::CalculateAmount(Unit * caster) // Borrowed Time if (AuraEffect const * aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_PRIEST, 2899, 1)) bonus += aurEff->GetAmount() / 100; - - DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(GetSpellProto())) * bonus; + + DoneActualBenefit = caster->SpellBaseHealingBonus(GetSpellSchoolMask(GetSpellProto())) * bonus; } break; case SPELLFAMILY_PALADIN: @@ -1119,7 +1119,7 @@ void AuraEffect::UpdatePeriodic(Unit * caster) break; } break; - case SPELLFAMILY_MAGE: + case SPELLFAMILY_MAGE: if (GetId() == 55342)// Mirror Image m_isPeriodic = false; break; @@ -1859,7 +1859,7 @@ void AuraEffect::PeriodicDummyTick(Unit * target, Unit * caster) const target->RemoveAurasDueToSpell(31665); break; // Killing Spree - case 51690: + case 51690: { // TODO: this should use effect[1] of 51690 UnitList targets; @@ -4119,7 +4119,7 @@ void AuraEffect::HandleModMechanicImmunity(AuraApplication const * aurApp, uint8 target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, GetMiscValue(), apply); break; } - + if (apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) target->RemoveAurasWithMechanic(mechanic, AURA_REMOVE_BY_DEFAULT, GetId()); } @@ -5508,7 +5508,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo { float currentGroundLevel = target->GetBaseMap()->GetHeight(target->GetPositionX(), target->GetPositionY(), MAX_HEIGHT); if (target->GetPositionZ() > currentGroundLevel) - target->GetMotionMaster()->MoveFall(currentGroundLevel); + target->GetMotionMaster()->MoveFall(currentGroundLevel); } break; case 46699: // Requires No Ammo @@ -5864,7 +5864,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo { if (target->m_form != FORM_CAT) break; - + target->CastSpell(target, spellId, true, NULL, NULL, GetCasterGUID()); break; } @@ -6006,7 +6006,7 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const * aurApp, uint8 mo //Adding items uint32 noSpaceForCount = 0; uint32 count = m_amount; - + ItemPosCountVec dest; uint8 msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellProto()->EffectItemType[m_effIndex], count, &noSpaceForCount); if( msg != EQUIP_ERR_OK ) @@ -6152,7 +6152,7 @@ void AuraEffect::HandleAuraConvertRune(AuraApplication const * aurApp, uint8 mod continue; if(!plr->GetRuneCooldown(i)) { - // ConvertRune(i, + // ConvertRune(i, plr->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this); --runes; } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index e98a904bd3b..fe4732035f3 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -35,7 +35,7 @@ #include "GridNotifiersImpl.h" #include "CellImpl.h" -AuraApplication::AuraApplication(Unit * target, Unit * caster, Aura * aura, uint8 effMask) +AuraApplication::AuraApplication(Unit * target, Unit * caster, Aura * aura, uint8 effMask) : m_target(target), m_base(aura), m_slot(MAX_AURAS), m_flags(AFLAG_NONE), m_needClientUpdate(false) , m_removeMode(AURA_REMOVE_NONE), m_effectsToApply(effMask) { @@ -445,7 +445,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply) targetsToRemove.push_back(appIter->second->GetTarget()); else { - // needs readding - remove now, will be applied in next update cycle + // needs readding - remove now, will be applied in next update cycle // (dbcs do not have auras which apply on same type of targets but have different radius, so this is not really needed) if (appIter->second->GetEffectMask() != existing->second) targetsToRemove.push_back(appIter->second->GetTarget()); @@ -527,7 +527,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply) // targets have to be registered and not have effect applied yet to use this function void Aura::_ApplyEffectForTargets(uint8 effIndex) { - Unit * caster = GetCaster(); + Unit * caster = GetCaster(); // prepare list of aura targets UnitList targetList; for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter) @@ -617,7 +617,7 @@ void Aura::Update(uint32 diff, Unit * caster) else { Remove(); - return; + return; } } } @@ -715,9 +715,9 @@ bool Aura::IsPassive() const return IsPassiveSpell(GetSpellProto()); } -bool Aura::IsDeathPersistent() const +bool Aura::IsDeathPersistent() const { - return IsDeathPersistentSpell(GetSpellProto()); + return IsDeathPersistentSpell(GetSpellProto()); } bool Aura::CanBeSaved() const @@ -768,7 +768,7 @@ bool Aura::IsVisible() const // Is this blizzlike? show totem passive auras if (GetOwner()->GetTypeId() == TYPEID_UNIT && m_owner->ToCreature()->isTotem() && IsPassive()) return true; - return !IsPassive() || HasEffectType(SPELL_AURA_ABILITY_IGNORE_AURASTATE); + return !IsPassive() || HasEffectType(SPELL_AURA_ABILITY_IGNORE_AURASTATE); } void Aura::UnregisterSingleTarget() @@ -899,7 +899,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, { case 31571: spellId = 57529; break; case 31572: spellId = 57531; break; - default: + default: sLog.outError("Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId()); } if(spellId) @@ -1251,7 +1251,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, target->CastSpell(target, GetEffect(0)->GetAmount(), true, NULL, GetEffect(0)); break; } - break; + break; } } @@ -1457,7 +1457,7 @@ void Aura::_DeleteRemovedApplications() } UnitAura::UnitAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID) - : Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID) + : Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID) { m_AuraDRGroup = DIMINISHING_NONE; GetUnitOwner()->_AddAura(this, caster); @@ -1567,7 +1567,7 @@ void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit * caster) } DynObjAura::DynObjAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID) - : Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID) + : Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID) { GetDynobjOwner()->SetAura(this); } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index f0f24b9a2e6..71067e8f5d9 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1514,7 +1514,7 @@ void Spell::EffectDummy(uint32 i) // Glyph of Eternal Water if (unitTarget->HasAura(70937)) unitTarget->CastSpell(unitTarget, 70908, true); - else + else unitTarget->CastSpell(unitTarget, 70907, true); } } @@ -2198,7 +2198,7 @@ void Spell::EffectTriggerSpellWithValue(uint32 i) int32 bp = damage; Unit * caster = GetTriggeredSpellCaster(spellInfo, m_caster, unitTarget); - + caster->CastCustomSpell(unitTarget,triggered_spell_id,&bp,&bp,&bp,true); } @@ -2240,7 +2240,7 @@ void Spell::EffectForceCast(uint32 i) { case 52588: // Skeletal Gryphon Escape case 48598: // Ride Flamebringer Cue - unitTarget->RemoveAura(damage); + unitTarget->RemoveAura(damage); break; case 52463: // Hide In Mine Car case 52349: // Overtake @@ -5720,10 +5720,10 @@ void Spell::EffectScriptEffect(uint32 effIndex) { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) return; - + if (roll_chance_i(50)) // chance unknown, using 50 return; - + static uint32 const spellPlayer[5] = { 45674, // Bigger! @@ -5732,7 +5732,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) 45682, // Ghost 45684 // Polymorph }; - + static uint32 const spellTarget[5] = { 45673, // Bigger! 45672, // Shrunk @@ -5740,7 +5740,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) 45681, // Ghost 45683 // Polymorph }; - + m_caster->CastSpell(m_caster, spellPlayer[urand(0,4)], true); unitTarget->CastSpell(unitTarget, spellTarget[urand(0,4)], true); break; diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 08234a3547c..c952ef0763b 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -877,7 +877,7 @@ class SpellMgr bool IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const; - SpellSpellGroupMapBounds GetSpellSpellGroupMapBounds(uint32 spell_id) const + SpellSpellGroupMapBounds GetSpellSpellGroupMapBounds(uint32 spell_id) const { spell_id = GetFirstSpellInChain(spell_id); return SpellSpellGroupMapBounds(mSpellSpellGroup.lower_bound(spell_id),mSpellSpellGroup.upper_bound(spell_id)); @@ -893,16 +893,16 @@ class SpellMgr return false; } - SpellGroupSpellMapBounds GetSpellGroupSpellMapBounds(SpellGroup group_id) const + SpellGroupSpellMapBounds GetSpellGroupSpellMapBounds(SpellGroup group_id) const { return SpellGroupSpellMapBounds(mSpellGroupSpell.lower_bound(group_id),mSpellGroupSpell.upper_bound(group_id)); } - void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set<uint32>& foundSpells) const + void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set<uint32>& foundSpells) const { std::set<SpellGroup> usedGroups; GetSetOfSpellsInSpellGroup(group_id, foundSpells, usedGroups); } - void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set<uint32>& foundSpells, std::set<SpellGroup>& usedGroups) const + void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set<uint32>& foundSpells, std::set<SpellGroup>& usedGroups) const { if (usedGroups.find(group_id) != usedGroups.end()) return; @@ -1066,16 +1066,16 @@ class SpellMgr return 0; } - SpellRequiredMapBounds GetSpellsRequiredForSpellBounds(uint32 spell_id) const - { + SpellRequiredMapBounds GetSpellsRequiredForSpellBounds(uint32 spell_id) const + { return SpellRequiredMapBounds(mSpellReq.lower_bound(spell_id),mSpellReq.upper_bound(spell_id)); } - SpellsRequiringSpellMapBounds GetSpellsRequiringSpellBounds(uint32 spell_id) const - { + SpellsRequiringSpellMapBounds GetSpellsRequiringSpellBounds(uint32 spell_id) const + { return SpellsRequiringSpellMapBounds(mSpellsReqSpell.lower_bound(spell_id),mSpellsReqSpell.upper_bound(spell_id)); } - bool IsSpellRequiringSpell(uint32 spellid, uint32 req_spellid) const + bool IsSpellRequiringSpell(uint32 spellid, uint32 req_spellid) const { SpellsRequiringSpellMapBounds spellsRequiringSpell = GetSpellsRequiringSpellBounds(req_spellid); for (SpellsRequiringSpellMap::const_iterator itr = spellsRequiringSpell.first; itr != spellsRequiringSpell.second; ++itr) @@ -1280,10 +1280,10 @@ class SpellMgr uint32 GetSpellRequired(uint32 spell_id) const { SpellRequiredMap::const_iterator itr = mSpellReq.find(spell_id); - + if(itr == mSpellReq.end()) return NULL; - + return itr->second; } diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 81a8a0abc60..114bd95837e 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -927,7 +927,7 @@ bool Guardian::UpdateStats(Stats stat) // Handle Death Knight Glyphs and Talents float mod = 0.75f; if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH)) - { + { switch (stat) { case STAT_STAMINA: mod = 0.3f; break; // Default Owner's Stamina scale diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e01776a58f0..49dbaec1475 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6754,7 +6754,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger for (ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr) { if ((*itr)->GetEntry() != 2630) continue; - + caster = (*itr); break; } @@ -8554,7 +8554,7 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const sLog.outError("Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction()); else if (const Creature *creature = ToCreature()) sLog.outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureInfo()->Entry, getFaction()); - else + else sLog.outError("Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction()); guid = GetGUID(); @@ -10982,7 +10982,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att { // Merciless Combat if ((*i)->GetSpellProto()->SpellIconID == 2656) - { + { if ((pVictim->GetMaxHealth() * 35 / 100) >= pVictim->GetHealth()) DoneTotalMod *= (100.0f+(*i)->GetAmount())/100.0f; } @@ -11367,7 +11367,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) this->ToCreature()->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); if (enemy) - { + { if (IsAIEnabled) { this->ToCreature()->AI()->EnterCombat(enemy); @@ -11915,7 +11915,7 @@ void Unit::SetHover(bool on) void Unit::setDeathState(DeathState s) { - // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that + // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that // it can be used to check creation of death items (such as soul shards). DeathState oldDeathState = m_deathState; m_deathState = s; @@ -14317,7 +14317,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER) { bool allow = false; - + if (pVictim) allow = ToPlayer()->isHonorOrXPTarget(pVictim); @@ -14587,7 +14587,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold,creature->GetCreatureInfo()->maxgold); } - + player->RewardPlayerAndGroupAtKill(pVictim); } diff --git a/src/game/Unit.h b/src/game/Unit.h index a827f1681c8..2dc15c4422c 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1852,7 +1852,7 @@ class Unit : public WorldObject static Creature* GetCreature(WorldObject& object, uint64 guid); MotionMaster* GetMotionMaster(){ return &i_motionMaster; } - + bool IsStopped() const { return !(hasUnitState(UNIT_STAT_MOVING)); } void StopMoving(); diff --git a/src/game/World.cpp b/src/game/World.cpp index 6ab59cd9fb5..08f75214eee 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1147,7 +1147,7 @@ void World::LoadConfigSettings(bool reload) m_visibility_notify_periodOnContinents = sConfig.GetIntDefault("Visibility.Notify.Period.OnContinents", DEFAULT_VISIBILITY_NOTIFY_PERIOD); m_visibility_notify_periodInInstances = sConfig.GetIntDefault("Visibility.Notify.Period.InInstances", DEFAULT_VISIBILITY_NOTIFY_PERIOD); - m_visibility_notify_periodInBGArenas = sConfig.GetIntDefault("Visibility.Notify.Period.InBGArenas", DEFAULT_VISIBILITY_NOTIFY_PERIOD); + m_visibility_notify_periodInBGArenas = sConfig.GetIntDefault("Visibility.Notify.Period.InBGArenas", DEFAULT_VISIBILITY_NOTIFY_PERIOD); ///- Read the "Data" directory from the config file std::string dataPath = sConfig.GetStringDefault("DataDir","./"); @@ -2593,7 +2593,7 @@ void World::UpdateAreaDependentAuras() } void World::LoadWorldStates() -{ +{ QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT entry, value FROM worldstates"); if (!result) diff --git a/src/game/World.h b/src/game/World.h index 87450bc4828..2b92c01b68c 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -683,7 +683,7 @@ class World float rate_values[MAX_RATES]; uint32 m_configs[CONFIG_VALUE_COUNT]; typedef std::map<uint32,uint64> WorldStatesMap; - WorldStatesMap m_worldstates; + WorldStatesMap m_worldstates; int32 m_playerLimit; AccountTypes m_allowedSecurityLevel; LocaleConstant m_defaultDbcLocale; // from config for one from loaded DBC locales diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index b0e524718e4..7865068b912 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -411,7 +411,7 @@ int WorldSocket::Update (void) if (m_TimeOutTime && time(NULL) >= m_TimeOutTime) return -1; - + if (m_OutActive || m_OutBuffer->length () == 0) return 0; @@ -837,7 +837,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) locale = LOCALE_enUS; // Checks gmlevel per Realm - result = + result = loginDatabase.PQuery ("SELECT " "RealmID, " //0 "gmlevel " //1 @@ -1064,7 +1064,7 @@ int WorldSocket::iSendPartialPacket(WorldPacket& pct) if (m_OutBuffer->copy((char*) (pct.contents() + pct.rpos()), remainingLen) == -1) ACE_ASSERT (false); - return 1; // some byte written and packet completed + return 1; // some byte written and packet completed } bool WorldSocket::iFlushPacketQueue() @@ -1076,7 +1076,7 @@ bool WorldSocket::iFlushPacketQueue() { int result = iSendPartialPacket(*pct); - if (result != 0) + if (result != 0) { // some bytes were written haveone = true; diff --git a/src/game/WorldSocket.h b/src/game/WorldSocket.h index a10a5e47f40..f7163be55d9 100644 --- a/src/game/WorldSocket.h +++ b/src/game/WorldSocket.h @@ -175,7 +175,7 @@ class WorldSocket : protected WorldHandler /// Need to be called with m_OutBufferLock lock held int iSendPacket (const WorldPacket& pct); - /// Try to write WorldPacket to m_OutBuffer even partially, + /// Try to write WorldPacket to m_OutBuffer even partially, /// Need to be called with m_OutBufferLock lock held int iSendPartialPacket(WorldPacket& pct); @@ -232,8 +232,8 @@ class WorldSocket : protected WorldHandler bool m_OutActive; uint32 m_Seed; - - /// The defined time where the socket will be forced to close. This is + + /// The defined time where the socket will be forced to close. This is /// to detect and close idle connections. time_t m_TimeOutTime; }; |