mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Fix some code porting discrepancies
This commit is contained in:
parent
f0febf526b
commit
00983174a5
19 changed files with 41 additions and 41 deletions
|
|
@ -481,7 +481,7 @@ void CalendarMgr::CopyEvent(uint64 eventId, time_t newTime, ObjectGuid const& gu
|
|||
return;
|
||||
|
||||
if (newEvent->IsGuildAnnouncement())
|
||||
AddInvite(newEvent, guid, guid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(nullptr));
|
||||
AddInvite(newEvent, guid, guid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(NULL));
|
||||
else
|
||||
{
|
||||
// copy all invitees, set new owner as the one who make the copy, set invitees status to invited
|
||||
|
|
@ -493,7 +493,7 @@ void CalendarMgr::CopyEvent(uint64 eventId, time_t newTime, ObjectGuid const& gu
|
|||
const CalendarInvite* invite = ci_itr->second;
|
||||
if (invite->InviteeGuid == guid)
|
||||
{
|
||||
AddInvite(newEvent, guid, invite->InviteeGuid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(nullptr));
|
||||
AddInvite(newEvent, guid, invite->InviteeGuid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(NULL));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -502,7 +502,7 @@ void CalendarMgr::CopyEvent(uint64 eventId, time_t newTime, ObjectGuid const& gu
|
|||
if (invite->Rank == CALENDAR_RANK_MODERATOR)
|
||||
rank = CALENDAR_RANK_MODERATOR;
|
||||
|
||||
AddInvite(newEvent, guid, invite->InviteeGuid, CALENDAR_STATUS_INVITED, rank, "", time(nullptr));
|
||||
AddInvite(newEvent, guid, invite->InviteeGuid, CALENDAR_STATUS_INVITED, rank, "", time(NULL));
|
||||
}
|
||||
++ci_itr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1785,7 +1785,7 @@ void Creature::SetDeathState(DeathState s)
|
|||
if ((s == JUST_DIED && !m_IsDeadByDefault) || (s == JUST_ALIVED && m_IsDeadByDefault))
|
||||
{
|
||||
m_corpseDecayTimer = m_corpseDelay * IN_MILLISECONDS; // the max/default time for corpse decay (before creature is looted/AllLootRemovedFromCorpse() is called)
|
||||
m_respawnTime = time(nullptr) + m_respawnDelay; // respawn delay (spawntimesecs)
|
||||
m_respawnTime = time(NULL) + m_respawnDelay; // respawn delay (spawntimesecs)
|
||||
|
||||
// always save boss respawn time at death to prevent crash cheating
|
||||
if (sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATELY) || IsWorldBoss())
|
||||
|
|
@ -1818,7 +1818,7 @@ void Creature::SetDeathState(DeathState s)
|
|||
Unit::SetDeathState(ALIVE);
|
||||
|
||||
SetHealth(GetMaxHealth());
|
||||
SetLootRecipient(nullptr);
|
||||
SetLootRecipient(NULL);
|
||||
if (GetTemporaryFactionFlags() & TEMPFACTION_RESTORE_RESPAWN)
|
||||
ClearTemporaryFaction();
|
||||
|
||||
|
|
|
|||
|
|
@ -1136,7 +1136,7 @@ void CreatureEventAI::EnterEvadeMode()
|
|||
if (m_creature->IsAlive() && !m_creature->IsBoarded())
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
m_creature->SetLootRecipient(nullptr);
|
||||
m_creature->SetLootRecipient(NULL);
|
||||
|
||||
// Handle Evade events
|
||||
for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i)
|
||||
|
|
|
|||
|
|
@ -1535,7 +1535,7 @@ uint32 Guild::GetMemberSlotWithdrawRem(uint32 LowGuid, uint8 TabId)
|
|||
if ((GetBankRights(member.RankId, TabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
|
||||
return 0;
|
||||
|
||||
uint32 curTime = uint32(time(nullptr) / MINUTE);
|
||||
uint32 curTime = uint32(time(NULL) / MINUTE);
|
||||
if (curTime - member.BankResetTimeTab[TabId] >= 24 * HOUR / MINUTE)
|
||||
{
|
||||
member.BankResetTimeTab[TabId] = curTime;
|
||||
|
|
@ -1556,7 +1556,7 @@ uint64 Guild::GetMemberMoneyWithdrawRem(uint32 LowGuid)
|
|||
if (member.RankId == GR_GUILDMASTER)
|
||||
return WITHDRAW_MONEY_UNLIMITED;
|
||||
|
||||
uint32 curTime = uint32(time(nullptr) / MINUTE); // minutes
|
||||
uint32 curTime = uint32(time(NULL) / MINUTE); // minutes
|
||||
// 24 hours
|
||||
if (curTime > member.BankResetTimeMoney + 24 * HOUR / MINUTE)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ Pet::Pet(PetType type) :
|
|||
m_resetTalentsCost(0), m_resetTalentsTime(0), m_usedTalentCount(0),
|
||||
m_removed(false), m_petType(type), m_duration(0),
|
||||
m_bonusdamage(0), m_auraUpdateMask(0), m_loading(false),
|
||||
m_declinedname(nullptr), m_petModeFlags(PET_MODE_DEFAULT), m_retreating(false),
|
||||
m_declinedname(NULL), m_petModeFlags(PET_MODE_DEFAULT), m_retreating(false),
|
||||
m_stayPosSet(false), m_stayPosX(0), m_stayPosY(0), m_stayPosZ(0), m_stayPosO(0),
|
||||
m_opener(0), m_openerMinRange(0), m_openerMaxRange(0)
|
||||
{
|
||||
|
|
@ -426,7 +426,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
|||
};
|
||||
savePet.addString(ss);
|
||||
|
||||
savePet.addUInt64(uint64(time(nullptr)));
|
||||
savePet.addUInt64(uint64(time(NULL)));
|
||||
savePet.addUInt32(uint32(m_resetTalentsCost));
|
||||
savePet.addUInt64(uint64(m_resetTalentsTime));
|
||||
savePet.addUInt32(GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||
|
|
|
|||
|
|
@ -19089,7 +19089,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
|
|||
WorldPacket data(SMSG_SPELL_COOLDOWN, 8 + 1 + m_spells.size() * 8);
|
||||
data << GetObjectGuid();
|
||||
data << uint8(0x0); // flags (0x1, 0x2)
|
||||
time_t curTime = time(nullptr);
|
||||
time_t curTime = time(NULL);
|
||||
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||
{
|
||||
if (itr->second.state == PLAYERSPELL_REMOVED)
|
||||
|
|
@ -21346,10 +21346,10 @@ void Player::Uncharm()
|
|||
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
|
||||
if (charm == GetMover())
|
||||
{
|
||||
SetMover(nullptr);
|
||||
SetMover(NULL);
|
||||
GetCamera().ResetView();
|
||||
RemoveSpellsCausingAura(SPELL_AURA_MOD_INVISIBILITY);
|
||||
SetCharm(nullptr);
|
||||
SetCharm(NULL);
|
||||
SetClientControl(this, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions;
|
|||
struct PlayerInfo
|
||||
{
|
||||
// existence checked by displayId != 0 // existence checked by displayId != 0
|
||||
PlayerInfo() : mapId(0), areaId(0), positionX(0.f), positionY(0.f), positionZ(0.f), orientation(0.f), displayId_m(0), displayId_f(0), levelInfo(nullptr)
|
||||
PlayerInfo() : mapId(0), areaId(0), positionX(0.f), positionY(0.f), positionZ(0.f), orientation(0.f), displayId_m(0), displayId_f(0), levelInfo(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -491,10 +491,10 @@ void GlobalCooldownMgr::CancelGlobalCooldown(SpellEntry const* spellInfo)
|
|||
|
||||
Unit::Unit() :
|
||||
movespline(new Movement::MoveSpline()),
|
||||
m_charmInfo(nullptr),
|
||||
m_charmInfo(NULL),
|
||||
i_motionMaster(this),
|
||||
m_regenTimer(0),
|
||||
m_vehicleInfo(nullptr),
|
||||
m_vehicleInfo(NULL),
|
||||
m_ThreatManager(this),
|
||||
m_HostileRefManager(this)
|
||||
{
|
||||
|
|
@ -12450,7 +12450,7 @@ void Unit::ResetControlState(bool attackCharmer /*= true*/)
|
|||
{
|
||||
player->GetCamera().ResetView();
|
||||
player->SetClientControl(player, 1);
|
||||
player->SetMover(nullptr);
|
||||
player->SetMover(NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -12465,7 +12465,7 @@ void Unit::ResetControlState(bool attackCharmer /*= true*/)
|
|||
if (player)
|
||||
{
|
||||
player->SetClientControl(possessed, 0);
|
||||
player->SetMover(nullptr);
|
||||
player->SetMover(NULL);
|
||||
player->GetCamera().ResetView();
|
||||
|
||||
if (possessedCreature->IsPet() && possessedCreature->GetObjectGuid() == GetPetGuid())
|
||||
|
|
|
|||
|
|
@ -93,16 +93,16 @@ class ThreatRefStatusChangeEvent : public UnitBaseEvent
|
|||
};
|
||||
ThreatManager* iThreatManager;
|
||||
public:
|
||||
ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(nullptr)
|
||||
ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(NULL)
|
||||
{ iHostileReference = nullptr; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(nullptr)
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(NULL)
|
||||
{ iHostileReference = pHostileReference; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iThreatManager(nullptr)
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iThreatManager(NULL)
|
||||
{ iHostileReference = pHostileReference; iFValue = pValue; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatManager(nullptr)
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatManager(NULL)
|
||||
{ iHostileReference = pHostileReference; iBValue = pValue; }
|
||||
|
||||
int32 getIValue() const { return iIValue; }
|
||||
|
|
|
|||
|
|
@ -597,11 +597,11 @@ void VehicleInfo::RemoveSeatMods(Unit* passenger, uint32 seatFlags)
|
|||
|
||||
if (seatFlags & SEAT_FLAG_CAN_CONTROL)
|
||||
{
|
||||
pPlayer->SetCharm(nullptr);
|
||||
pPlayer->SetCharm(NULL);
|
||||
pVehicle->SetCharmerGuid(ObjectGuid());
|
||||
|
||||
pPlayer->SetClientControl(pVehicle, 0);
|
||||
pPlayer->SetMover(nullptr);
|
||||
pPlayer->SetMover(NULL);
|
||||
|
||||
pVehicle->clearUnitState(UNIT_STAT_CONTROLLED);
|
||||
pVehicle->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
|
|
@ -621,7 +621,7 @@ void VehicleInfo::RemoveSeatMods(Unit* passenger, uint32 seatFlags)
|
|||
{
|
||||
if (seatFlags & SEAT_FLAG_CAN_CONTROL)
|
||||
{
|
||||
passenger->SetCharm(nullptr);
|
||||
passenger->SetCharm(NULL);
|
||||
pVehicle->SetCharmerGuid(ObjectGuid());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class ChatHandler
|
|||
char const* channelName = NULL, uint32 achievementId = 0, const char* addonPrefix = NULL);
|
||||
|
||||
protected:
|
||||
explicit ChatHandler() : m_session(nullptr), sentErrorMessage(false) {} // for CLI subclass
|
||||
explicit ChatHandler() : m_session(NULL), sentErrorMessage(false) {} // for CLI subclass
|
||||
|
||||
bool hasStringAbbr(const char* name, const char* part);
|
||||
|
||||
|
|
|
|||
|
|
@ -635,7 +635,7 @@ bool CreatureLinkingHolder::IsSlaveInRangeOfBoss(Creature const* pBoss, float sX
|
|||
bool CreatureLinkingHolder::IsRespawnReady(uint32 dbLowGuid, Map* _map) const
|
||||
{
|
||||
time_t respawnTime = _map->GetPersistentState()->GetCreatureRespawnTime(dbLowGuid);
|
||||
return (!respawnTime || respawnTime <= time(nullptr)) && CanSpawn(dbLowGuid, _map, nullptr, 0.0f, 0.0f);
|
||||
return (!respawnTime || respawnTime <= time(NULL)) && CanSpawn(dbLowGuid, _map, nullptr, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
// Function to check if a passive spawning condition is met
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ Map::~Map()
|
|||
sScriptMgr.DecreaseScheduledScriptCount(m_scriptSchedule.size());
|
||||
|
||||
if (m_persistentState)
|
||||
m_persistentState->SetUsedByMapState(nullptr); // field pointer can be deleted after this
|
||||
m_persistentState->SetUsedByMapState(NULL); // field pointer can be deleted after this
|
||||
|
||||
delete i_data;
|
||||
i_data = nullptr;
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@ void DungeonResetScheduler::ScheduleReset(bool add, time_t time, DungeonResetEve
|
|||
|
||||
void DungeonResetScheduler::Update()
|
||||
{
|
||||
time_t now = time(nullptr), t;
|
||||
time_t now = time(NULL), t;
|
||||
while (!m_resetTimeQueue.empty() && (t = m_resetTimeQueue.begin()->first) < now)
|
||||
{
|
||||
DungeonResetEvent& event = m_resetTimeQueue.begin()->second;
|
||||
|
|
@ -596,7 +596,7 @@ void DungeonResetScheduler::Update()
|
|||
|
||||
void DungeonResetScheduler::ResetAllRaid()
|
||||
{
|
||||
time_t now = time(nullptr);
|
||||
time_t now = time(NULL);
|
||||
ResetTimeQueue rTQ;
|
||||
rTQ.clear();
|
||||
|
||||
|
|
@ -921,7 +921,7 @@ void MapPersistentStateManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficu
|
|||
if (!mapEntry->IsDungeon())
|
||||
return;
|
||||
|
||||
time_t now = time(nullptr);
|
||||
time_t now = time(NULL);
|
||||
|
||||
if (!warn)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -716,7 +716,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
|
|||
spell->m_cast_count = cast_count; // probably pending spell cast
|
||||
spell->m_targets = targets;
|
||||
|
||||
SpellCastResult result = triggeredByAura ? SPELL_CAST_OK : spell->CheckPetCast(nullptr);
|
||||
SpellCastResult result = triggeredByAura ? SPELL_CAST_OK : spell->CheckPetCast(NULL);
|
||||
if (result == SPELL_CAST_OK)
|
||||
{
|
||||
pet->AddCreatureSpellCooldown(spellid);
|
||||
|
|
|
|||
|
|
@ -3184,7 +3184,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
|||
if (apply)
|
||||
caster->FixateTarget(target);
|
||||
else if (target->GetObjectGuid() == caster->GetFixateTargetGuid())
|
||||
caster->FixateTarget(nullptr);
|
||||
caster->FixateTarget(NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1157,7 +1157,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
|
|||
return;
|
||||
}
|
||||
|
||||
pGameObj->SetRespawnTime(creatureTarget->GetRespawnTime() - time(nullptr));
|
||||
pGameObj->SetRespawnTime(creatureTarget->GetRespawnTime() - time(NULL));
|
||||
pGameObj->SetOwnerGuid(m_caster->GetObjectGuid());
|
||||
pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
|
||||
pGameObj->SetSpellId(m_spellInfo->Id);
|
||||
|
|
@ -6689,7 +6689,7 @@ void Spell::EffectSummonPet(SpellEffectEntry const* effect)
|
|||
NewSummon->SetOwnerGuid(m_caster->GetObjectGuid());
|
||||
NewSummon->SetCreatorGuid(m_caster->GetObjectGuid());
|
||||
NewSummon->setFaction(m_caster->getFaction());
|
||||
NewSummon->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(nullptr)));
|
||||
NewSummon->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL)));
|
||||
NewSummon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
|
||||
|
||||
NewSummon->InitStatsForLevel(level);
|
||||
|
|
@ -11909,7 +11909,7 @@ void Spell::EffectCreateTamedPet(SpellEffectEntry const* effect)
|
|||
newTamedPet->SetCreatorGuid(unitTarget->GetObjectGuid());
|
||||
newTamedPet->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
newTamedPet->setFaction(unitTarget->getFaction());
|
||||
newTamedPet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(nullptr)));
|
||||
newTamedPet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL)));
|
||||
newTamedPet->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
|
||||
|
||||
newTamedPet->GetCharmInfo()->SetPetNumber(petNumber, true);
|
||||
|
|
|
|||
|
|
@ -2382,7 +2382,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
|
||||
// apply cooldown before cast to prevent processing itself
|
||||
if (cooldown)
|
||||
((Player*)this)->AddSpellCooldown(dummySpell->Id, 0, time(nullptr) + cooldown);
|
||||
((Player*)this)->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown);
|
||||
|
||||
// Attack Twice
|
||||
for (uint32 i = 0; i < 2; ++i)
|
||||
|
|
@ -2641,7 +2641,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
CastSpell(pVictim, spellId, true, castItem, triggeredByAura);
|
||||
|
||||
if (cooldown && GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)this)->AddSpellCooldown(dummySpell->Id, 0, time(nullptr) + cooldown);
|
||||
((Player*)this)->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown);
|
||||
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
|
|
@ -2894,7 +2894,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
|
|||
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura);
|
||||
|
||||
if (cooldown && GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)this)->AddSpellCooldown(triggered_spell_id, 0, time(nullptr) + cooldown);
|
||||
((Player*)this)->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown);
|
||||
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
|
|
@ -3822,7 +3822,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d
|
|||
CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura);
|
||||
|
||||
if (cooldown && GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)this)->AddSpellCooldown(trigger_spell_id, 0, time(nullptr) + cooldown);
|
||||
((Player*)this)->AddSpellCooldown(trigger_spell_id, 0, time(NULL) + cooldown);
|
||||
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1489,7 +1489,7 @@ void World::SetInitialWorldSettings()
|
|||
|
||||
// ToDo: requires fix after the latest updates
|
||||
//sLog.outString("Loading grids for active creatures or transports...");
|
||||
//sObjectMgr.LoadActiveEntities(nullptr);
|
||||
//sObjectMgr.LoadActiveEntities(NULL);
|
||||
//sLog.outString();
|
||||
|
||||
// Delete all characters which have been deleted X days before
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue