Fixed warnings when EXTRA_LOGS are off

This commit is contained in:
Yehonal
2017-09-25 10:54:21 +02:00
parent e687d223ff
commit dcdddf658b
11 changed files with 25 additions and 13 deletions

View File

@@ -157,7 +157,6 @@ namespace MMAP
fclose(file);
dtMeshHeader* header = (dtMeshHeader*)data;
dtTileRef tileRef = 0;
dtStatus stat;
@@ -172,6 +171,7 @@ namespace MMAP
mmap->mmapLoadedTiles.insert(std::pair<uint32, dtTileRef>(packedGridPos, tileRef));
++loadedTiles;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
dtMeshHeader* header = (dtMeshHeader*)data;
sLog->outDetail("MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y);
#endif
return true;

View File

@@ -74,6 +74,8 @@
#define SIZEFMTD ACE_SIZE_T_FORMAT_SPECIFIER
#define UNUSED(x) (void)(x)
typedef std::int64_t int64;
typedef std::int32_t int32;
typedef std::int16_t int16;

View File

@@ -61,6 +61,7 @@ inline std::string ReadSkip(std::istringstream& iss, char term)
inline bool CheckDelimiter(std::istringstream& iss, char delimiter, const char* context)
{
UNUSED(context); // used only with EXTRA_LOGS
char c = iss.peek();
if (c != delimiter)
{

View File

@@ -176,6 +176,10 @@ void LFGGroupScript::OnAddMember(Group* group, uint64 guid)
void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason)
{
// used only with EXTRA_LOGS
UNUSED(kicker);
UNUSED(reason);
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
return;
@@ -271,6 +275,9 @@ void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 o
void LFGGroupScript::OnInviteMember(Group* group, uint64 guid)
{
// used only with EXTRA_LOGS
UNUSED(guid);
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
return;

View File

@@ -15060,7 +15060,6 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
bool takeCharges = false;
SpellInfo const* spellInfo = i->aura->GetSpellInfo();
uint32 Id = i->aura->GetId();
AuraApplication* aurApp = i->aura->GetApplicationOfTarget(GetGUID());
@@ -15084,6 +15083,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
uint32 Id = i->aura->GetId();
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id);
#endif
takeCharges = true;

View File

@@ -699,6 +699,9 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData)
void WorldSession::HandleChannelDeclineInvite(WorldPacket &recvPacket)
{
// used only with EXTRA_LOGS
UNUSED(recvPacket);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode());
#endif

View File

@@ -137,10 +137,10 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData)
void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData)
{
uint64 guid = GetPlayer()->GetGUID();
std::string comment;
recvData >> comment;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
uint64 guid = GetPlayer()->GetGUID();
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str());
#endif

View File

@@ -6653,6 +6653,9 @@ void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp
uint32 triggerSpellId = GetSpellInfo()->Effects[m_effIndex].TriggerSpell;
if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
{
// used only with EXTRA_LOGS
UNUSED(triggeredSpellInfo);
int32 basepoints0 = GetAmount();
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell %u with value %d from aura %u proc", triggeredSpellInfo->Id, basepoints0, GetId());

View File

@@ -396,19 +396,16 @@ void WardenWin::HandleData(ByteBuffer &buff)
uint32 newClientTicks;
buff >> newClientTicks;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
uint32 ticksNow = World::GetGameTimeMS();
uint32 ourTicks = newClientTicks + (ticksNow - _serverTicks);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_WARDEN, "ServerTicks %u", ticksNow); // Now
#endif
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_WARDEN, "RequestTicks %u", _serverTicks); // At request
#endif
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_WARDEN, "Ticks %u", newClientTicks); // At response
#endif
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_WARDEN, "Ticks diff %u", ourTicks - newClientTicks);
#endif
}

View File

@@ -87,9 +87,8 @@ bool Weather::ReGenerate()
ACE_OS::localtime_r(&gtime, &ltime);
uint32 season = ((ltime.tm_yday - 78 + 365)/91)%4;
static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" };
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" };
sLog->outDetail("Generating a change in %s weather for zone %u.", seasonName[season], m_zone);
#endif

View File

@@ -553,7 +553,7 @@ public:
//When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out
if (Wait_Timer <= diff)
{
if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOGRAINE)))
if (ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOGRAINE)))
{
DoCast(SPELL_SCARLET_RESURRECTION);
Talk(SAY_WH_RESURRECT);