diff --git a/src/game/Guild.h b/src/game/Guild.h index 45858e228..4b4aef124 100644 --- a/src/game/Guild.h +++ b/src/game/Guild.h @@ -202,7 +202,6 @@ inline uint32 GetGuildBankTabPrice(uint8 Index) default: return 0; } - return 0; } struct GuildEventLogEntry diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index f8b242928..b62aad8f1 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -4664,8 +4664,6 @@ bool ChatHandler::HandleAuctionItemCommand(char* args) return false; } - Player* pl = m_session ? m_session->GetPlayer() : NULL; - do { uint32 item_stack = item_count > item_proto->GetMaxStackSize() ? item_proto->GetMaxStackSize() : item_count; diff --git a/src/game/MoveMap.cpp b/src/game/MoveMap.cpp index 0ee3e92e5..b24ca8504 100644 --- a/src/game/MoveMap.cpp +++ b/src/game/MoveMap.cpp @@ -206,21 +206,17 @@ namespace MMAP dtTileRef tileRef = 0; // memory allocated for data is now managed by detour, and will be deallocated when the tile is removed - if(DT_SUCCESS == mmap->navMesh->addTile(data, fileHeader.size, DT_TILE_FREE_DATA, 0, &tileRef)) - { - mmap->mmapLoadedTiles.insert(std::pair(packedGridPos, tileRef)); - ++loadedTiles; - sLog.outDetail("MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y); - return true; - } - else + if (mmap->navMesh->addTile(data, fileHeader.size, DT_TILE_FREE_DATA, 0, &tileRef) != DT_SUCCESS) { sLog.outError("MMAP:loadMap: Could not load %03u%02i%02i.mmtile into navmesh", mapId, x, y); dtFree(data); return false; } - return false; + mmap->mmapLoadedTiles.insert(std::pair(packedGridPos, tileRef)); + ++loadedTiles; + sLog.outDetail("MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y); + return true; } bool MMapManager::unloadMap(uint32 mapId, int32 x, int32 y) diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 6fc02a984..b775a2508 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -246,7 +246,7 @@ void Object::DestroyForPlayer( Player *target, bool anim ) const void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const { - uint16 moveFlags2 = (isType(TYPEMASK_UNIT) ? ((Unit*)this)->m_movementInfo.GetMovementFlags2() : MOVEFLAG2_NONE); + //uint16 moveFlags2 = (isType(TYPEMASK_UNIT) ? ((Unit*)this)->m_movementInfo.GetMovementFlags2() : MOVEFLAG2_NONE); *data << uint16(updateFlags); // update flags diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index d97b32de6..abcc9cce4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6201,7 +6201,7 @@ void Unit::EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers int32 Unit::SpellBonusWithCoeffs(SpellEntry const *spellProto, int32 total, int32 benefit, int32 ap_benefit, DamageEffectType damagetype, bool donePart, float defCoeffMod) { // Distribute Damage over multiple effects, reduce by AoE - float coeff; + float coeff = 1.0f; // Not apply this to creature casted spells if (GetTypeId()==TYPEID_UNIT && !((Creature*)this)->IsPet()) @@ -9200,8 +9200,6 @@ Powers Unit::GetPowerTypeByAuraGroup(UnitMods unitMod) const case UNIT_MOD_RUNIC_POWER:return POWER_RUNIC_POWER; default: return POWER_MANA; } - - return POWER_MANA; } float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const diff --git a/src/game/World.cpp b/src/game/World.cpp index 4dc47fff8..db9d33ca2 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1580,7 +1580,7 @@ void World::Update(uint32 diff) } /// Send a packet to all players (except self if mentioned) -void World::SendGlobalMessage(WorldPacket *packet, WorldSession *self, uint32 team) +void World::SendGlobalMessage(WorldPacket* packet, WorldSession* self /*= NULL*/, Team team /*= TEAM_NONE*/) { SessionMap::const_iterator itr; for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) @@ -1589,7 +1589,7 @@ void World::SendGlobalMessage(WorldPacket *packet, WorldSession *self, uint32 te itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld() && itr->second != self && - (team == 0 || itr->second->GetPlayer()->GetTeam() == team) ) + (team == TEAM_NONE || itr->second->GetPlayer()->GetTeam() == team)) { itr->second->SendPacket(packet); } @@ -1673,7 +1673,7 @@ void World::SendWorldText(int32 string_id, ...) } /// DEPRICATED, only for debug purpose. Send a System Message to all players (except self if mentioned) -void World::SendGlobalText(const char* text, WorldSession *self) +void World::SendGlobalText(const char* text, WorldSession* self) { WorldPacket data; @@ -1681,17 +1681,17 @@ void World::SendGlobalText(const char* text, WorldSession *self) char* buf = mangos_strdup(text); char* pos = buf; - while(char* line = ChatHandler::LineFromMessage(pos)) + while (char* line = ChatHandler::LineFromMessage(pos)) { ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, line); SendGlobalMessage(&data, self); } - delete [] buf; + delete[] buf; } /// Send a packet to all players (or players selected team) in the zone (except self if mentioned) -void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self, uint32 team) +void World::SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self /*= NULL*/, Team team /*= TEAM_NONE*/) { SessionMap::const_iterator itr; for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) @@ -1701,7 +1701,7 @@ void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self itr->second->GetPlayer()->IsInWorld() && itr->second->GetPlayer()->GetZoneId() == zone && itr->second != self && - (team == 0 || itr->second->GetPlayer()->GetTeam() == team) ) + (team == TEAM_NONE || itr->second->GetPlayer()->GetTeam() == team)) { itr->second->SendPacket(packet); } @@ -1709,11 +1709,11 @@ void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self } /// Send a System Message to all players in the zone (except self if mentioned) -void World::SendZoneText(uint32 zone, const char* text, WorldSession *self, uint32 team) +void World::SendZoneText(uint32 zone, const char* text, WorldSession* self /*= NULL*/, Team team /*= TEAM_NONE*/) { WorldPacket data; ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, text); - SendZoneMessage(zone, &data, self,team); + SendZoneMessage(zone, &data, self, team); } /// Kick (and save) all players @@ -1918,16 +1918,16 @@ void World::ShutdownCancel() } /// Send a server message to the user(s) -void World::SendServerMessage(ServerMessageType type, const char *text, Player* player) +void World::SendServerMessage(ServerMessageType type, const char* text /*=""*/, Player* player /*= NULL*/) { WorldPacket data(SMSG_SERVER_MESSAGE, 50); // guess size data << uint32(type); data << text; - if(player) + if (player) player->GetSession()->SendPacket(&data); else - SendGlobalMessage( &data ); + SendGlobalMessage(&data); } void World::UpdateSessions( uint32 diff ) diff --git a/src/game/World.h b/src/game/World.h index aa443b1a3..1a93600d0 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -506,11 +506,11 @@ class World void LoadConfigSettings(bool reload = false); void SendWorldText(int32 string_id, ...); - void SendGlobalText(const char* text, WorldSession *self); - void SendGlobalMessage(WorldPacket *packet, WorldSession *self = 0, uint32 team = 0); - void SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self = 0, uint32 team = 0); - void SendZoneText(uint32 zone, const char *text, WorldSession *self = 0, uint32 team = 0); - void SendServerMessage(ServerMessageType type, const char *text = "", Player* player = NULL); + void SendGlobalText(const char* text, WorldSession* self); + void SendGlobalMessage(WorldPacket* packet, WorldSession* self = NULL, Team team = TEAM_NONE); + void SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self = NULL, Team team = TEAM_NONE); + void SendZoneText(uint32 zone, const char* text, WorldSession* self = NULL, Team team = TEAM_NONE); + void SendServerMessage(ServerMessageType type, const char* text = "", Player* player = NULL); /// Are we in the middle of a shutdown? bool IsShutdowning() const { return m_ShutdownTimer > 0; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4d2d8b631..c37b060a4 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12021" + #define REVISION_NR "12022" #endif // __REVISION_NR_H__