diff options
| author | click <none@none> | 2010-08-22 01:57:04 +0200 |
|---|---|---|
| committer | click <none@none> | 2010-08-22 01:57:04 +0200 |
| commit | 670964803f030c6d2b85d4281605ab221f5a5740 (patch) | |
| tree | 5babaf3c1c2f7833bf2be8b10a1f7bec78722751 /src/server/game/Entities | |
| parent | a40cb46e610aefde8b270b34e9b510e76470a6b6 (diff) | |
Core: Fix more warnings, add new function sLog.outStaticDebug() that replaces DEBUG_LOG
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Entities')
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 18 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 60 |
4 files changed, 43 insertions, 43 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 46ae8d2d665..5c345a2a225 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -488,7 +488,7 @@ void Creature::Update(uint32 diff) else if (m_deathTimer <= diff) { RemoveCorpse(); - DEBUG_LOG("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); + sLog.outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); } else { @@ -506,7 +506,7 @@ void Creature::Update(uint32 diff) if (m_deathTimer <= diff) { RemoveCorpse(); - DEBUG_LOG("Removing alive corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); + sLog.outStaticDebug("Removing alive corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); } else { @@ -1569,7 +1569,7 @@ void Creature::Respawn(bool force) if (m_DBTableGuid) sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0); - DEBUG_LOG("Respawning..."); + sLog.outStaticDebug("Respawning..."); m_respawnTime = 0; lootForPickPocketed = false; lootForBody = false; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index f1c823001bc..1426af17d8b 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1239,7 +1239,7 @@ void GameObject::Use(Unit* user) int32 roll = irand(1,100); - DEBUG_LOG("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll); + sLog.outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll); // but you will likely cause junk in areas that require a high fishing skill (not yet implemented) if (chance >= roll) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bf44e7467bb..3b99c9ada1c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1020,7 +1020,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) { if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage { - DEBUG_LOG("We are fall to death, loosing 10 percents durability"); + sLog.outStaticDebug("We are fall to death, loosing 10 percents durability"); DurabilityLossAll(0.10f,false); // durability lost message WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0); @@ -5053,7 +5053,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g { if (GetGuildId() == 0) { - DEBUG_LOG("You are not member of a guild"); + sLog.outStaticDebug("You are not member of a guild"); return TotalCost; } @@ -5063,19 +5063,19 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g if (!pGuild->HasRankRight(GetRank(), GR_RIGHT_WITHDRAW_REPAIR)) { - DEBUG_LOG("You do not have rights to withdraw for repairs"); + sLog.outStaticDebug("You do not have rights to withdraw for repairs"); return TotalCost; } if (pGuild->GetMemberMoneyWithdrawRem(GetGUIDLow()) < costs) { - DEBUG_LOG("You do not have enough money withdraw amount remaining"); + sLog.outStaticDebug("You do not have enough money withdraw amount remaining"); return TotalCost; } if (pGuild->GetGuildBankMoney() < costs) { - DEBUG_LOG("There is not enough money in bank"); + sLog.outStaticDebug("There is not enough money in bank"); return TotalCost; } @@ -5088,7 +5088,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g } else if (GetMoney() < costs) { - DEBUG_LOG("You do not have enough money"); + sLog.outStaticDebug("You do not have enough money"); return TotalCost; } else @@ -7731,7 +7731,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply return; } - DEBUG_LOG("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id); + sLog.outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id); CastSpell(this,spellInfo,true,item); } @@ -17596,7 +17596,7 @@ bool Player::_LoadHomeBind(QueryResult_AutoPtr result) GetGUIDLow(), m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ); } - DEBUG_LOG("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f", + sLog.outStaticDebug("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f", m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ); return true; @@ -22964,7 +22964,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) } //Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction - DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall); + sLog.outStaticDebug("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall); } } RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LANDING); // No fly zone - Parachute diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4ac5e777662..496e509c18b 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -666,7 +666,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa return damage; } - DEBUG_LOG("DealDamageStart"); + sLog.outStaticDebug("DealDamageStart"); uint32 health = pVictim->GetHealth(); sLog.outDetail("deal dmg:%d to health:%d ",damage,health); @@ -714,7 +714,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa if (health <= damage) { - DEBUG_LOG("DealDamage: victim just died"); + sLog.outStaticDebug("DealDamage: victim just died"); if (pVictim->GetTypeId() == TYPEID_PLAYER) { @@ -754,7 +754,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa } else // if (health <= damage) { - DEBUG_LOG("DealDamageAlive"); + sLog.outStaticDebug("DealDamageAlive"); if (pVictim->GetTypeId() == TYPEID_PLAYER) pVictim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, damage); @@ -851,7 +851,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa } } - DEBUG_LOG("DealDamageEnd returned %d damage", damage); + sLog.outStaticDebug("DealDamageEnd returned %d damage", damage); return damage; } @@ -892,7 +892,7 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I targets.setUnitTarget(Victim); if (castItem) - DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); + sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); if (!originalCaster && triggeredByAura) originalCaster = triggeredByAura->GetCasterGUID(); @@ -941,7 +941,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* if (castItem) { - DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); + sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); spell->m_CastItem = castItem; } @@ -963,7 +963,7 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, } if (castItem) - DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); + sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); if (!originalCaster && triggeredByAura) originalCaster = triggeredByAura->GetCasterGUID(); @@ -999,7 +999,7 @@ void Unit::CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castI } if (castItem) - DEBUG_LOG("WORLD: cast Item spellId - %i", spellInfo->Id); + sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); if (!originalCaster && triggeredByAura) originalCaster = triggeredByAura->GetCasterGUID(); @@ -2361,10 +2361,10 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool /* DealMeleeDamage(&damageInfo,true); if (GetTypeId() == TYPEID_PLAYER) - DEBUG_LOG("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", + sLog.outStaticDebug("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", GetGUIDLow(), pVictim->GetGUIDLow(), pVictim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist); else - DEBUG_LOG("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", + sLog.outStaticDebug("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", GetGUIDLow(), pVictim->GetGUIDLow(), pVictim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist); // if damage pVictim call AI reaction @@ -2390,7 +2390,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit *pVictim, WeaponAttackT float parry_chance = pVictim->GetUnitParryChance(); // Useful if want to specify crit & miss chances for melee, else it could be removed - DEBUG_LOG("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance,crit_chance,dodge_chance,parry_chance,block_chance); + sLog.outStaticDebug("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance,crit_chance,dodge_chance,parry_chance,block_chance); return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100),int32(parry_chance*100),int32(block_chance*100)); } @@ -2411,22 +2411,22 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack int32 sum = 0, tmp = 0; int32 roll = urand (0, 10000); - DEBUG_LOG ("RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus); - DEBUG_LOG ("RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d", + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d", roll, miss_chance, dodge_chance, parry_chance, block_chance, crit_chance); tmp = miss_chance; if (tmp > 0 && roll < (sum += tmp)) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: MISS"); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: MISS"); return MELEE_HIT_MISS; } // always crit against a sitting target (except 0 crit chance) if (pVictim->GetTypeId() == TYPEID_PLAYER && crit_chance > 0 && !pVictim->IsStandState()) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT (sitting victim)"); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRIT (sitting victim)"); return MELEE_HIT_CRIT; } @@ -2435,7 +2435,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack // only players can't dodge if attacker is behind if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player."); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player."); } else { @@ -2454,7 +2454,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack && ((tmp -= skillBonus) > 0) && roll < (sum += tmp)) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum); return MELEE_HIT_DODGE; } } @@ -2464,7 +2464,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack // check if attack comes from behind, nobody can parry or block if attacker is behind if (!pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind."); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind."); } else { @@ -2481,7 +2481,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack && (tmp2 -= skillBonus) > 0 && roll < (sum += tmp2)) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); return MELEE_HIT_PARRY; } } @@ -2493,7 +2493,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack && (tmp -= skillBonus) > 0 && roll < (sum += tmp)) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum); return MELEE_HIT_BLOCK; } } @@ -2504,9 +2504,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack if (tmp > 0 && roll < (sum += tmp)) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); if (GetTypeId() == TYPEID_UNIT && (this->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) - DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); else return MELEE_HIT_CRIT; } @@ -2526,7 +2526,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack tmp = tmp > 4000 ? 4000 : tmp; if (roll < (sum += tmp)) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum); return MELEE_HIT_GLANCING; } } @@ -2550,13 +2550,13 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack tmp = tmp * 200 - 1500; if (roll < (sum += tmp)) { - DEBUG_LOG ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum); return MELEE_HIT_CRUSHING; } } } - DEBUG_LOG ("RollMeleeOutcomeAgainst: NORMAL"); + sLog.outStaticDebug ("RollMeleeOutcomeAgainst: NORMAL"); return MELEE_HIT_NORMAL; } @@ -2624,7 +2624,7 @@ void Unit::SendMeleeAttackStart(Unit* pVictim) data << uint64(pVictim->GetGUID()); SendMessageToSet(&data, true); - DEBUG_LOG("WORLD: Sent SMSG_ATTACKSTART"); + sLog.outStaticDebug("WORLD: Sent SMSG_ATTACKSTART"); } void Unit::SendMeleeAttackStop(Unit* victim) @@ -2851,7 +2851,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) case MELEE_HIT_BLOCK: canBlock = false; break; case MELEE_HIT_PARRY: canParry = false; break; default: - DEBUG_LOG("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT have unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue()); + sLog.outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT have unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue()); break; } } @@ -15086,7 +15086,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) if (!SpiritOfRedemption) { - DEBUG_LOG("SET JUST_DIED"); + sLog.outStaticDebug("SET JUST_DIED"); pVictim->setDeathState(JUST_DIED); } @@ -15101,7 +15101,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) // only if not player and not controlled by player pet. And not at BG if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld.getConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) { - DEBUG_LOG("We are dead, losing %u percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH)); + sLog.outStaticDebug("We are dead, losing %u percent durability", sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH)); pVictim->ToPlayer()->DurabilityLossAll(sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH),false); // durability lost message WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0); @@ -15121,7 +15121,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) } else // creature died { - DEBUG_LOG("DealDamageNotPlayer"); + sLog.outStaticDebug("DealDamageNotPlayer"); if (!creature->isPet()) { |
