diff options
author | Spp <spp@jorge.gr> | 2012-02-16 13:56:08 +0100 |
---|---|---|
committer | Spp <spp@jorge.gr> | 2012-02-16 13:56:28 +0100 |
commit | 03c34ee507b4e43fabee1ff382d9de9ea815e3f2 (patch) | |
tree | 08ffffcfeb954d98f1fa27d0a808746614bf3b47 /src | |
parent | e47ec04b4d58a4a080918aef57a35509ad69f0ca (diff) |
Fix a lot of warnings
Diffstat (limited to 'src')
38 files changed, 88 insertions, 98 deletions
diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp index 72c36fc6646..e839457d1c9 100755 --- a/src/server/authserver/Server/RealmSocket.cpp +++ b/src/server/authserver/Server/RealmSocket.cpp @@ -95,7 +95,7 @@ const std::string& RealmSocket::getRemoteAddress(void) const return _remoteAddress; } -const uint16 RealmSocket::getRemotePort(void) const +uint16 RealmSocket::getRemotePort(void) const { return _remotePort; } diff --git a/src/server/authserver/Server/RealmSocket.h b/src/server/authserver/Server/RealmSocket.h index 9dbd0a4aafb..c03a0e3ad1e 100755 --- a/src/server/authserver/Server/RealmSocket.h +++ b/src/server/authserver/Server/RealmSocket.h @@ -55,7 +55,7 @@ public: const std::string& getRemoteAddress(void) const; - const uint16 getRemotePort(void) const; + uint16 getRemotePort(void) const; virtual int open(void *); diff --git a/src/server/collision/BoundingIntervalHierarchyWrapper.h b/src/server/collision/BoundingIntervalHierarchyWrapper.h index e54a4e653a1..e2252ca60c8 100644 --- a/src/server/collision/BoundingIntervalHierarchyWrapper.h +++ b/src/server/collision/BoundingIntervalHierarchyWrapper.h @@ -34,7 +34,7 @@ class BIHWrap const T* const* objects; RayCallback& _callback; - MDLCallback(RayCallback& callback, const T* const* objects_array ) : _callback(callback), objects(objects_array){} + MDLCallback(RayCallback& callback, const T* const* objects_array ) : objects(objects_array), _callback(callback) {} bool operator() (const Ray& ray, uint32 Idx, float& MaxDist, bool /*stopAtFirst*/) { @@ -106,4 +106,4 @@ public: } }; -#endif // _BIH_WRAP
\ No newline at end of file +#endif // _BIH_WRAP diff --git a/src/server/collision/DynamicTree.cpp b/src/server/collision/DynamicTree.cpp index 89e76d426fe..ebb46614a20 100644 --- a/src/server/collision/DynamicTree.cpp +++ b/src/server/collision/DynamicTree.cpp @@ -43,10 +43,11 @@ template<> struct BoundsTrait< GameObjectModel> { static void getBounds2(const GameObjectModel* g, G3D::AABox& out) { out = g->getBounds();} }; +/* static bool operator == (const GameObjectModel& mdl, const GameObjectModel& mdl2){ return &mdl == &mdl2; } - +*/ int valuesPerNode = 5, numMeanSplits = 3; @@ -251,4 +252,4 @@ float DynamicMapTree::getHeight(float x, float y, float z, float maxSearchDist, return v.z - maxSearchDist; else return -G3D::inf(); -}
\ No newline at end of file +} diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index 62968e4dedd..cfd50c318df 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -344,16 +344,15 @@ namespace VMAP char buff[500]; while (!feof(model_list)) { - fread(&displayId,sizeof(uint32),1,model_list); - fread(&name_length,sizeof(uint32),1,model_list); - - if (name_length >= sizeof(buff)) + if (fread(&displayId, sizeof(uint32), 1, model_list) != 1 + || fread(&name_length, sizeof(uint32), 1, model_list) != 1 + || name_length >= sizeof(buff) + || fread(&buff, sizeof(char), name_length, model_list) != name_length) { std::cout << "\nFile 'temp_gameobject_models' seems to be corrupted" << std::endl; break; } - fread(&buff,sizeof(char),name_length,model_list); std::string model_name(buff, name_length); WorldModel_Raw raw_model; diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 5ad984fcb4b..4c0a344f868 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -36,7 +36,7 @@ using G3D::AABox; struct GameobjectModelData { GameobjectModelData(const std::string& name_, const AABox& box) : - name(name_), bound(box) {} + bound(box), name(name_) {} AABox bound; std::string name; @@ -55,20 +55,18 @@ void LoadGameObjectModelList() char buff[500]; while (!feof(model_list_file)) { - fread(&displayId,sizeof(uint32),1,model_list_file); - fread(&name_length,sizeof(uint32),1,model_list_file); - - if (name_length >= sizeof(buff)) + Vector3 v1, v2; + if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1 + || fread(&name_length, sizeof(uint32), 1, model_list_file) != 1 + || name_length >= sizeof(buff) + || fread(&buff, sizeof(char), name_length, model_list_file) != name_length + || fread(&v1, sizeof(Vector3), 1, model_list_file) != 1 + || fread(&v2, sizeof(Vector3), 1, model_list_file) != 1) { printf("\nFile '%s' seems to be corrupted", VMAP::GAMEOBJECT_MODELS); break; } - fread(&buff, sizeof(char), name_length,model_list_file); - Vector3 v1, v2; - fread(&v1, sizeof(Vector3), 1, model_list_file); - fread(&v2, sizeof(Vector3), 1, model_list_file); - model_list.insert ( ModelList::value_type( displayId, GameobjectModelData(std::string(buff,name_length),AABox(v1,v2)) ) @@ -172,4 +170,4 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto MaxDist = distance; } return hit; -}
\ No newline at end of file +} diff --git a/src/server/collision/RegularGrid.h b/src/server/collision/RegularGrid.h index be61504bc65..2c11b1c257d 100644 --- a/src/server/collision/RegularGrid.h +++ b/src/server/collision/RegularGrid.h @@ -17,7 +17,7 @@ using G3D::Ray; template<class Node> struct NodeCreator{ - static Node * makeNode(int x, int y) { return new Node();} + static Node * makeNode(int /*x*/, int /*y*/) { return new Node();} }; template<class T, @@ -215,4 +215,4 @@ public: #undef CELL_SIZE #undef HGRID_MAP_SIZE -#endif
\ No newline at end of file +#endif diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index d38cc2a38ee..320a02a30ed 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -40,7 +40,6 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) return false; } bool condMeets = false; - bool sendErrorMsg = false; switch (ConditionType) { case CONDITION_NONE: @@ -724,7 +723,7 @@ bool ConditionMgr::addToGossipMenus(Condition* cond) { for (GossipMenusContainer::iterator itr = pMenuBounds.first; itr != pMenuBounds.second; ++itr) { - if ((*itr).second.entry == cond->SourceGroup && (*itr).second.text_id == cond->SourceEntry) + if ((*itr).second.entry == cond->SourceGroup && (*itr).second.text_id == uint32(cond->SourceEntry)) { (*itr).second.conditions.push_back(cond); return true; @@ -743,7 +742,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond) { for (GossipMenuItemsContainer::iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr) { - if ((*itr).second.MenuId == cond->SourceGroup && (*itr).second.OptionIndex == cond->SourceEntry) + if ((*itr).second.MenuId == cond->SourceGroup && (*itr).second.OptionIndex == uint32(cond->SourceEntry)) { (*itr).second.Conditions.push_back(cond); return true; diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 3c968998566..79a2122ae29 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -255,10 +255,11 @@ template <class T> bool CompareValues(ComparisionType type, T val1, T val2) return val1 >= val2; case COMP_TYPE_LOW_EQ: return val1 <= val2; + default: + // incorrect parameter + ASSERT(false); + return false; } - // incorrect parameter - ASSERT(false); - return false; } #define sConditionMgr ACE_Singleton<ConditionMgr, ACE_Null_Mutex>::instance() diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index cbd0922118c..d40ee89e774 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -145,7 +145,7 @@ m_PlayerDamageReq(0), m_lootMoney(0), m_lootRecipient(0), m_lootRecipientGroup(0 m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), -m_creatureInfo(NULL), m_creatureData(NULL), m_formation(NULL), m_path_id(0) +m_creatureInfo(NULL), m_creatureData(NULL), m_path_id(0), m_formation(NULL) { m_regenTimer = CREATURE_REGEN_INTERVAL; m_valuesCount = UNIT_END; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 41e0b8e054b..a06cee891e7 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -33,7 +33,7 @@ #include "GameObjectModel.h" #include "DynamicTree.h" -GameObject::GameObject() : WorldObject(false), m_goValue(new GameObjectValue), m_AI(NULL), m_model(NULL) +GameObject::GameObject() : WorldObject(false), m_model(NULL), m_goValue(new GameObjectValue), m_AI(NULL) { m_objectType |= TYPEMASK_GAMEOBJECT; m_objectTypeId = TYPEID_GAMEOBJECT; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 80511f49a64..941d898c1fb 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -434,9 +434,9 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/) // 5. Credit instance encounter. KillRewarder::KillRewarder(Player* killer, Unit* victim, bool isBattleGround) : // 1. Initialize internal variables to default values. - _killer(killer), _victim(victim), _isBattleGround(isBattleGround), - _isPvP(false), _group(killer->GetGroup()), _groupRate(1.0f), - _maxLevel(0), _maxNotGrayMember(NULL), _count(0), _sumLevel(0), _isFullXP(false), _xp(0) + _killer(killer), _victim(victim), _group(killer->GetGroup()), + _groupRate(1.0f), _maxNotGrayMember(NULL), _count(0), _sumLevel(0), _xp(0), + _isFullXP(false), _maxLevel(0), _isBattleGround(isBattleGround), _isPvP(false) { // mark the credit as pvp if victim is player if (victim->GetTypeId() == TYPEID_PLAYER) @@ -11830,7 +11830,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje Map const* map = lootedObject->GetMap(); if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) - if (dungeon->map == map->GetId() && dungeon->difficulty == map->GetDifficulty()) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) lootedObjectInDungeon = true; if (!lootedObjectInDungeon) @@ -12024,7 +12024,6 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) return NULL; Item* lastItem = pItem; - uint32 entry = pItem->GetEntry(); for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();) { uint16 pos = itr->pos; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 04eab0b7d56..183267d1dbf 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -146,9 +146,10 @@ _hitMask(hitMask), _spell(spell), _damageInfo(damageInfo), _healInfo(healInfo) #endif Unit::Unit(bool isWorldObject): WorldObject(isWorldObject), m_movedPlayer(NULL), m_lastSanctuaryTime(0), IsAIEnabled(false), NeedChangeAI(false), -m_ControlledByPlayer(false), i_AI(NULL), i_disabledAI(NULL), m_procDeep(0), -m_removedAurasCount(0), i_motionMaster(this), m_ThreatManager(this), m_vehicle(NULL), -m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this), movespline(new Movement::MoveSpline()) +m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()), i_AI(NULL), +i_disabledAI(NULL), m_procDeep(0), m_removedAurasCount(0), i_motionMaster(this), +m_ThreatManager(this), m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), +m_HostileRefManager(this) { #ifdef _MSC_VER #pragma warning(default:4355) @@ -7010,8 +7011,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot())); if ((attType != BASE_ATTACK && attType != OFF_ATTACK) - || attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK - || attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK) + || (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK) + || (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)) return false; // Now compute real proc chance... @@ -7307,8 +7308,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere Player* player = ToPlayer(); WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot())); if ((attType != BASE_ATTACK && attType != OFF_ATTACK) - || attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK - || attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK) + || (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK) + || (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)) return false; float fire_onhit = float(CalculatePctF(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f)); @@ -12685,7 +12686,6 @@ void Unit::setDeathState(DeathState s) { // 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; if (s != ALIVE && s != JUST_ALIVED) diff --git a/src/server/game/Entities/Vehicle/VehicleDefines.h b/src/server/game/Entities/Vehicle/VehicleDefines.h index 57d9204ad1c..df34a61d444 100644 --- a/src/server/game/Entities/Vehicle/VehicleDefines.h +++ b/src/server/game/Entities/Vehicle/VehicleDefines.h @@ -63,7 +63,7 @@ struct VehicleSeat struct VehicleAccessory { VehicleAccessory(uint32 entry, int8 seatId, bool isMinion, uint8 summonType, uint32 summonTime) : - AccessoryEntry(entry), SeatId(seatId), IsMinion(isMinion), SummonedType(summonType), SummonTime(summonTime) {} + AccessoryEntry(entry), IsMinion(isMinion), SummonTime(summonTime), SeatId(seatId), SummonedType(summonType) {} uint32 AccessoryEntry; uint32 IsMinion; uint32 SummonTime; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index b31b632e963..b24b5be014a 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -554,7 +554,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV { Player* Leader = ObjectAccessor::FindPlayer(GetLeaderGUID()); LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(sLFGMgr->GetDungeon(GetGUID())); - if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != dungeon->map) || !dungeon) + if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != uint32(dungeon->map)) || !dungeon) { Disband(); return false; diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 90fb8ffb9f0..c6a93ff4272 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -316,7 +316,7 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...) for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) if (Player* player = i->getSource()) if (WorldSession* session = player->GetSession()) - session->SendNotification(buff); + session->SendNotification("%s", buff); } } diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 564d0cce8b7..64e9b9a27e4 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -1364,7 +1364,7 @@ bool LootTemplate::addConditionItem(Condition* cond) { for (LootStoreItemList::iterator i = Entries.begin(); i != Entries.end(); ++i) { - if (i->itemid == cond->SourceEntry) + if (i->itemid == uint32(cond->SourceEntry)) { i->conditions.push_back(cond); return true; @@ -1380,7 +1380,7 @@ bool LootTemplate::addConditionItem(Condition* cond) { for (LootStoreItemList::iterator i = itemList->begin(); i != itemList->end(); ++i) { - if ((*i).itemid == cond->SourceEntry) + if ((*i).itemid == uint32(cond->SourceEntry)) { (*i).conditions.push_back(cond); return true; @@ -1392,7 +1392,7 @@ bool LootTemplate::addConditionItem(Condition* cond) { for (LootStoreItemList::iterator i = itemList->begin(); i != itemList->end(); ++i) { - if ((*i).itemid == cond->SourceEntry) + if ((*i).itemid == uint32(cond->SourceEntry)) { (*i).conditions.push_back(cond); return true; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 39f695c0868..7f7612c2046 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2374,7 +2374,7 @@ bool InstanceMap::AddPlayerToMap(Player* player) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) if (LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin()))) - if (dungeon->map == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM) + if (uint32(dungeon->map) == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM) player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true); } diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 83ff81ab30b..9910f8ad40a 100755 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -91,7 +91,7 @@ class MotionMaster //: private std::stack<MovementGenerator *> void InitTop(); public: - explicit MotionMaster(Unit* unit) : _top(-1), _owner(unit), _expList(NULL), _cleanFlag(MMCF_NONE) + explicit MotionMaster(Unit* unit) : _expList(NULL), _top(-1), _owner(unit), _cleanFlag(MMCF_NONE) { for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i) { diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index dc47898352e..5725aec54f6 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -57,7 +57,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner) owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE); } -bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff) +bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 /*time_diff*/) { arrived = owner.movespline->Finalized(); return !arrived; diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 02f9ebce847..c565e150740 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -41,7 +41,7 @@ void PointMovementGenerator<T>::Initialize(T &unit) } template<class T> -bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff) +bool PointMovementGenerator<T>::Update(T &unit, const uint32 & /*diff*/) { if (!&unit) return false; diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 054f87d9fff..b65fa210723 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -35,9 +35,8 @@ template<> void RandomMovementGenerator<Creature>::_setRandomLocation(Creature& creature) { - float respX, respY, respZ, respO, currZ, destX, destY, destZ, travelDistZ; + float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ; creature.GetHomePosition(respX, respY, respZ, respO); - currZ = creature.GetPositionZ(); Map const* map = creature.GetBaseMap(); // For 2D/3D system selection diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h index bf2eecc89f6..b851dbc0e05 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -39,8 +39,9 @@ class TargetedMovementGeneratorMedium { protected: TargetedMovementGeneratorMedium(Unit &target, float offset, float angle) : - TargetedMovementGeneratorBase(target), i_offset(offset), i_angle(angle), - i_recalculateTravel(false), i_targetReached(false), i_recheckDistance(0) + TargetedMovementGeneratorBase(target), i_recheckDistance(0), + i_offset(offset), i_angle(angle), + i_recalculateTravel(false), i_targetReached(false) { } ~TargetedMovementGeneratorMedium() {} diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index da84325a00a..1871454d614 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -78,7 +78,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature) if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance) { - sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for %u.", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID()); + sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for "UI64FMTD".", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID()); creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL/*, false*/); } @@ -240,7 +240,7 @@ void FlightPathMovementGenerator::Reset(Player & player) init.Launch(); } -bool FlightPathMovementGenerator::Update(Player &player, const uint32 diff) +bool FlightPathMovementGenerator::Update(Player &player, const uint32 /*diff*/) { uint32 pointId = (uint32)player.movespline->currentPathIdx(); if (pointId > i_currentNode) diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index aa6d327db3b..9c2475267f6 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -42,7 +42,7 @@ template<class T, class P> class PathMovementBase { public: - PathMovementBase() : i_currentNode(0), i_path(NULL) {} + PathMovementBase() : i_path(NULL), i_currentNode(0) {} virtual ~PathMovementBase() {}; // template pattern, not defined .. override required @@ -63,7 +63,8 @@ class WaypointMovementGenerator<Creature> public PathMovementBase<Creature, WaypointPath const*> { public: - WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : i_nextMoveTime(0), path_id(_path_id), m_isArrivalDone(false), repeating(_repeating) {} + WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) + : i_nextMoveTime(0), m_isArrivalDone(false), path_id(_path_id), repeating(_repeating) {} ~WaypointMovementGenerator() { i_path = NULL; } void Initialize(Creature &); void Finalize(Creature &); diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index 4eaa6b57b36..5d0344f9769 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -187,7 +187,7 @@ void MoveSpline::Initialize(const MoveSplineInitArgs& args) } MoveSpline::MoveSpline() : m_Id(0), time_passed(0), - vertical_acceleration(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0), initialOrientation(0.f) + vertical_acceleration(0.f), initialOrientation(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0) { splineflags.done = true; } diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h index 4b8dbcc8ee3..d4b19b21634 100644 --- a/src/server/game/Movement/Spline/MoveSpline.h +++ b/src/server/game/Movement/Spline/MoveSpline.h @@ -47,7 +47,6 @@ namespace Movement Result_NextCycle = 0x04, Result_NextSegment = 0x08, }; - #pragma region fields friend class PacketBuilder; protected: MySpline spline; @@ -88,7 +87,6 @@ namespace Movement void _Finalize(); void _Interrupt() { splineflags.done = true;} - #pragma endregion public: void Initialize(const MoveSplineInitArgs&); diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index de91f63c30a..33973064e09 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -98,14 +98,14 @@ namespace Movement void operator &= (uint32 f) { raw() &= f;} void operator |= (uint32 f) { raw() |= f;} - void EnableAnimation(uint8 anim) { raw() = raw() & ~(Mask_Animations|Falling|Parabolic) | Animation|anim;} - void EnableParabolic() { raw() = raw() & ~(Mask_Animations|Falling|Animation) | Parabolic;} - void EnableFalling() { raw() = raw() & ~(Mask_Animations|Parabolic|Animation) | Falling;} - void EnableFlying() { raw() = raw() & ~Catmullrom | Flying; } - void EnableCatmullRom() { raw() = raw() & ~Flying | Catmullrom; } - void EnableFacingPoint() { raw() = raw() & ~Mask_Final_Facing | Final_Point;} - void EnableFacingAngle() { raw() = raw() & ~Mask_Final_Facing | Final_Angle;} - void EnableFacingTarget() { raw() = raw() & ~Mask_Final_Facing | Final_Target;} + void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations|Falling|Parabolic)) | Animation|anim;} + void EnableParabolic() { raw() = (raw() & ~(Mask_Animations|Falling|Animation)) | Parabolic;} + void EnableFalling() { raw() = (raw() & ~(Mask_Animations|Parabolic|Animation)) | Falling;} + void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; } + void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; } + void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point;} + void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle;} + void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target;} uint8 animId : 8; bool done : 1; diff --git a/src/server/game/Movement/Spline/Spline.cpp b/src/server/game/Movement/Spline/Spline.cpp index 14c1bd0c117..6970acf5415 100644 --- a/src/server/game/Movement/Spline/Spline.cpp +++ b/src/server/game/Movement/Spline/Spline.cpp @@ -56,7 +56,6 @@ SplineBase::InitMethtod SplineBase::initializers[SplineBase::ModesEnd] = }; /////////// -#pragma region evaluation methtods using G3D::Matrix4; static const Matrix4 s_catmullRomCoeffs( @@ -199,7 +198,6 @@ float SplineBase::SegLengthBezier3(index_type index) const } return length; } -#pragma endregion void SplineBase::init_spline(const Vector3 * controls, index_type count, EvaluationMode m) { diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h index 28876b220d4..627cdcf3e3b 100644 --- a/src/server/game/Movement/Spline/Spline.h +++ b/src/server/game/Movement/Spline/Spline.h @@ -39,7 +39,6 @@ public: ModesEnd }; - #pragma region fields protected: ControlArray points; @@ -84,10 +83,9 @@ protected: void UninitializedSpline() const { ASSERT(false);} - #pragma endregion public: - explicit SplineBase() : m_mode(UninitializedMode), index_lo(0), index_hi(0), cyclic(false) {} + explicit SplineBase() : index_lo(0), index_hi(0), m_mode(UninitializedMode), cyclic(false) {} /** Caclulates the position for given segment Idx, and percent of segment length t @param t - percent of segment length, assumes that t in range [0, 1] @@ -138,13 +136,11 @@ class Spline : public SplineBase public: typedef length_type LengthType; typedef std::vector<length_type> LengthArray; - #pragma region fields protected: LengthArray lengths; index_type computeIndexInBounds(length_type length) const; - #pragma endregion public: explicit Spline(){} diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index eaaaeaac9ca..21b98ad2cea 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -360,7 +360,7 @@ class Quest struct QuestStatusData { - QuestStatusData(): Status(QUEST_STATUS_NONE), Explored(false), Timer(0), PlayerCount(0) + QuestStatusData(): Status(QUEST_STATUS_NONE), Timer(0), PlayerCount(0), Explored(false) { memset(ItemCount, 0, QUEST_ITEM_OBJECTIVES_COUNT * sizeof(uint16)); memset(CreatureOrGOCount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint16)); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 1972b625a9f..73039d15620 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -373,10 +373,10 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= }; AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster): -m_base(base), m_spellInfo(base->GetSpellInfo()), m_effIndex(effIndex), +m_base(base), m_spellInfo(base->GetSpellInfo()), m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[m_effIndex].BasePoints), -m_canBeRecalculated(true), m_spellmod(NULL), m_isPeriodic(false), -m_periodicTimer(0), m_tickNumber(0) +m_spellmod(NULL), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex), +m_canBeRecalculated(true), m_isPeriodic(false) { CalculatePeriodic(caster, true, false); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 4bc193b49d2..ee5827cdb98 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -37,8 +37,8 @@ #include "Vehicle.h" AuraApplication::AuraApplication(Unit* target, Unit* caster, Aura* aura, uint8 effMask): -_target(target), _base(aura), _slot(MAX_AURAS), _flags(AFLAG_NONE), -_effectsToApply(effMask), _removeMode(AURA_REMOVE_NONE), _needClientUpdate(false) +_target(target), _base(aura), _removeMode(AURA_REMOVE_NONE), _slot(MAX_AURAS), +_flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false) { ASSERT(GetTarget() && GetBase()); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6cacf5e7e5a..cc159a613c3 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4651,7 +4651,7 @@ SpellCastResult Spell::CheckCast(bool strict) Unit::AuraEffectList const& blockSpells = m_caster->GetAuraEffectsByType(SPELL_AURA_BLOCK_SPELL_FAMILY); for (Unit::AuraEffectList::const_iterator blockItr = blockSpells.begin(); blockItr != blockSpells.end(); ++blockItr) - if ((*blockItr)->GetMiscValue() == m_spellInfo->SpellFamilyName) + if (uint32((*blockItr)->GetMiscValue()) == m_spellInfo->SpellFamilyName) return SPELL_FAILED_SPELL_UNAVAILABLE; bool reqCombat = true; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 73e6b0ac8a5..3de1181f764 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1042,7 +1042,7 @@ public: return true; } - static bool HandleDebugLoSCommand(ChatHandler* handler, char const* args) + static bool HandleDebugLoSCommand(ChatHandler* handler, char const* /*args*/) { if (Unit* unit = handler->getSelectedUnit()) handler->PSendSysMessage("Unit %s (GuidLow: %u) is %sin LoS", unit->GetName(), unit->GetGUIDLow(), handler->GetSession()->GetPlayer()->IsWithinLOSInMap(unit) ? "" : "not "); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index a78a29704cc..242b2f2f0ea 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -308,7 +308,7 @@ struct boss_twin_baseAI : public ScriptedAI void EnableDualWield(bool mode = true) { - SetEquipmentSlots(false, m_uiWeapon, mode ? m_uiWeapon : EQUIP_UNEQUIP, EQUIP_UNEQUIP); + SetEquipmentSlots(false, m_uiWeapon, mode ? m_uiWeapon : int32(EQUIP_UNEQUIP), EQUIP_UNEQUIP); me->SetCanDualWield(mode); me->UpdateDamagePhysical(mode ? OFF_ATTACK : BASE_ATTACK); } diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index 97ce9f45430..c9fdd0f65ff 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -739,7 +739,7 @@ class npc_simon_bunny : public CreatureScript if (!listening) return; - uint8 pressedColor; + uint8 pressedColor = SIMON_MAX_COLORS; if (type == clusterIds[SIMON_RED]) pressedColor = SIMON_RED; @@ -974,7 +974,7 @@ class npc_simon_bunny : public CreatureScript // Handles the spell rewards. The spells also have the QuestCompleteEffect, so quests credits are working. void GiveRewardForLevel(uint8 level) { - uint32 rewSpell; + uint32 rewSpell = 0; switch (level) { case 6: @@ -989,8 +989,6 @@ class npc_simon_bunny : public CreatureScript case 10: rewSpell = SPELL_REWARD_BUFF_3; break; - default: - rewSpell = 0; } if (rewSpell) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 9899e50cd28..09fb6830da8 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1521,7 +1521,7 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader if (group && group->isLFGGroup()) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) - if (dungeon->map == map->GetId() && dungeon->difficulty == map->GetDifficulty()) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM) return; // in correct dungeon @@ -1706,6 +1706,8 @@ class spell_gen_break_shield: public SpellScriptLoader } break; } + default: + break; } } @@ -1834,7 +1836,7 @@ class spell_gen_mounted_charge: public SpellScriptLoader } } - void HandleChargeEffect(SpellEffIndex effIndex) + void HandleChargeEffect(SpellEffIndex /*effIndex*/) { uint32 spellId; @@ -1908,7 +1910,7 @@ class spell_gen_defend : public SpellScriptLoader void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - if (Unit* caster = GetCaster()) + if (GetCaster()) { Unit* target = GetTarget(); @@ -1989,7 +1991,7 @@ class spell_gen_tournament_duel : public SpellScriptLoader return true; } - void HandleScriptEffect(SpellEffIndex effIndex) + void HandleScriptEffect(SpellEffIndex /*effIndex*/) { if (Unit* rider = GetCaster()->GetCharmer()) { |