Core/Misc: Fix some static analysis issues

Fix some static analysis issues about uninitialized values. Most of them are false positives, always initialized before being accessed, while some of them are real issues spotted by valgrind too.
This commit is contained in:
jackpoz
2013-12-14 18:41:26 +01:00
parent dd546f073a
commit 1c0903e286
40 changed files with 203 additions and 19 deletions
@@ -67,6 +67,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mFollowCredit = 0;
mFollowArrivedEntry = 0;
mFollowCreditType = 0;
mFollowArrivedTimer = 0;
mInvincibilityHpLevel = 0;
mJustReset = false;
@@ -1036,6 +1036,10 @@ struct SmartTarget
raw.param1 = p1;
raw.param2 = p2;
raw.param3 = p3;
x = 0.0f;
y = 0.0f;
z = 0.0f;
o = 0.0f;
}
SMARTAI_TARGETS type;
float x, y, z, o;
@@ -45,8 +45,10 @@ Battlefield::Battlefield()
m_MapId = 0;
m_MaxPlayer = 0;
m_MinPlayer = 0;
m_MinLevel = 0;
m_BattleTime = 0;
m_NoWarBattleTime = 0;
m_RestartAfterCrash = 0;
m_TimeForAcceptInvite = 20;
m_uiKickDontAcceptTimer = 1000;
@@ -1064,4 +1064,5 @@ void WintergraspCapturePoint::ChangeTeam(TeamId /*oldTeam*/)
BfGraveyardWG::BfGraveyardWG(BattlefieldWG* battlefield) : BfGraveyard(battlefield)
{
m_Bf = battlefield;
m_GossipTextId = 0;
}
@@ -1481,6 +1481,7 @@ struct WGWorkshop
bf = _bf;
workshopId = _workshopId;
teamControl = BATTLEFIELD_WG_TEAM_NEUTRAL;
state = BATTLEFIELD_WG_OBJECTSTATE_NONE;
}
void GiveControlTo(uint8 team, bool init /* for first call in setup*/)
@@ -146,6 +146,7 @@ Battleground::Battleground()
m_ResetStatTimer = 0;
m_ValidStartPositionTimer = 0;
m_Events = 0;
m_StartDelayTime = 0;
m_IsRated = false;
m_BuffChange = false;
m_IsRandom = false;
@@ -163,6 +164,7 @@ Battleground::Battleground()
m_MapId = 0;
m_Map = NULL;
m_StartMaxDist = 0.0f;
ScriptId = 0;
m_TeamStartLocX[TEAM_ALLIANCE] = 0;
m_TeamStartLocX[TEAM_HORDE] = 0;
@@ -182,6 +184,9 @@ Battleground::Battleground()
m_ArenaTeamRatingChanges[TEAM_ALLIANCE] = 0;
m_ArenaTeamRatingChanges[TEAM_HORDE] = 0;
m_ArenaTeamMMR[TEAM_ALLIANCE] = 0;
m_ArenaTeamMMR[TEAM_HORDE] = 0;
m_BgRaids[TEAM_ALLIANCE] = NULL;
m_BgRaids[TEAM_HORDE] = NULL;
@@ -192,6 +197,7 @@ Battleground::Battleground()
m_TeamScores[TEAM_HORDE] = 0;
m_PrematureCountDown = false;
m_PrematureCountDownTimer = 0;
m_HonorMode = BG_NORMAL;
@@ -52,6 +52,7 @@
BattlegroundMgr::BattlegroundMgr() :
m_NextRatedArenaUpdate(sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER)),
m_NextAutoDistributionTime(0),
m_AutoDistributionTimeChecker(0), m_ArenaTesting(false), m_Testing(false)
{ }
@@ -35,6 +35,27 @@ BattlegroundAB::BattlegroundAB()
BgObjects.resize(BG_AB_OBJECT_MAX);
BgCreatures.resize(BG_AB_ALL_NODES_COUNT + 5);//+5 for aura triggers
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
m_Nodes[i] = 0;
m_prevNodes[i] = 0;
m_NodeTimers[i] = 0;
m_BannerTimers[i].timer = 0;
m_BannerTimers[i].type = 0;
m_BannerTimers[i].teamIndex = 0;
}
for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i)
{
m_lastTick[i] = 0;
m_HonorScoreTics[i] = 0;
m_ReputationScoreTics[i] = 0;
m_TeamScores500Disadvantage[i] = false;
}
m_HonorTics = 0;
m_ReputationTics = 0;
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_AB_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_AB_START_ONE_MINUTE;
StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_AB_START_HALF_MINUTE;
@@ -33,6 +33,25 @@ BattlegroundAV::BattlegroundAV()
BgObjects.resize(BG_AV_OBJECT_MAX);
BgCreatures.resize(AV_CPLACE_MAX+AV_STATICCPLACE_MAX);
for (uint8 i = 0; i < 2; i++)
{
for (uint8 j = 0; j < 9; j++)
m_Team_QuestStatus[i][j] = 0;
m_Team_Scores[i] = 0;
m_IsInformedNearVictory[i] = false;
m_CaptainAlive[i] = true;
m_CaptainBuffTimer[i] = 0;
m_Mine_Owner[i] = 0;
m_Mine_PrevOwner[i] = 0;
m_Mine_Reclaim_Timer[i] = 0;
}
m_Mine_Timer = 0;
m_MaxLevel = 0;
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
InitNode(i, 0, false);
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_AV_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_AV_START_ONE_MINUTE;
StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_AV_START_HALF_MINUTE;
@@ -29,6 +29,12 @@ BattlegroundDS::BattlegroundDS()
BgObjects.resize(BG_DS_OBJECT_MAX);
BgCreatures.resize(BG_DS_NPC_MAX);
_waterfallTimer = 0;
_waterfallStatus = 0;
_waterfallKnockbackTimer = 0;
_pipeKnockBackTimer = 0;
_pipeKnockBackCount = 0;
StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
@@ -43,6 +43,28 @@ BattlegroundEY::BattlegroundEY()
m_Points_Trigger[BLOOD_ELF] = TR_BLOOD_ELF_BUFF;
m_Points_Trigger[DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF;
m_Points_Trigger[MAGE_TOWER] = TR_MAGE_TOWER_BUFF;
m_HonorScoreTics[TEAM_ALLIANCE] = 0;
m_HonorScoreTics[TEAM_HORDE] = 0;
m_TeamPointsCount[TEAM_ALLIANCE] = 0;
m_TeamPointsCount[TEAM_HORDE] = 0;
m_FlagKeeper = 0;
m_DroppedFlagGUID = 0;
m_FlagCapturedBgObjectType = 0;
m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
m_FlagsTimer = 0;
m_TowerCapCheckTimer = 0;
m_PointAddingTimer = 0;
m_HonorTics = 0;
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
{
m_PointOwnedByTeam[i] = EY_POINT_NO_OWNER;
m_PointState[i] = EY_POINT_STATE_UNCONTROLLED;
m_PointBarStatus[i] = BG_EY_PROGRESS_BAR_STATE_MIDDLE;
}
for (uint8 i = 0; i < 2 * EY_POINTS_MAX; ++i)
m_CurrentPointPlayersCount[i] = 0;
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_EY_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
@@ -28,6 +28,10 @@ BattlegroundRV::BattlegroundRV()
{
BgObjects.resize(BG_RV_OBJECT_MAX);
Timer = 0;
State = 0;
PillarCollision = false;
StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
@@ -37,6 +37,22 @@ BattlegroundSA::BattlegroundSA()
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = false;
gateDestroyed = false;
Attackers = TEAM_ALLIANCE;
TotalTime = 0;
EndRoundTimer = 0;
ShipsStarted = false;
Status = BG_SA_NOTSTARTED;
for (uint8 i = 0; i < 6; i++)
GateStatus[i] = BG_SA_GATE_OK;
for (uint8 i = 0; i < 2; i++)
{
RoundScores[i].winner = TEAM_ALLIANCE;
RoundScores[i].time = 0;
_allVehiclesAlive[i] = true;
}
//! This is here to prevent an uninitialised variable warning
//! The warning only occurs when SetUpBattleGround fails though.
@@ -54,6 +54,21 @@ BattlegroundWS::BattlegroundWS()
_flagSpellForceTimer = 0;
_bothFlagsKept = false;
_flagDebuffState = 0;
m_FlagKeepers[TEAM_ALLIANCE] = 0;
m_FlagKeepers[TEAM_HORDE] = 0;
m_DroppedFlagGUID[TEAM_ALLIANCE] = 0;
m_DroppedFlagGUID[TEAM_HORDE] = 0;
_flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
_flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
_flagsTimer[TEAM_ALLIANCE] = 0;
_flagsTimer[TEAM_HORDE] = 0;
_flagsDropTimer[TEAM_ALLIANCE] = 0;
_flagsDropTimer[TEAM_HORDE] = 0;
_lastFlagCaptureTeam = 0;
m_ReputationCapture = 0;
m_HonorWinKills = 0;
m_HonorEndKills = 0;
_minutesElapsed = 0;
}
BattlegroundWS::~BattlegroundWS() { }
+1 -1
View File
@@ -34,7 +34,7 @@ CalendarEvent::~CalendarEvent()
sCalendarMgr->FreeEventId(_eventId);
}
CalendarMgr::CalendarMgr() { }
CalendarMgr::CalendarMgr() : _maxEventId(0), _maxInviteId(0) { }
CalendarMgr::~CalendarMgr()
{
@@ -192,6 +192,7 @@ struct Condition
SourceType = CONDITION_SOURCE_TYPE_NONE;
SourceGroup = 0;
SourceEntry = 0;
SourceId = 0;
ElseGroup = 0;
ConditionType = CONDITION_NONE;
ConditionTarget = 0;
@@ -147,7 +147,7 @@ m_PlayerDamageReq(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemov
m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE),
m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
m_creatureInfo(NULL), m_creatureData(NULL), m_path_id(0), m_formation(NULL)
m_originalEntry(0), m_homePosition(), m_transportHomePosition(), m_creatureInfo(NULL), m_creatureData(NULL), m_waypointID(0), m_path_id(0), m_formation(NULL)
{
m_regenTimer = CREATURE_REGEN_INTERVAL;
m_valuesCount = UNIT_END;
+4 -1
View File
@@ -246,7 +246,10 @@ typedef UNORDERED_MAP<uint32, EquipmentInfoContainerInternal> EquipmentInfoConta
// from `creature` table
struct CreatureData
{
CreatureData() : dbData(true) { }
CreatureData() : id(0), mapid(0), phaseMask(0), displayid(0), equipmentId(0),
posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f), spawntimesecs(0),
spawndist(0.0f), currentwaypoint(0), curhealth(0), curmana(0), movementType(0),
spawnMask(0), npcflag(0), unit_flags(0), dynamicflags(0), dbData(true) { }
uint32 id; // entry in creature_template
uint16 mapid;
uint32 phaseMask;
@@ -27,6 +27,7 @@
GossipMenu::GossipMenu()
{
_menuId = 0;
_locale = DEFAULT_LOCALE;
}
GossipMenu::~GossipMenu()
@@ -589,7 +589,9 @@ enum GOState
// from `gameobject`
struct GameObjectData
{
explicit GameObjectData() : dbData(true) { }
explicit GameObjectData() : id(0), mapid(0), phaseMask(0), posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f),
rotation0(0.0f), rotation1(0.0f), rotation2(0.0f), rotation3(0.0f), spawntimesecs(0),
animprogress(0), go_state(GO_STATE_ACTIVE), spawnMask(0), artKit(0), dbData(true) { }
uint32 id; // entry in gamobject_template
uint16 mapid;
uint32 phaseMask;
+1 -1
View File
@@ -1082,7 +1082,7 @@ void MovementInfo::OutDebug()
TC_LOG_INFO("misc", "splineElevation: %f", splineElevation);
}
WorldObject::WorldObject(bool isWorldObject): WorldLocation(),
WorldObject::WorldObject(bool isWorldObject) : WorldLocation(), LastUsedScriptID(0),
m_name(""), m_isActive(false), m_isWorldObject(isWorldObject), m_zoneScript(NULL),
m_transport(NULL), m_currMap(NULL), m_InstanceId(0),
m_phaseMask(PHASEMASK_NORMAL), m_notifyflags(0), m_executed_notifies(0)
@@ -663,6 +663,7 @@ Player::Player(WorldSession* session): Unit(true)
m_session = session;
m_divider = 0;
m_ingametime = 0;
m_ExtraFlags = 0;
@@ -689,6 +690,7 @@ Player::Player(WorldSession* session): Unit(true)
m_zoneUpdateTimer = 0;
m_areaUpdateId = 0;
m_team = 0;
m_nextSave = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
@@ -750,6 +752,8 @@ Player::Player(WorldSession* session): Unit(true)
m_logintime = time(NULL);
m_Last_tick = m_logintime;
m_Played_time[PLAYED_TIME_TOTAL] = 0;
m_Played_time[PLAYED_TIME_LEVEL] = 0;
m_WeaponProficiency = 0;
m_ArmorProficiency = 0;
m_canParry = false;
@@ -795,6 +799,7 @@ Player::Player(WorldSession* session): Unit(true)
m_InstanceValid = true;
m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL;
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
m_raidMapDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
m_lastPotionId = 0;
@@ -840,6 +845,18 @@ Player::Player(WorldSession* session): Unit(true)
m_movedPlayer = this;
m_seer = this;
m_recallMap = 0;
m_recallX = 0;
m_recallY = 0;
m_recallZ = 0;
m_recallO = 0;
m_homebindMapId = 0;
m_homebindAreaId = 0;
m_homebindX = 0;
m_homebindY = 0;
m_homebindZ = 0;
m_contestedPvPTimer = 0;
m_declinedname = NULL;
@@ -859,6 +876,11 @@ Player::Player(WorldSession* session): Unit(true)
m_ChampioningFaction = 0;
m_timeSyncCounter = 0;
m_timeSyncTimer = 0;
m_timeSyncClient = 0;
m_timeSyncServer = 0;
for (uint8 i = 0; i < MAX_POWERS; ++i)
m_powerFraction[i] = 0;
+3 -3
View File
@@ -165,7 +165,7 @@ Unit::Unit(bool isWorldObject) :
IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(0),
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()),
i_AI(NULL), i_disabledAI(NULL), m_AutoRepeatFirstCast(false), m_procDeep(0),
m_removedAurasCount(0), i_motionMaster(new MotionMaster(this)), m_ThreatManager(this),
m_removedAurasCount(0), i_motionMaster(new MotionMaster(this)), m_regenTimer(0), m_ThreatManager(this),
m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
m_HostileRefManager(this), _lastDamagedTime(0)
{
@@ -13561,8 +13561,8 @@ void Unit::DeleteCharmInfo()
}
CharmInfo::CharmInfo(Unit* unit)
: _unit(unit), _CommandState(COMMAND_FOLLOW), _petnumber(0), _barInit(false),
_isCommandAttack(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
: _unit(unit), _CommandState(COMMAND_FOLLOW), _petnumber(0), _barInit(false), _oldReactState(REACT_PASSIVE),
_isCommandAttack(false), _isCommandFollow(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
_stayX(0.0f), _stayY(0.0f), _stayZ(0.0f)
{
for (uint8 i = 0; i < MAX_SPELL_CHARM; ++i)
+1 -1
View File
@@ -35,7 +35,7 @@
#include "Battleground.h"
Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) :
UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry), _status(STATUS_NONE)
UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry), _status(STATUS_NONE), _lastShootPos()
{
for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
{
+2 -1
View File
@@ -55,7 +55,8 @@ typedef std::map<uint32 /*condition id*/, GameEventFinishCondition> GameEventCon
struct GameEventData
{
GameEventData() : start(1), end(0), nextstart(0), occurence(0), length(0), holiday_id(HOLIDAY_NONE), state(GAMEEVENT_NORMAL) { }
GameEventData() : start(1), end(0), nextstart(0), occurence(0), length(0), holiday_id(HOLIDAY_NONE), state(GAMEEVENT_NORMAL),
announce(0) { }
time_t start; // occurs after this time
time_t end; // occurs before this time
time_t nextstart; // after this time the follow-up events count this phase completed
+1
View File
@@ -364,6 +364,7 @@ LootItem::LootItem(LootStoreItem const& li)
randomSuffix = GenerateEnchSuffixFactor(itemid);
randomPropertyId = Item::GenerateItemRandomPropertyId(itemid);
count = 0;
is_looted = 0;
is_blocked = 0;
is_underthreshold = 0;
+4 -2
View File
@@ -148,7 +148,9 @@ struct LootItem
explicit LootItem(LootStoreItem const& li);
// Empty constructor for creating an empty LootItem to be filled in with DB data
LootItem() : canSave(true){ };
LootItem() : itemid(0), randomSuffix(0), randomPropertyId(0), count(0), is_looted(false), is_blocked(false),
freeforall(false), is_underthreshold(false), is_counted(false), needs_quest(false), follow_loot_rules(false),
canSave(true){ };
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
bool AllowedForPlayer(Player const* player) const;
@@ -303,7 +305,7 @@ struct Loot
// Only set for inventory items that can be right-click looted
uint32 containerID;
Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), loot_type(LOOT_CORPSE), maxDuplicates(1), containerID(0) { }
Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), roundRobinPlayer(0), loot_type(LOOT_CORPSE), maxDuplicates(1), containerID(0) { }
~Loot() { clear(); }
// For deleting items at loot removal since there is no backward interface to the Item()
+1
View File
@@ -1375,6 +1375,7 @@ GridMap::GridMap()
// Height level data
_gridHeight = INVALID_HEIGHT;
_gridGetHeight = &GridMap::getHeightFromFlat;
_gridIntHeightMultiplier = 0;
m_V9 = NULL;
m_V8 = NULL;
// Liquid data
+3
View File
@@ -43,6 +43,9 @@ MapManager::MapManager()
{
i_gridCleanUpDelay = sWorld->getIntConfig(CONFIG_INTERVAL_GRIDCLEAN);
i_timer.SetInterval(sWorld->getIntConfig(CONFIG_INTERVAL_MAPUPDATE));
memset(i_GridStates, 0, sizeof(i_GridStates));
i_GridStateErrorCount = 0;
_nextInstanceId = 0;
}
MapManager::~MapManager() { }
@@ -26,7 +26,7 @@ template<class T>
class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMovementGenerator<T> >
{
public:
explicit ConfusedMovementGenerator() : i_nextMoveTime(0) { }
explicit ConfusedMovementGenerator() : i_nextMoveTime(0), i_x(0), i_y(0), i_z(0) { }
void DoInitialize(T*);
void DoFinalize(T*);
@@ -37,7 +37,6 @@ class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovemen
private:
TimeTrackerSmall i_nextMoveTime;
uint32 i_nextMove;
float wander_distance;
};
#endif
@@ -117,6 +117,10 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, Flig
{
i_path = &pathnodes;
i_currentNode = startNode;
_endGridX = 0.0f;
_endGridY = 0.0f;
_endMapId = 0;
_preloadTargetNode = 0;
}
void DoInitialize(Player*);
void DoReset(Player*);
+1 -1
View File
@@ -231,7 +231,7 @@ void OutdoorPvP::DeleteSpawns()
m_capturePoints.clear();
}
OutdoorPvP::OutdoorPvP() : m_sendUpdate(true) { }
OutdoorPvP::OutdoorPvP() : m_TypeId(0), m_sendUpdate(true) { }
OutdoorPvP::~OutdoorPvP()
{
+3
View File
@@ -100,6 +100,7 @@ WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8
m_muteTime(mute_time),
m_timeOutTime(0),
AntiDOS(this),
m_GUIDLow(0),
_player(NULL),
m_Socket(sock),
_security(sec),
@@ -122,6 +123,8 @@ WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8
timeLastWhoCommand(0),
_RBACData(NULL)
{
memset(m_Tutorials, 0, sizeof(m_Tutorials));
if (sock)
{
m_Address = sock->GetRemoteAddress();
@@ -344,6 +344,7 @@ m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false)
m_duration = m_maxDuration;
m_procCharges = CalcMaxCharges(caster);
m_isUsingCharges = m_procCharges != 0;
memset(m_effects, 0, sizeof(m_effects));
// m_casterLevel = cast item level/caster level, caster level should be saved to db, confirmed with sniffs
}
+2
View File
@@ -70,12 +70,14 @@ SpellDestination::SpellDestination(float x, float y, float z, float orientation,
_position.Relocate(x, y, z, orientation);
_transportGUID = 0;
_position.m_mapId = mapId;
_transportOffset.Relocate(0, 0, 0, 0);
}
SpellDestination::SpellDestination(Position const& pos)
{
_position.Relocate(pos);
_transportGUID = 0;
_transportOffset.Relocate(0, 0, 0, 0);
}
SpellDestination::SpellDestination(WorldObject const& wObj)
+4 -2
View File
@@ -32,9 +32,11 @@ inline float GetAge(uint64 t) { return float(time(NULL) - t) / DAY; }
///////////////////////////////////////////////////////////////////////////////////////////////////
// GM ticket
GmTicket::GmTicket() { }
GmTicket::GmTicket() : _id(0), _playerGuid(0), _posX(0), _posY(0), _posZ(0), _mapId(0), _createTime(0), _lastModifiedTime(0),
_closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false),
_needResponse(false), _haveTicket(false) { }
GmTicket::GmTicket(Player* player, WorldPacket& recvData) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _haveTicket(false)
GmTicket::GmTicket(Player* player, WorldPacket& recvData) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false), _haveTicket(false)
{
_id = sTicketMgr->GenerateTicketId();
_playerName = player->GetName();
+1 -1
View File
@@ -34,7 +34,7 @@
#include "WardenCheckMgr.h"
#include "AccountMgr.h"
WardenWin::WardenWin() : Warden() { }
WardenWin::WardenWin() : Warden(), _serverTicks(0) {}
WardenWin::~WardenWin() { }
+12
View File
@@ -109,16 +109,28 @@ World::World()
m_MaxPlayerCount = 0;
m_NextDailyQuestReset = 0;
m_NextWeeklyQuestReset = 0;
m_NextMonthlyQuestReset = 0;
m_NextRandomBGReset = 0;
m_NextGuildReset = 0;
m_defaultDbcLocale = LOCALE_enUS;
m_availableDbcLocaleMask = 0;
mail_timer = 0;
mail_timer_expires = 0;
m_updateTime;
m_updateTimeSum = 0;
m_updateTimeCount = 0;
m_currentTime = 0;
m_isClosed = false;
m_CleaningFlags = 0;
memset(rate_values, 0, sizeof(rate_values));
memset(m_int_configs, 0, sizeof(m_int_configs));
memset(m_bool_configs, 0, sizeof(m_bool_configs));
memset(m_float_configs, 0, sizeof(m_float_configs));
}
/// World destructor
+6 -1
View File
@@ -28,7 +28,12 @@
class BasicEvent
{
public:
BasicEvent() { to_Abort = false; }
BasicEvent()
{
to_Abort = false;
m_addTime = 0;
m_execTime = 0;
}
virtual ~BasicEvent() { } // override destructor to perform some actions on event removal
// this method executes when the event is triggered