Core: Fix many "errors"/warnings and coding style (3)
Game Errors were found using Cppcheck, open-source static analysis tool
This commit is contained in:
1 parent
abbb896cfb
commit
e3d9768a50
28 files changed
+72
-105
No files matched your search
@@ -79,6 +79,7 @@ SmartScript::SmartScript()
|
||||
{
|
||||
go = NULL;
|
||||
me = NULL;
|
||||
trigger = NULL;
|
||||
mEventPhase = 0;
|
||||
mPathId = 0;
|
||||
mTargetStorage = new ObjectListMap();
|
||||
@@ -92,6 +93,7 @@ SmartScript::SmartScript()
|
||||
meOrigGUID = 0;
|
||||
goOrigGUID = 0;
|
||||
mLastInvoker = 0;
|
||||
mScriptType = SMART_SCRIPT_TYPE_CREATURE;
|
||||
}
|
||||
|
||||
SmartScript::~SmartScript()
|
||||
@@ -1117,10 +1119,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
case SMART_ACTION_SUMMON_CREATURE:
|
||||
{
|
||||
float x, y, z, o;
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (targets)
|
||||
{
|
||||
float x, y, z, o;
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
(*itr)->GetPosition(x, y, z, o);
|
||||
@@ -1149,10 +1151,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!GetBaseObject())
|
||||
break;
|
||||
|
||||
float x, y, z, o;
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (targets)
|
||||
{
|
||||
float x, y, z, o;
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
if (!IsUnit(*itr))
|
||||
|
||||
@@ -913,7 +913,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id)
|
||||
/*bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id) // unused
|
||||
{
|
||||
bool error = false;
|
||||
uint32 entry = 0;
|
||||
@@ -938,4 +938,4 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
@@ -1215,16 +1215,9 @@ enum SmartCastFlags
|
||||
// one line in DB is one event
|
||||
struct SmartScriptHolder
|
||||
{
|
||||
SmartScriptHolder()
|
||||
{
|
||||
timer = 0;
|
||||
active = false;
|
||||
runOnce = false;
|
||||
link = 0;
|
||||
entryOrGuid = 0;
|
||||
event_id = 0;
|
||||
enableTimed = false;
|
||||
}
|
||||
SmartScriptHolder() : timer(0), active(false), runOnce(false), link(0), entryOrGuid(0),
|
||||
event_id(0), enableTimed(false), source_type(SMART_SCRIPT_TYPE_CREATURE) {}
|
||||
|
||||
int32 entryOrGuid;
|
||||
SmartScriptType source_type;
|
||||
uint32 event_id;
|
||||
@@ -1436,7 +1429,7 @@ class SmartAIMgr
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsTextValid(SmartScriptHolder const& e, uint32 id);
|
||||
//bool IsTextValid(SmartScriptHolder const& e, uint32 id);
|
||||
};
|
||||
|
||||
#define sSmartScriptMgr ACE_Singleton<SmartAIMgr, ACE_Null_Mutex>::instance()
|
||||
|
||||
@@ -25,13 +25,7 @@
|
||||
struct AddonInfo
|
||||
{
|
||||
AddonInfo(const std::string& name, uint8 enabled, uint32 crc, uint8 state, bool crcOrPubKey)
|
||||
{
|
||||
Name = name;
|
||||
Enabled = enabled;
|
||||
CRC = crc;
|
||||
State = state;
|
||||
UsePublicKeyOrCRC = crcOrPubKey;
|
||||
}
|
||||
: Name(name), Enabled(enabled), CRC(crc), State(state), UsePublicKeyOrCRC(crcOrPubKey) {}
|
||||
|
||||
std::string Name;
|
||||
uint8 Enabled;
|
||||
|
||||
@@ -155,13 +155,13 @@ bool Battlefield::Update(uint32 diff)
|
||||
if (m_uiKickDontAcceptTimer <= diff)
|
||||
{
|
||||
for (int team = 0; team < 2; team++)
|
||||
for (PlayerTimerMap::iterator itr = m_InvitedPlayers[team].begin(); itr != m_InvitedPlayers[team].end(); itr++)
|
||||
for (PlayerTimerMap::iterator itr = m_InvitedPlayers[team].begin(); itr != m_InvitedPlayers[team].end(); ++itr)
|
||||
if ((*itr).second <= time(NULL))
|
||||
KickPlayerFromBattlefield((*itr).first);
|
||||
|
||||
InvitePlayersInZoneToWar();
|
||||
for (int team = 0; team < 2; team++)
|
||||
for (PlayerTimerMap::iterator itr = m_PlayersWillBeKick[team].begin(); itr != m_PlayersWillBeKick[team].end(); itr++)
|
||||
for (PlayerTimerMap::iterator itr = m_PlayersWillBeKick[team].begin(); itr != m_PlayersWillBeKick[team].end(); ++itr)
|
||||
if ((*itr).second <= time(NULL))
|
||||
KickPlayerFromBattlefield((*itr).first);
|
||||
|
||||
@@ -862,7 +862,8 @@ BfCapturePoint::BfCapturePoint(Battlefield* battlefield) : m_Bf(battlefield), m_
|
||||
{
|
||||
m_team = TEAM_NEUTRAL;
|
||||
m_value = 0;
|
||||
m_maxValue = 0;
|
||||
m_minValue = 0.0f;
|
||||
m_maxValue = 0.0f;
|
||||
m_State = BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL;
|
||||
m_OldState = BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL;
|
||||
m_capturePointEntry = 0;
|
||||
|
||||
@@ -1084,10 +1084,12 @@ WintergraspCapturePoint::WintergraspCapturePoint(BattlefieldWG* battlefield, Tea
|
||||
{
|
||||
m_Bf = battlefield;
|
||||
m_team = teamInControl;
|
||||
m_Workshop = NULL;
|
||||
}
|
||||
|
||||
void WintergraspCapturePoint::ChangeTeam(TeamId /*oldTeam*/)
|
||||
{
|
||||
ASSERT(m_Workshop);
|
||||
m_Workshop->GiveControlTo(m_team, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,16 +24,9 @@
|
||||
#include "ArenaTeamMgr.h"
|
||||
|
||||
ArenaTeam::ArenaTeam()
|
||||
: TeamId(0), Type(0), TeamName(), CaptainGuid(0), BackgroundColor(0), EmblemStyle(0), EmblemColor(0),
|
||||
BorderStyle(0), BorderColor(0)
|
||||
{
|
||||
TeamId = 0;
|
||||
Type = 0;
|
||||
TeamName = "";
|
||||
CaptainGuid = 0;
|
||||
BackgroundColor = 0;
|
||||
EmblemStyle = 0;
|
||||
EmblemColor = 0;
|
||||
BorderStyle = 0;
|
||||
BorderColor = 0;
|
||||
Stats.WeekGames = 0;
|
||||
Stats.SeasonGames = 0;
|
||||
Stats.Rank = 0;
|
||||
@@ -343,7 +336,7 @@ void ArenaTeam::Disband(WorldSession* session)
|
||||
// Broadcast update
|
||||
if (session)
|
||||
{
|
||||
BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName().c_str(), GetName(), "");
|
||||
BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");
|
||||
|
||||
if (Player* player = session->GetPlayer())
|
||||
sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
|
||||
|
||||
@@ -47,8 +47,8 @@ class ChatHandler
|
||||
{
|
||||
public:
|
||||
WorldSession* GetSession() { return m_session; }
|
||||
explicit ChatHandler(WorldSession* session) : m_session(session) {}
|
||||
explicit ChatHandler(Player* player) : m_session(player->GetSession()) {}
|
||||
explicit ChatHandler(WorldSession* session) : m_session(session), sentErrorMessage(false) {}
|
||||
explicit ChatHandler(Player* player) : m_session(player->GetSession()), sentErrorMessage(false) {}
|
||||
virtual ~ChatHandler() {}
|
||||
|
||||
static void FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker);
|
||||
@@ -126,7 +126,7 @@ class ChatHandler
|
||||
|
||||
bool ShowHelpForCommand(ChatCommand* table, const char* cmd);
|
||||
protected:
|
||||
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
|
||||
explicit ChatHandler() : m_session(NULL), sentErrorMessage(false) {} // for CLI subclass
|
||||
static bool SetDataForCommandInTable(ChatCommand* table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand);
|
||||
bool ExecuteCommandInTable(ChatCommand* table, const char* text, const std::string& fullcmd);
|
||||
bool ShowHelpForSubCommands(ChatCommand* table, char const* cmd, char const* subcmd);
|
||||
|
||||
@@ -123,8 +123,8 @@ class ThreatManagerEvent : public ThreatRefStatusChangeEvent
|
||||
private:
|
||||
ThreatContainer* iThreatContainer;
|
||||
public:
|
||||
ThreatManagerEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType) {}
|
||||
ThreatManagerEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference) {}
|
||||
ThreatManagerEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType), iThreatContainer(NULL) {}
|
||||
ThreatManagerEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference), iThreatContainer(NULL) {}
|
||||
|
||||
void setThreatContainer(ThreatContainer* pThreatContainer) { iThreatContainer = pThreatContainer; }
|
||||
|
||||
|
||||
@@ -867,7 +867,6 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
valid = true;
|
||||
++count;
|
||||
continue; // do not add to m_AllocatedMemory to avoid double deleting
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET:
|
||||
valid = addToSpellImplicitTargetConditions(cond);
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
#include "GossipDef.h"
|
||||
#include "World.h"
|
||||
|
||||
Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES)
|
||||
, m_type(type)
|
||||
Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type)
|
||||
{
|
||||
m_objectType |= TYPEMASK_CORPSE;
|
||||
m_objectTypeId = TYPEID_CORPSE;
|
||||
@@ -39,6 +38,7 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES)
|
||||
m_time = time(NULL);
|
||||
|
||||
lootForBody = false;
|
||||
lootRecipient = NULL;
|
||||
}
|
||||
|
||||
Corpse::~Corpse()
|
||||
|
||||
@@ -1418,7 +1418,8 @@ void GameObject::Use(Unit* user)
|
||||
// full amount unique participants including original summoner
|
||||
if (GetUniqueUseCount() == info->summoningRitual.reqParticipants)
|
||||
{
|
||||
spellCaster = m_ritualOwner ? m_ritualOwner : spellCaster;
|
||||
if (m_ritualOwner)
|
||||
spellCaster = m_ritualOwner;
|
||||
|
||||
spellId = info->summoningRitual.spellId;
|
||||
|
||||
|
||||
@@ -1019,7 +1019,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
|
||||
if (count > pProto->GetMaxStackSize())
|
||||
count = pProto->GetMaxStackSize();
|
||||
|
||||
ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already");
|
||||
ASSERT(count != 0 && "pProto->Stackable == 0 but checked at loading already");
|
||||
|
||||
Item* pItem = NewItemOrBag(pProto);
|
||||
if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player))
|
||||
|
||||
@@ -1764,10 +1764,10 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
if (obj->IsAlwaysVisibleFor(this) || CanAlwaysSee(obj))
|
||||
return true;
|
||||
|
||||
bool corpseCheck = false;
|
||||
bool corpseVisibility = false;
|
||||
if (distanceCheck)
|
||||
{
|
||||
bool corpseCheck = false;
|
||||
if (Player const* thisPlayer = ToPlayer())
|
||||
{
|
||||
if (thisPlayer->isDead() && thisPlayer->GetHealth() > 0 && // Cheap way to check for ghost state
|
||||
|
||||
@@ -7262,8 +7262,6 @@ void Player::SetArenaPoints(uint32 value)
|
||||
|
||||
void Player::ModifyHonorPoints(int32 value, SQLTransaction* trans /*=NULL*/)
|
||||
{
|
||||
PreparedStatement* stmt = NULL;
|
||||
|
||||
int32 newValue = int32(GetHonorPoints()) + value;
|
||||
if (newValue < 0)
|
||||
newValue = 0;
|
||||
@@ -7271,7 +7269,7 @@ void Player::ModifyHonorPoints(int32 value, SQLTransaction* trans /*=NULL*/)
|
||||
|
||||
if (trans && !trans->null())
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_HONOR_POINTS);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_HONOR_POINTS);
|
||||
stmt->setUInt32(0, newValue);
|
||||
stmt->setUInt32(1, GetGUIDLow());
|
||||
(*trans)->Append(stmt);
|
||||
@@ -7280,8 +7278,6 @@ void Player::ModifyHonorPoints(int32 value, SQLTransaction* trans /*=NULL*/)
|
||||
|
||||
void Player::ModifyArenaPoints(int32 value, SQLTransaction* trans /*=NULL*/)
|
||||
{
|
||||
PreparedStatement* stmt = NULL;
|
||||
|
||||
int32 newValue = int32(GetArenaPoints()) + value;
|
||||
if (newValue < 0)
|
||||
newValue = 0;
|
||||
@@ -7289,7 +7285,7 @@ void Player::ModifyArenaPoints(int32 value, SQLTransaction* trans /*=NULL*/)
|
||||
|
||||
if (trans && !trans->null())
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_ARENA_POINTS);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_ARENA_POINTS);
|
||||
stmt->setUInt32(0, newValue);
|
||||
stmt->setUInt32(1, GetGUIDLow());
|
||||
(*trans)->Append(stmt);
|
||||
@@ -15681,7 +15677,6 @@ bool Player::TakeQuestSourceItem(uint32 questId, bool msg)
|
||||
{
|
||||
uint32 srcItemId = quest->GetSrcItemId();
|
||||
ItemTemplate const* item = sObjectMgr->GetItemTemplate(srcItemId);
|
||||
bool destroyItem = true;
|
||||
|
||||
if (srcItemId > 0)
|
||||
{
|
||||
@@ -15701,6 +15696,7 @@ bool Player::TakeQuestSourceItem(uint32 questId, bool msg)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool destroyItem = true;
|
||||
for (uint8 n = 0; n < QUEST_ITEM_OBJECTIVES_COUNT; ++n)
|
||||
if (item->StartQuest == questId && srcItemId == quest->RequiredItemId[n])
|
||||
destroyItem = false;
|
||||
@@ -17637,7 +17633,6 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
|
||||
|
||||
Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields)
|
||||
{
|
||||
PreparedStatement* stmt = NULL;
|
||||
Item* item = NULL;
|
||||
uint32 itemGuid = fields[13].GetUInt32();
|
||||
uint32 itemEntry = fields[14].GetUInt32();
|
||||
@@ -17647,6 +17642,8 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
item = NewItemOrBag(proto);
|
||||
if (item->LoadFromDB(itemGuid, GetGUID(), fields, itemEntry))
|
||||
{
|
||||
PreparedStatement* stmt = NULL;
|
||||
|
||||
// Do not allow to have item limited to another map/zone in alive state
|
||||
if (isAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zoneId))
|
||||
{
|
||||
|
||||
@@ -114,7 +114,7 @@ struct PlayerTalent
|
||||
// Spell modifier (used for modify other spells)
|
||||
struct SpellModifier
|
||||
{
|
||||
SpellModifier(Aura* _ownerAura = NULL) : charges(0), ownerAura(_ownerAura) {}
|
||||
SpellModifier(Aura* _ownerAura = NULL) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) {}
|
||||
SpellModOp op : 8;
|
||||
SpellModType type : 8;
|
||||
int16 charges : 16;
|
||||
|
||||
@@ -54,24 +54,12 @@ struct FriendInfo
|
||||
uint8 Class;
|
||||
std::string Note;
|
||||
|
||||
FriendInfo()
|
||||
FriendInfo() : Status(FRIEND_STATUS_OFFLINE), Flags(0), Area(0), Level(0), Class(0), Note()
|
||||
{
|
||||
Status = FRIEND_STATUS_OFFLINE;
|
||||
Flags = 0;
|
||||
Area = 0;
|
||||
Level = 0;
|
||||
Class = 0;
|
||||
Note = "";
|
||||
}
|
||||
|
||||
FriendInfo(uint8 flags, const std::string& note)
|
||||
FriendInfo(uint8 flags, const std::string& note) : Status(FRIEND_STATUS_OFFLINE), Flags(flags), Area(0), Level(0), Class(0), Note(note)
|
||||
{
|
||||
Status = FRIEND_STATUS_OFFLINE;
|
||||
Flags = flags;
|
||||
Area = 0;
|
||||
Level = 0;
|
||||
Class = 0;
|
||||
Note = note;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ m_movedPlayer(NULL), m_lastSanctuaryTime(0), IsAIEnabled(false), NeedChangeAI(fa
|
||||
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()), i_AI(NULL),
|
||||
i_disabledAI(NULL), m_procDeep(0), m_removedAurasCount(0), i_motionMaster(this),
|
||||
m_ThreatManager(this), m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
|
||||
m_HostileRefManager(this)
|
||||
m_HostileRefManager(this), m_TempSpeed(0.0f), m_AutoRepeatFirstCast(false)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default:4355)
|
||||
@@ -13903,7 +13903,8 @@ void Unit::DeleteCharmInfo()
|
||||
|
||||
CharmInfo::CharmInfo(Unit* unit)
|
||||
: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_petnumber(0), m_barInit(false),
|
||||
m_isCommandAttack(false), m_isAtStay(false), m_isFollowing(false), m_isReturning(false)
|
||||
m_isCommandAttack(false), m_isAtStay(false), m_isFollowing(false), m_isReturning(false),
|
||||
m_stayX(0.0f), m_stayY(0.0f), m_stayZ(0.0f)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_CHARM; ++i)
|
||||
m_charmspells[i].SetActionAndType(0, ACT_DISABLED);
|
||||
|
||||
@@ -7902,8 +7902,6 @@ void ObjectMgr::LoadTrainerSpell()
|
||||
// For reload case
|
||||
_cacheTrainerSpellStore.clear();
|
||||
|
||||
std::set<uint32> skip_trainers;
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT b.entry, a.spell, a.spellcost, a.reqskill, a.reqskillvalue, a.reqlevel FROM npc_trainer AS a "
|
||||
"INNER JOIN npc_trainer AS b ON a.entry = -(b.spell) "
|
||||
"UNION SELECT * FROM npc_trainer WHERE spell > 0");
|
||||
|
||||
@@ -79,9 +79,8 @@ class NGrid
|
||||
public:
|
||||
typedef Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> GridType;
|
||||
NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true)
|
||||
: i_gridId(id), i_x(x), i_y(y), i_cellstate(GRID_STATE_INVALID), i_GridObjectDataLoaded(false)
|
||||
: i_gridId(id), i_x(x), i_y(y), i_cellstate(GRID_STATE_INVALID), i_GridObjectDataLoaded(false), i_GridInfo(GridInfo(expiry, unload))
|
||||
{
|
||||
i_GridInfo = GridInfo(expiry, unload);
|
||||
}
|
||||
|
||||
GridType& GetGridType(const uint32 x, const uint32 y)
|
||||
|
||||
@@ -37,26 +37,6 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
|
||||
uint32 CurrentPosition;
|
||||
uint32 TempValue;
|
||||
|
||||
unsigned char tdata[256] =
|
||||
{
|
||||
0xC3, 0x5B, 0x50, 0x84, 0xB9, 0x3E, 0x32, 0x42, 0x8C, 0xD0, 0xC7, 0x48, 0xFA, 0x0E, 0x5D, 0x54,
|
||||
0x5A, 0xA3, 0x0E, 0x14, 0xBA, 0x9E, 0x0D, 0xB9, 0x5D, 0x8B, 0xEE, 0xB6, 0x84, 0x93, 0x45, 0x75,
|
||||
0xFF, 0x31, 0xFE, 0x2F, 0x64, 0x3F, 0x3D, 0x6D, 0x07, 0xD9, 0x44, 0x9B, 0x40, 0x85, 0x59, 0x34,
|
||||
0x4E, 0x10, 0xE1, 0xE7, 0x43, 0x69, 0xEF, 0x7C, 0x16, 0xFC, 0xB4, 0xED, 0x1B, 0x95, 0x28, 0xA8,
|
||||
0x23, 0x76, 0x51, 0x31, 0x57, 0x30, 0x2B, 0x79, 0x08, 0x50, 0x10, 0x1C, 0x4A, 0x1A, 0x2C, 0xC8,
|
||||
0x8B, 0x8F, 0x05, 0x2D, 0x22, 0x3D, 0xDB, 0x5A, 0x24, 0x7A, 0x0F, 0x13, 0x50, 0x37, 0x8F, 0x5A,
|
||||
0xCC, 0x9E, 0x04, 0x44, 0x0E, 0x87, 0x01, 0xD4, 0xA3, 0x15, 0x94, 0x16, 0x34, 0xC6, 0xC2, 0xC3,
|
||||
0xFB, 0x49, 0xFE, 0xE1, 0xF9, 0xDA, 0x8C, 0x50, 0x3C, 0xBE, 0x2C, 0xBB, 0x57, 0xED, 0x46, 0xB9,
|
||||
0xAD, 0x8B, 0xC6, 0xDF, 0x0E, 0xD6, 0x0F, 0xBE, 0x80, 0xB3, 0x8B, 0x1E, 0x77, 0xCF, 0xAD, 0x22,
|
||||
0xCF, 0xB7, 0x4B, 0xCF, 0xFB, 0xF0, 0x6B, 0x11, 0x45, 0x2D, 0x7A, 0x81, 0x18, 0xF2, 0x92, 0x7E,
|
||||
0x98, 0x56, 0x5D, 0x5E, 0x69, 0x72, 0x0A, 0x0D, 0x03, 0x0A, 0x85, 0xA2, 0x85, 0x9C, 0xCB, 0xFB,
|
||||
0x56, 0x6E, 0x8F, 0x44, 0xBB, 0x8F, 0x02, 0x22, 0x68, 0x63, 0x97, 0xBC, 0x85, 0xBA, 0xA8, 0xF7,
|
||||
0xB5, 0x40, 0x68, 0x3C, 0x77, 0x86, 0x6F, 0x4B, 0xD7, 0x88, 0xCA, 0x8A, 0xD7, 0xCE, 0x36, 0xF0,
|
||||
0x45, 0x6E, 0xD5, 0x64, 0x79, 0x0F, 0x17, 0xFC, 0x64, 0xDD, 0x10, 0x6F, 0xF3, 0xF5, 0xE0, 0xA6,
|
||||
0xC3, 0xFB, 0x1B, 0x8C, 0x29, 0xEF, 0x8E, 0xE5, 0x34, 0xCB, 0xD1, 0x2A, 0xCE, 0x79, 0xC3, 0x9A,
|
||||
0x0D, 0x36, 0xEA, 0x01, 0xE0, 0xAA, 0x91, 0x20, 0x54, 0xF0, 0x72, 0xD8, 0x1E, 0xC7, 0x89, 0xD2
|
||||
};
|
||||
|
||||
// broken addon packet, can't be received from real client
|
||||
if (Source->rpos() + 4 > Source->size())
|
||||
return false;
|
||||
@@ -110,7 +90,28 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
|
||||
uint8 unk = (crc != 0x4c1c776d); // If addon is Standard addon CRC
|
||||
*Target << uint8(unk);
|
||||
if (unk)
|
||||
{
|
||||
unsigned char tdata[256] =
|
||||
{
|
||||
0xC3, 0x5B, 0x50, 0x84, 0xB9, 0x3E, 0x32, 0x42, 0x8C, 0xD0, 0xC7, 0x48, 0xFA, 0x0E, 0x5D, 0x54,
|
||||
0x5A, 0xA3, 0x0E, 0x14, 0xBA, 0x9E, 0x0D, 0xB9, 0x5D, 0x8B, 0xEE, 0xB6, 0x84, 0x93, 0x45, 0x75,
|
||||
0xFF, 0x31, 0xFE, 0x2F, 0x64, 0x3F, 0x3D, 0x6D, 0x07, 0xD9, 0x44, 0x9B, 0x40, 0x85, 0x59, 0x34,
|
||||
0x4E, 0x10, 0xE1, 0xE7, 0x43, 0x69, 0xEF, 0x7C, 0x16, 0xFC, 0xB4, 0xED, 0x1B, 0x95, 0x28, 0xA8,
|
||||
0x23, 0x76, 0x51, 0x31, 0x57, 0x30, 0x2B, 0x79, 0x08, 0x50, 0x10, 0x1C, 0x4A, 0x1A, 0x2C, 0xC8,
|
||||
0x8B, 0x8F, 0x05, 0x2D, 0x22, 0x3D, 0xDB, 0x5A, 0x24, 0x7A, 0x0F, 0x13, 0x50, 0x37, 0x8F, 0x5A,
|
||||
0xCC, 0x9E, 0x04, 0x44, 0x0E, 0x87, 0x01, 0xD4, 0xA3, 0x15, 0x94, 0x16, 0x34, 0xC6, 0xC2, 0xC3,
|
||||
0xFB, 0x49, 0xFE, 0xE1, 0xF9, 0xDA, 0x8C, 0x50, 0x3C, 0xBE, 0x2C, 0xBB, 0x57, 0xED, 0x46, 0xB9,
|
||||
0xAD, 0x8B, 0xC6, 0xDF, 0x0E, 0xD6, 0x0F, 0xBE, 0x80, 0xB3, 0x8B, 0x1E, 0x77, 0xCF, 0xAD, 0x22,
|
||||
0xCF, 0xB7, 0x4B, 0xCF, 0xFB, 0xF0, 0x6B, 0x11, 0x45, 0x2D, 0x7A, 0x81, 0x18, 0xF2, 0x92, 0x7E,
|
||||
0x98, 0x56, 0x5D, 0x5E, 0x69, 0x72, 0x0A, 0x0D, 0x03, 0x0A, 0x85, 0xA2, 0x85, 0x9C, 0xCB, 0xFB,
|
||||
0x56, 0x6E, 0x8F, 0x44, 0xBB, 0x8F, 0x02, 0x22, 0x68, 0x63, 0x97, 0xBC, 0x85, 0xBA, 0xA8, 0xF7,
|
||||
0xB5, 0x40, 0x68, 0x3C, 0x77, 0x86, 0x6F, 0x4B, 0xD7, 0x88, 0xCA, 0x8A, 0xD7, 0xCE, 0x36, 0xF0,
|
||||
0x45, 0x6E, 0xD5, 0x64, 0x79, 0x0F, 0x17, 0xFC, 0x64, 0xDD, 0x10, 0x6F, 0xF3, 0xF5, 0xE0, 0xA6,
|
||||
0xC3, 0xFB, 0x1B, 0x8C, 0x29, 0xEF, 0x8E, 0xE5, 0x34, 0xCB, 0xD1, 0x2A, 0xCE, 0x79, 0xC3, 0x9A,
|
||||
0x0D, 0x36, 0xEA, 0x01, 0xE0, 0xAA, 0x91, 0x20, 0x54, 0xF0, 0x72, 0xD8, 0x1E, 0xC7, 0x89, 0xD2
|
||||
};
|
||||
Target->append(tdata, sizeof(tdata));
|
||||
}
|
||||
|
||||
*Target << uint32(0);
|
||||
}
|
||||
|
||||
@@ -2688,7 +2688,7 @@ uint32 InstanceMap::GetMaxResetDelay() const
|
||||
/* ******* Battleground Instance Maps ******* */
|
||||
|
||||
BattlegroundMap::BattlegroundMap(uint32 id, time_t expiry, uint32 InstanceId, Map* _parent, uint8 spawnMode)
|
||||
: Map(id, expiry, InstanceId, spawnMode, _parent)
|
||||
: Map(id, expiry, InstanceId, spawnMode, _parent), m_bg(NULL)
|
||||
{
|
||||
//lets initialize visibility distance for BG/Arenas
|
||||
BattlegroundMap::InitVisibilityDistance();
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
|
||||
OPvPCapturePoint::OPvPCapturePoint(OutdoorPvP* pvp):
|
||||
m_capturePointGUID(0), m_capturePoint(NULL), m_maxValue(0), m_maxSpeed(0),
|
||||
OPvPCapturePoint::OPvPCapturePoint(OutdoorPvP* pvp) :
|
||||
m_capturePointGUID(0), m_capturePoint(NULL), m_minValue(0.0f), m_maxValue(0.0f), m_maxSpeed(0),
|
||||
m_value(0), m_team(TEAM_NEUTRAL), m_OldState(OBJECTIVESTATE_NEUTRAL),
|
||||
m_State(OBJECTIVESTATE_NEUTRAL), m_neutralValuePct(0), m_PvP(pvp)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ class ReputationMgr
|
||||
{
|
||||
public: // constructors and global modifiers
|
||||
explicit ReputationMgr(Player* owner) : _player(owner),
|
||||
_visibleFactionCount(0), _honoredFactionCount(0), _reveredFactionCount(0), _exaltedFactionCount(0) {}
|
||||
_visibleFactionCount(0), _honoredFactionCount(0), _reveredFactionCount(0), _exaltedFactionCount(0), _sendFactionIncreased(false) {}
|
||||
~ReputationMgr() {}
|
||||
|
||||
void SaveToDB(SQLTransaction& trans);
|
||||
|
||||
@@ -1390,7 +1390,7 @@ inline std::string GetOpcodeNameForLogging(uint16 opcode)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << '[' << LookupOpcodeName(opcode) << " 0x" << std::hex << std::uppercase << opcode << std::nouppercase << " (" << std::dec << opcode << ")]";
|
||||
return ss.str().c_str();
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -87,7 +87,7 @@ SpellDestination::SpellDestination(WorldObject const& wObj)
|
||||
}
|
||||
|
||||
|
||||
SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0)
|
||||
SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0), m_strTarget()
|
||||
{
|
||||
m_objectTarget = NULL;
|
||||
m_itemTarget = NULL;
|
||||
@@ -96,7 +96,6 @@ SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0)
|
||||
m_itemTargetGUID = 0;
|
||||
m_itemTargetEntry = 0;
|
||||
|
||||
m_strTarget = "";
|
||||
m_targetMask = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -312,10 +312,9 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET)
|
||||
return;
|
||||
|
||||
bool apply_direct_bonus = true;
|
||||
|
||||
if (unitTarget && unitTarget->isAlive())
|
||||
{
|
||||
bool apply_direct_bonus = true;
|
||||
switch (m_spellInfo->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_GENERIC:
|
||||
|
||||
@@ -441,7 +441,7 @@ class PetAura
|
||||
typedef UNORDERED_MAP<uint32, uint32> PetAuraMap;
|
||||
|
||||
public:
|
||||
PetAura()
|
||||
PetAura() : removeOnChangePet(false), damage(0)
|
||||
{
|
||||
auras.clear();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user