mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 19:31:59 +01:00
Minor code cleanup:
* Fix possible crash in OPvPCapturePoint::AddCapturePoint due to using null pointer in log output * Correct damage for Gore (arithmetic operator has precedence over question operator) * Correct SQL query that WaypointManager uses to count record number * Declare Aura *aur in OPvPWintergrasp::HandleKill only once and then evaluate value instead of declaring twice and then evaluating --HG-- branch : trunk
This commit is contained in:
@@ -80,7 +80,7 @@ bool OPvPCapturePoint::AddCapturePoint(uint32 entry, uint32 map, float x, float
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(entry);
|
||||
if(!goinfo || goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT)
|
||||
{
|
||||
sLog.outError("OutdoorPvP: GO %u is not capture point!", goinfo->id);
|
||||
sLog.outError("OutdoorPvP: GO %u is not capture point!", entry);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
|
||||
//Gore
|
||||
if(m_spellInfo->SpellIconID == 2269 )
|
||||
{
|
||||
damage+= rand()%2 ? damage : 0;
|
||||
damage += (rand()%2 ? damage : 0);
|
||||
}
|
||||
|
||||
// Meteor like spells (divided damage to targets)
|
||||
|
||||
@@ -34,7 +34,7 @@ void WaypointStore::Free()
|
||||
|
||||
void WaypointStore::Load()
|
||||
{
|
||||
QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`id`) FROM `waypoint_data`");
|
||||
QueryResult *result = WorldDatabase.PQuery("SELECT COUNT(`id`) FROM `waypoint_data`");
|
||||
if(!result)
|
||||
{
|
||||
sLog.outError("an error occured while loading the table `waypoint_data` (maybe it doesn't exist ?)");
|
||||
|
||||
@@ -363,7 +363,8 @@ void OPvPWintergrasp::HandleKill(Player *killer, Unit *victim)
|
||||
// We handle promotion here because player should not get promotion if he has buff but do the kill outside the zone
|
||||
if(victim->getLevel() >= 70)
|
||||
{
|
||||
if(Aura *aur = killer->GetAura(SPELL_RECRUIT))
|
||||
Aura *aur;
|
||||
if(aur = killer->GetAura(SPELL_RECRUIT))
|
||||
{
|
||||
if(aur->GetStackAmount() >= 5)
|
||||
{
|
||||
@@ -373,7 +374,7 @@ void OPvPWintergrasp::HandleKill(Player *killer, Unit *victim)
|
||||
else
|
||||
killer->CastSpell(killer, SPELL_RECRUIT, true);
|
||||
}
|
||||
else if(Aura *aur = killer->GetAura(SPELL_CORPORAL))
|
||||
else if(aur = killer->GetAura(SPELL_CORPORAL))
|
||||
{
|
||||
if(aur->GetStackAmount() >= 5)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user