From 7436eccc50bd8cc51508defd3589f9947802f355 Mon Sep 17 00:00:00 2001 From: theluda Date: Tue, 14 Nov 2006 07:54:42 +0000 Subject: [PATCH] [2656] Applied MaNGOS coding style (see trunk/bcpp.cfg). --- src/game/AuctionHouse.cpp | 2 +- src/game/CharacterHandler.cpp | 4 ++-- src/game/Chat.cpp | 7 +++++-- src/game/GameObject.cpp | 11 ++++++----- src/game/GridNotifiers.cpp | 13 ++++++++----- src/game/Level1.cpp | 1 - src/game/Level3.cpp | 5 ++--- src/game/LootMgr.cpp | 14 +++++++------- src/game/Mail.cpp | 9 ++++++--- src/game/Map.cpp | 3 +-- src/game/MapManager.h | 2 +- src/game/MovementHandler.cpp | 19 +++++++++++++------ src/game/Object.cpp | 28 ++++++++++++++++++---------- src/game/Object.h | 2 +- src/game/ObjectDefines.h | 2 +- src/game/ObjectMgr.h | 2 +- src/game/Player.cpp | 28 ++++++++++++++++------------ src/game/Player.h | 3 +-- src/game/SharedDefines.h | 3 ++- src/game/Spell.cpp | 12 ++++++------ src/game/SpellAuras.cpp | 10 +++++----- src/game/TaxiHandler.cpp | 4 +--- src/game/Unit.cpp | 10 +++++----- src/game/World.cpp | 6 ++---- src/game/WorldSocket.cpp | 6 +++--- src/mangosd/CliRunnable.cpp | 2 +- src/mangosd/Master.cpp | 2 +- src/shared/Database/DBCStructure.h | 4 +--- 28 files changed, 117 insertions(+), 97 deletions(-) diff --git a/src/game/AuctionHouse.cpp b/src/game/AuctionHouse.cpp index 44a661a8..556e7284 100644 --- a/src/game/AuctionHouse.cpp +++ b/src/game/AuctionHouse.cpp @@ -475,7 +475,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data ) pl->RemoveItem( (pos >> 8),(pos & 255), true); it->SaveToDB(); sDatabase.PExecute("INSERT INTO `auctionhouse` (`id`,`auctioneerguid`,`itemguid`,`item_template`,`itemowner`,`buyoutprice`,`time`,`buyguid`,`lastbid`,`location`) " - "VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '" I64FMTD "', '%u', '%u', '%u')", + "VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '" I64FMTD "', '%u', '%u', '%u')", AH->Id, AH->auctioneer, AH->item_guidlow, AH->item_id, AH->owner, AH->buyout, AH->time, AH->bidder, AH->bid, AH->location); pl->SaveToDB(); diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index 9023fa5d..40318cb5 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -500,11 +500,11 @@ void WorldSession::HandlePlayerLoginOpcode( WorldPacket & recv_data ) ObjectAccessor::Instance().InsertPlayer(pCurrChar); sLog.outDebug("Player %s added to Map.",pCurrChar->GetName()); - if (pCurrChar->m_transport) { + if (pCurrChar->m_transport) + { pCurrChar->TeleportTo(pCurrChar->m_transport->GetMapId(), pCurrChar->m_transport->GetPositionX(), pCurrChar->m_transport->GetPositionY(), pCurrChar->m_transport->GetPositionZ(), pCurrChar->m_transport->GetOrientation(), true); } - sDatabase.PExecute("UPDATE `character` SET `online` = 1 WHERE `guid` = '%u'", pCurrChar->GetGUIDLow()); loginDatabase.PExecute("UPDATE `account` SET `online` = 1 WHERE `id` = '%u'", GetAccountId()); plr->SetInGameTime( getMSTime() ); diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index e7f51fcb..edcc7ded 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -30,8 +30,11 @@ #include "MapManager.h" #include "Policies/SingletonImp.h" -LanguageDesc lang_description[LANGUAGES_COUNT] = { - { LANG_UNIVERSAL, 0, 0 }, // LANG_GLOBAL/LANG_UNIVERSAL = 0 +LanguageDesc lang_description[LANGUAGES_COUNT] = +{ + { // LANG_GLOBAL/LANG_UNIVERSAL = 0 + LANG_UNIVERSAL, 0, 0 + }, { LANG_ORCISH, 669, SKILL_LANG_ORCISH }, { LANG_DARNASSIAN, 671, SKILL_LANG_DARNASSIAN }, { LANG_TAURAHE, 670, SKILL_LANG_TAURAHE }, diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index f6af1fbd..74b2a9c0 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -94,7 +94,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, uint32 mapid, float x, f SetFloatValue(GAMEOBJECT_POS_Y, y); SetFloatValue(GAMEOBJECT_POS_Z, z); SetFloatValue(GAMEOBJECT_FACING, ang); //this is not facing angle - + SetFloatValue (GAMEOBJECT_ROTATION, rotation0); SetFloatValue (GAMEOBJECT_ROTATION+1, rotation1); SetFloatValue (GAMEOBJECT_ROTATION+2, rotation2); @@ -119,7 +119,8 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, uint32 mapid, float x, f void GameObject::Update(uint32 p_time) { - if (GUID_HIPART(GetGUID()) == HIGHGUID_TRANSPORT) { + if (GUID_HIPART(GetGUID()) == HIGHGUID_TRANSPORT) + { //((Transport*)this)->Update(p_time); return; } @@ -260,7 +261,7 @@ bool GameObject::LoadFromDB(uint32 guid, QueryResult *result) { bool external = (result != NULL); if (!external) - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 result = sDatabase.PQuery("SELECT `id`,`map`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`loot`,`respawntimer`,`animprogress`,`guid` FROM `gameobject` WHERE `guid` = '%u'", guid); if( !result ) @@ -281,9 +282,9 @@ bool GameObject::LoadFromDB(uint32 guid, QueryResult *result) float rotation1 = fields[7].GetFloat(); float rotation2 = fields[8].GetFloat(); float rotation3 = fields[9].GetFloat(); - + uint32 animprogress = fields[12].GetUInt32(); - + if (!Create(guid,entry, map_id, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress) ) { if (!external) delete result; diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp index 4d7208f3..fdda0fd7 100644 --- a/src/game/GridNotifiers.cpp +++ b/src/game/GridNotifiers.cpp @@ -57,9 +57,10 @@ PlayerNotifier::BuildForMySelf() { WorldPacket packet; UpdateData data; - + Transport *t = i_player.GetTransport(); - if (t) { + if (t) + { t->BuildCreateUpdateBlockForPlayer(&data, &i_player); } @@ -72,11 +73,13 @@ PlayerNotifier::BuildForMySelf() // Hack to send out transports WorldPacket packet2; UpdateData transData; - if (MapManager::Instance().m_TransportsByMap.find(i_player.GetMapId()) != MapManager::Instance().m_TransportsByMap.end()) { + if (MapManager::Instance().m_TransportsByMap.find(i_player.GetMapId()) != MapManager::Instance().m_TransportsByMap.end()) + { uint32 m = i_player.GetMapId(); for (int i = 0; - i < MapManager::Instance().m_TransportsByMap[i_player.GetMapId()].size(); - i++) { + i < MapManager::Instance().m_TransportsByMap[i_player.GetMapId()].size(); + i++) + { Transport *t = MapManager::Instance().m_TransportsByMap[i_player.GetMapId()][i]; t->BuildCreateUpdateBlockForPlayer(&transData, &i_player); } diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index a8aac51e..2055459b 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -1377,4 +1377,3 @@ bool ChatHandler::HandleSaveAllCommand(const char* args) SendSysMessage(LANG_PLAYERS_SAVED); return true; } - diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 79551248..3bec129f 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -2746,7 +2746,8 @@ bool ChatHandler::HandleShutDownCommand(const char* args) return true; } -bool ChatHandler::HandleOutOfRange(const char* args) { +bool ChatHandler::HandleOutOfRange(const char* args) +{ char* plowguid = strtok((char*)args, " "); if(!plowguid) @@ -2769,5 +2770,3 @@ bool ChatHandler::HandleOutOfRange(const char* args) { // TODO Add a commando "Illegal name" to set playerflag |= 32; // maybe do'able with a playerclass m_Illegal_name = false - - diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 1e8d19f1..95cf3681 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -123,16 +123,16 @@ struct HasChance float RolledChance[MaxLootGroups]; float CumulativeChance[MaxLootGroups]; - explicit HasChance(LootStore* _store) : m_store(_store) + explicit HasChance(LootStore* _store) : m_store(_store) { for (int i=0; i < MaxLootGroups; i++) CumulativeChance[i] = 0.0; } - + LootStoreItem* operator() ( LootStoreItem& itm ) { // Quest loot handled separately - if (itm.questChanceOrGroup > 0) + if (itm.questChanceOrGroup > 0) return NULL; // Non-grouped loot @@ -153,7 +153,7 @@ struct HasChance } if (itm.chance >= 0) { - // Group of current loot - check for item chance in the group + // Group of current loot - check for item chance in the group if (CumulativeChance[GroupId] == 0.0) RolledChance[GroupId] = rand_chance(); if (CumulativeChance[GroupId] >= RolledChance[GroupId]) @@ -185,7 +185,7 @@ struct HasChance } }; - struct HasQuestChance +struct HasQuestChance { // explicit HasQuestChanceFor() : {} inline bool operator() ( LootStoreItem &itm ) { return itm.questChanceOrGroup > rand_chance(); } @@ -213,9 +213,9 @@ void FillLoot(Player* player, Loot *loot, uint32 loot_id, LootStore& store) for(LootStoreItemList::iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) { // There are stats of count variations for 100% drop - so urand used - if ( loot->quest_items.size() < MAX_NR_QUEST_ITEMS && hasQuestChance(*item_iter) ) + if ( loot->quest_items.size() < MAX_NR_QUEST_ITEMS && hasQuestChance(*item_iter) ) loot->quest_items.push_back(LootItem(*item_iter, urand(1, item_iter->maxcount))); - else if ( loot->items.size() < MAX_NR_LOOT_ITEMS ) + else if ( loot->items.size() < MAX_NR_LOOT_ITEMS ) { LootStoreItem* LootedItem = hasChance(*item_iter); if ( LootedItem ) diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index 711ca42d..8f84d911 100644 --- a/src/game/Mail.cpp +++ b/src/game/Mail.cpp @@ -139,7 +139,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data ) pl->ModifyMoney( -30 - money ); - uint32 item_id = it ? it->GetEntry() : 0; //item prototype + uint32 item_id = it ? it->GetEntry() : 0; //item prototype time_t etime = base + DAY * ((COD > 0)? 3 : 30); //time if COD 3 days, if no COD 30 days @@ -151,10 +151,13 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data ) m->receiver = GUID_LOPART(rc); m->subject = subject; m->body = body; - if (it) { // if item attachment exists + if (it) // if item attachment exists + { m->item_id = item_id; m->item_guidlow = GUID_LOPART(item); - } else { + } + else + { m->item_id = 0; m->item_guidlow = 0; } diff --git a/src/game/Map.cpp b/src/game/Map.cpp index b3ff882e..170dc229 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -26,7 +26,7 @@ #include "Map.h" #include "GridNotifiersImpl.h" #include "Config/ConfigEnv.h" -#include "Transports.h" +#include "Transports.h" #define DEFAULT_GRID_EXPIRY 300 #define MAX_GRID_LOAD_TIME 50 @@ -1059,4 +1059,3 @@ template DynamicObject* Map::GetObjectNear(Object const &obj, OBJECT_HANDLE hdl) template DynamicObject* Map::GetObjectNear(float x, float y, OBJECT_HANDLE hdl); template Corpse* Map::GetObjectNear(Object const &obj, OBJECT_HANDLE hdl); template Corpse* Map::GetObjectNear(float x, float y, OBJECT_HANDLE hdl); - diff --git a/src/game/MapManager.h b/src/game/MapManager.h index 3c504255..a970f35d 100644 --- a/src/game/MapManager.h +++ b/src/game/MapManager.h @@ -67,7 +67,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton m_Transports; map > m_TransportsByMap; - + private: MapManager(); ~MapManager(); diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 62fca914..09fe614c 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -126,16 +126,20 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) recv_data >> flags >> time; recv_data >> x >> y >> z >> orientation; - if (flags & 0x2000000) { // Transport GUID present + if (flags & 0x2000000) // Transport GUID present + { // if we boarded a transport, add us to it uint32 tGUIDl, tGUIDh; float tX, tY, tZ, tO; recv_data >> tGUIDl >> tGUIDh; recv_data >> tX >> tY >> tZ >> tO; - if (!GetPlayer()->m_transport) { - for (vector::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); iter++) { - if ((*iter)->GetGUIDLow() == tGUIDl) { + if (!GetPlayer()->m_transport) + { + for (vector::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); iter++) + { + if ((*iter)->GetGUIDLow() == tGUIDl) + { GetPlayer()->m_transport = (*iter); (*iter)->AddPassenger(GetPlayer()); continue; @@ -146,9 +150,12 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) GetPlayer()->m_transY = tY; GetPlayer()->m_transZ = tZ; GetPlayer()->m_transO = tO; - } else { + } + else + { // if we were on a transport, leave - if (GetPlayer()->m_transport) { + if (GetPlayer()->m_transport) + { GetPlayer()->m_transport->RemovePassenger(GetPlayer()); GetPlayer()->m_transport = NULL; GetPlayer()->m_transX = 0.0f; diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 00e541ac..0c8a6345 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -224,19 +224,23 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2 *data << (uint8)flags; if( m_objectTypeId==TYPEID_PLAYER ) { - if(((Player*)this)->GetTransport()) { + if(((Player*)this)->GetTransport()) + { flags2 |= 0x02000000; } *data << (uint32)flags2; *data << (uint32)getMSTime(); - - if (!((Player *)this)->GetTransport()) { + + if (!((Player *)this)->GetTransport()) + { *data << (float)m_positionX; *data << (float)m_positionY; *data << (float)m_positionZ; *data << (float)m_orientation; - } else { + } + else + { //*data << ((Player *)this)->m_transport->GetPositionX() + (float)((Player *)this)->m_transX; //*data << ((Player *)this)->m_transport->GetPositionY() + (float)((Player *)this)->m_transY; //*data << ((Player *)this)->m_transport->GetPositionZ() + (float)((Player *)this)->m_transZ; @@ -245,17 +249,17 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2 *data << ((Player *)this)->GetTransport()->GetPositionY(); *data << ((Player *)this)->GetTransport()->GetPositionZ(); *data << ((Player *)this)->GetTransport()->GetOrientation(); - + *data << (uint64)(((Player *)this)->GetTransport()->GetGUID()); *data << ((Player *)this)->GetTransOffsetX(); *data << ((Player *)this)->GetTransOffsetY(); *data << ((Player *)this)->GetTransOffsetZ(); *data << ((Player *)this)->GetTransOffsetO(); } - + *data << (float)0; - if(flags2 & 0x2000) //update self + if(flags2 & 0x2000) //update self { *data << (float)0; *data << (float)1.0; @@ -302,11 +306,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2 } if( (m_objectTypeId==TYPEID_CORPSE) || (m_objectTypeId==TYPEID_GAMEOBJECT) || (m_objectTypeId==TYPEID_DYNAMICOBJECT)) { - if(GUID_HIPART(GetGUID()) != HIGHGUID_TRANSPORT) { + if(GUID_HIPART(GetGUID()) != HIGHGUID_TRANSPORT) + { *data << (float)m_positionX; *data << (float)m_positionY; *data << (float)m_positionZ; - } else { + } + else + { *data << (uint32)0; *data << (uint32)0; *data << (uint32)0; @@ -316,7 +323,8 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2 *data << (uint32)0x1; - if ((GUID_HIPART(GetGUID()) == HIGHGUID_TRANSPORT)) { + if ((GUID_HIPART(GetGUID()) == HIGHGUID_TRANSPORT)) + { uint32 updT = (uint32)getMSTime(); *data << (uint32)updT; } diff --git a/src/game/Object.h b/src/game/Object.h index 7d73a044..107443c2 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -301,7 +301,7 @@ class MANGOS_DLL_SPEC Object float m_positionY; float m_positionZ; float m_orientation; - + float m_speed; uint8 m_moveType; diff --git a/src/game/ObjectDefines.h b/src/game/ObjectDefines.h index d23e7faf..76c58fe2 100644 --- a/src/game/ObjectDefines.h +++ b/src/game/ObjectDefines.h @@ -28,7 +28,7 @@ enum HIGHGUID HIGHGUID_GAMEOBJECT = 0xF0004000, HIGHGUID_DYNAMICOBJECT = 0xF000A000, HIGHGUID_CORPSE = 0xF0007000, - HIGHGUID_PLAYER_CORPSE = 0x80000001, // ?? + HIGHGUID_PLAYER_CORPSE = 0x80000001, // ?? HIGHGUID_TRANSPORT = 0x80000000 }; diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 1705e14b..567957ad 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -257,7 +257,7 @@ class ObjectMgr void LoadAreaTriggerPoints(); void LoadTeleportCoords(); - + void LoadAuctions(); void LoadAuctionItems(); void LoadLvlUpGains(); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 635f0c3f..c6d90f4b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -199,7 +199,8 @@ Player::~Player () delete info; delete PlayerTalkClass; - if (m_transport) { + if (m_transport) + { m_transport->RemovePassenger(this); } } @@ -864,7 +865,7 @@ void Player::Update( uint32 p_time ) if(p_time >= m_nextSave) { // m_nextSave reseted in SaveToDB call - SaveToDB(); + SaveToDB(); sLog.outBasic("Player '%u' '%s' Saved", GetGUIDLow(), GetName()); } else @@ -1168,15 +1169,19 @@ void Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati WorldPacket data; data.Initialize(SMSG_TRANSFER_PENDING); data << uint32(mapid); - if (m_transport) { + if (m_transport) + { data << m_transport->GetEntry() << GetMapId(); } GetSession()->SendPacket(&data); data.Initialize(SMSG_NEW_WORLD); - if (m_transport) { + if (m_transport) + { data << (uint32)mapid << m_transX << m_transY << m_transZ << m_transO; - } else { + } + else + { data << (uint32)mapid << (float)x << (float)y << (float)z << (float)orientation; } GetSession()->SendPacket( &data ); @@ -1990,7 +1995,7 @@ void Player::learnSpell(uint16 spell_id) case 2842: //poisons SetSkill(40,1,maxskill); break; - // Languages + // Languages case 668: case 669: case 670: case 671: case 672: case 813: case 814: case 815: case 816: case 817: case 7340: case 7341: case 17737: if(LanguageDesc const* lang = GetLanguageDescBySpell(spell_id)) @@ -2054,7 +2059,6 @@ void Player::_LoadSpellCooldowns() continue; } - // skip outdated cooldown if(db_time <= curTime) continue; @@ -2140,7 +2144,6 @@ void Player::_SaveSpellCooldowns() } } - uint32 Player::resetTalentsCost() const { // The first time reset costs 1 gold @@ -3688,7 +3691,6 @@ uint32 Player::GetStanding(uint32 faction) const if(!factionEntry) return 0; - std::list::const_iterator itr; for(itr = factions.begin(); itr != factions.end(); ++itr) { @@ -9902,13 +9904,15 @@ bool Player::LoadFromDB( uint32 guid ) m_mapId = fields[10].GetUInt32(); m_orientation = fields[11].GetFloat(); - if (transGUID != 0) { + if (transGUID != 0) + { m_transX = fields[25].GetFloat(); m_transY = fields[26].GetFloat(); m_transZ = fields[27].GetFloat(); m_transO = fields[28].GetFloat(); - for (int i = 0; i < MapManager::Instance().m_Transports.size(); i++) { + for (int i = 0; i < MapManager::Instance().m_Transports.size(); i++) + { if ((MapManager::Instance().m_Transports[i])->GetGUIDLow() == transGUID) { m_transport = MapManager::Instance().m_Transports[i]; @@ -10423,7 +10427,7 @@ void Player::SaveToDB() //this is becouse of the rename char stuff RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); - ClearInCombat(); // Remove combat flag + ClearInCombat(); // Remove combat flag sLog.outDebug("The value of player %s before unload item and aura is: ", m_name.c_str()); outDebugValues(); diff --git a/src/game/Player.h b/src/game/Player.h index 69252d94..c36e69d0 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -904,7 +904,7 @@ class MANGOS_DLL_SPEC Player : public Unit void ApplyDefenseBonusesMod(float value, bool apply); void UpdateBlockPercentage(); - + const uint64& GetLootGUID() const { return m_lootGuid; } void SetLootGUID(const uint64 &guid) { m_lootGuid = guid; } @@ -1097,7 +1097,6 @@ class MANGOS_DLL_SPEC Player : public Unit bool HasMovementFlags(uint32 flags) const { return m_movement_flags & flags; } void SetMovementFlags(uint32 Flags) { m_movement_flags = Flags;} - // Transports Transport * GetTransport() { return m_transport; } void SetTransport(Transport * t) { m_transport = t; } diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 17b4782c..d5f3a1e8 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -129,7 +129,8 @@ enum SpellSchools #define SLOT_TABARD 18 #define SLOT_EMPTY 19 -enum Language { +enum Language +{ LANG_GLOBAL = 0, LANG_UNIVERSAL = 0, LANG_ORCISH = 1, LANG_DARNASSIAN = 2, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index cc23563a..3b810303 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -758,7 +758,7 @@ void Spell::SendSpellCooldown() return; time_t curTime = time(NULL); - + time_t recTime = curTime+rec/1000; // in secs time_t catrecTime = curTime+catrec/1000; // in secs @@ -1402,13 +1402,13 @@ uint8 Spell::CanCast() //check creaturetype uint32 SpellCreatureType = m_spellInfo->TargetCreatureType; if(m_spellInfo->Id == 603) - SpellCreatureType = 0x7FF - 0x40; //Curse of Doom + SpellCreatureType = 0x7FF - 0x40; //Curse of Doom - if(SpellCreatureType) + if(SpellCreatureType) { uint32 TargetCreatureType = 0; - if(target->GetTypeId() == TYPEID_PLAYER) - TargetCreatureType = 0x40; //1<<(7-1) + if(target->GetTypeId() == TYPEID_PLAYER) + TargetCreatureType = 0x40; //1<<(7-1) else if ( target->GetTypeId() == TYPEID_UNIT ) { uint32 CType = ((Creature*)target)->GetCreatureInfo()->type; @@ -1419,7 +1419,7 @@ uint8 Spell::CanCast() } if(TargetCreatureType && !(SpellCreatureType & TargetCreatureType)) - { + { if(TargetCreatureType == 0x40) castResult = CAST_FAIL_CANT_TARGET_PLAYERS; else diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 2d3aed04..53b09886 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1048,11 +1048,11 @@ void Aura::HandleAuraModShapeshift(bool apply) unit_target->m_form = m_modifier.m_miscvalue; if(unit_target->m_form == FORM_DIREBEAR) if (m_target->getRace() == TAUREN) - { - m_target->SetFloatValue(OBJECT_FIELD_SCALE_X,1.35f); - } - else - m_target->SetFloatValue(OBJECT_FIELD_SCALE_X,1.0f); + { + m_target->SetFloatValue(OBJECT_FIELD_SCALE_X,1.35f); + } + else + m_target->SetFloatValue(OBJECT_FIELD_SCALE_X,1.0f); } else { diff --git a/src/game/TaxiHandler.cpp b/src/game/TaxiHandler.cpp index 97a72204..23513648 100644 --- a/src/game/TaxiHandler.cpp +++ b/src/game/TaxiHandler.cpp @@ -55,7 +55,7 @@ void WorldSession::SendTaxiStatus( uint64 guid ) GetPlayer( )->GetPositionZ( ), GetPlayer( )->GetMapId( ) ); - // not found nearest + // not found nearest if(curloc == 0) return; @@ -239,7 +239,6 @@ void WorldSession::HandleActivateTaxiFarOpcode ( WorldPacket & recv_data ) return; } - uint32 sourcepath = 0; uint32 totalcost = 0; @@ -401,7 +400,6 @@ void WorldSession::HandleActivateTaxiOpcode( WorldPacket & recv_data ) return; } - objmgr.GetTaxiPath( sourcenode, destinationnode, path, cost); MountId = objmgr.GetTaxiMount(sourcenode, GetPlayer()->GetTeam()); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b4892da3..9a976e73 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -107,7 +107,7 @@ void Unit::Update( uint32 p_time ) _UpdateSpells( p_time ); _UpdateHostil( p_time ); - if (isInCombat() && GetTypeId() == TYPEID_PLAYER ) //update combat timer only for players + if (isInCombat() && GetTypeId() == TYPEID_PLAYER ) //update combat timer only for players { if ( m_CombatTimer <= p_time ) { @@ -251,7 +251,7 @@ void Unit::DealDamage(Unit *pVictim, uint32 damage, DamageEffectType damagetype, sLog.outDetail("deal dmg:%d to heals:%d ",damage,health); if (health <= damage) { - if(pVictim->GetTypeId() == TYPEID_UNIT) //leave combat mode when killing mobs + if(pVictim->GetTypeId() == TYPEID_UNIT) //leave combat mode when killing mobs ClearInCombat(); else SetInCombat(); @@ -400,8 +400,8 @@ void Unit::DealDamage(Unit *pVictim, uint32 damage, DamageEffectType damagetype, if(damagetype != DOT) { Attack(pVictim); - if(damagetype == DIRECT_DAMAGE) //start melee attacks only after melee hit - SendAttackStart(pVictim); + if(damagetype == DIRECT_DAMAGE) //start melee attacks only after melee hit + SendAttackStart(pVictim); } //Get in CombatState @@ -2807,7 +2807,7 @@ bool Unit::Attack(Unit *victim) m_attacking->_addAttacker(this); //if(!isAttackReady(BASE_ATTACK)) - //resetAttackTimer(BASE_ATTACK); + //resetAttackTimer(BASE_ATTACK); // delay offhand weapon attack to next attack time if(haveOffhandWeapon()) diff --git a/src/game/World.cpp b/src/game/World.cpp index 18cd5d3c..899ecf87 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -298,14 +298,12 @@ void World::SetInitialWorldSettings() sLog.outString( "Loading Teleport Coords..." ); objmgr.LoadTeleportCoords(); - + objmgr.SetHighestGuids(); sLog.outString( "Loading Loot Tables..." ); LoadLootTables(); - - sLog.outString( "Initializing Scripts..." ); if(!LoadScriptingModule()) exit(1); @@ -323,7 +321,7 @@ void World::SetInitialWorldSettings() sLog.outString( "Loading Transports..." ); MapManager::Instance().LoadTransports(); - + sLog.outString( "WORLD: Starting Event System" ); StartEventSystem(); diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index 52dc818f..0912bf85 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -259,7 +259,7 @@ void WorldSocket::_HandleAuthSession(WorldPacket& recvPacket) return; } - if((*result)[4].GetUInt8() == 1) // if ip is locked + if((*result)[4].GetUInt8() == 1) // if ip is locked { if ( strcmp((*result)[3].GetString(),GetRemoteAddress().c_str()) ) { @@ -271,7 +271,7 @@ void WorldSocket::_HandleAuthSession(WorldPacket& recvPacket) return; } } - if((*result)[8].GetUInt8() == 1) // if account banned + if((*result)[8].GetUInt8() == 1) // if account banned { packet.Initialize( SMSG_AUTH_RESPONSE ); packet << uint8( AUTH_BANNED ); @@ -363,7 +363,7 @@ void WorldSocket::_HandleAuthSession(WorldPacket& recvPacket) sLog.outBasic( "SOCKET: Client '%s' authed successfully.", account.c_str() ); sLog.outString( "Account: '%s' Login.", account.c_str() ); loginDatabase.PQuery("UPDATE `account` SET `last_ip` = '%s' WHERE `username` = '%s'",GetRemoteAddress().c_str(), account.c_str()); - + // do small delay (10ms) at accepting successful authed connection to prevent droping packets by client // don't must harm anyone (let login ~100 accounts in 1 sec ;) ) #ifdef WIN32 diff --git a/src/mangosd/CliRunnable.cpp b/src/mangosd/CliRunnable.cpp index db9b5516..6f15a40c 100644 --- a/src/mangosd/CliRunnable.cpp +++ b/src/mangosd/CliRunnable.cpp @@ -528,7 +528,7 @@ void CliRunnable::run() sLog.outString(""); void CliHelp(); - + if(sConfig.GetIntDefault("BeepAtStart", 1) > 0) { putchar(7); diff --git a/src/mangosd/Master.cpp b/src/mangosd/Master.cpp index 72cc905b..9ffe95ed 100644 --- a/src/mangosd/Master.cpp +++ b/src/mangosd/Master.cpp @@ -201,7 +201,7 @@ bool Master::Run() uint32 realCurrTime, realPrevTime; realCurrTime = realPrevTime = getMSTime(); - + // maximum counter for next ping uint32 numLoops = (sConfig.GetIntDefault( "MaxPingTime", 30 ) * (MINUTE * 1000000 / socketSelecttime)); uint32 loopCounter = 0; diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h index 7c88a4a5..fd5179c0 100644 --- a/src/shared/Database/DBCStructure.h +++ b/src/shared/Database/DBCStructure.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// Structures using to access raw DBC data and required packing to portability +// Structures using to access raw DBC data and required packing to portability // Only GCC 4.1.0 and later support #pragma pack(push,1) syntax #if defined( __GNUC__ ) && (GCC_MAJOR < 4 || GCC_MAJOR == 4 && GCC_MINOR < 1) @@ -282,14 +282,12 @@ struct WorldSafeLocsEntry float z; }; - #if defined( __GNUC__ ) && (GCC_MAJOR < 4 || GCC_MAJOR == 4 && GCC_MINOR < 1) #pragma pack() #else #pragma pack(pop) #endif - // Structures not used for casting to loaded DBC data and not requred then packing struct TaxiPathBySourceAndDestination -- 2.11.4.GIT