[12022] Some more warning fixes

This commit is contained in:
stfx 2012-05-11 17:35:47 +02:00 committed by Schmoozerd
parent f777665d48
commit a309de2e6d
8 changed files with 25 additions and 34 deletions

View file

@ -202,7 +202,6 @@ inline uint32 GetGuildBankTabPrice(uint8 Index)
default:
return 0;
}
return 0;
}
struct GuildEventLogEntry

View file

@ -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;

View file

@ -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<uint32, dtTileRef>(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<uint32, dtTileRef>(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)

View file

@ -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

View file

@ -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

View file

@ -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 )

View file

@ -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; }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12021"
#define REVISION_NR "12022"
#endif // __REVISION_NR_H__