mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
NULL to nullptr
This commit is contained in:
+53
-53
@@ -188,8 +188,8 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
account_id = 0;
|
||||
admin = 0;
|
||||
lsaccountid = 0;
|
||||
shield_target = NULL;
|
||||
SQL_log = NULL;
|
||||
shield_target = nullptr;
|
||||
SQL_log = nullptr;
|
||||
guild_id = GUILD_NONE;
|
||||
guildrank = 0;
|
||||
GuildBanker = false;
|
||||
@@ -238,7 +238,7 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
pLastUpdateWZ = 0;
|
||||
m_pp.autosplit = false;
|
||||
// initialise haste variable
|
||||
m_tradeskill_object = NULL;
|
||||
m_tradeskill_object = nullptr;
|
||||
delaytimer = false;
|
||||
PendingRezzXP = -1;
|
||||
PendingRezzDBID = 0;
|
||||
@@ -250,10 +250,10 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
tgb = false;
|
||||
tribute_master_id = 0xFFFFFFFF;
|
||||
tribute_timer.Disable();
|
||||
taskstate = NULL;
|
||||
taskstate = nullptr;
|
||||
TotalSecondsPlayed = 0;
|
||||
keyring.clear();
|
||||
bind_sight_target = NULL;
|
||||
bind_sight_target = nullptr;
|
||||
mercid = 0;
|
||||
mercSlot = 0;
|
||||
InitializeMercInfo();
|
||||
@@ -295,9 +295,9 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
aa_los_them.x = 0;
|
||||
aa_los_them.y = 0;
|
||||
aa_los_them.z = 0;
|
||||
aa_los_them_mob = NULL;
|
||||
aa_los_them_mob = nullptr;
|
||||
los_status = false;
|
||||
qGlobals = NULL;
|
||||
qGlobals = nullptr;
|
||||
HideCorpseMode = HideCorpseNone;
|
||||
PendingGuildInvitation = false;
|
||||
|
||||
@@ -305,14 +305,14 @@ Client::Client(EQStreamInterface* ieqs)
|
||||
|
||||
InitializeBuffSlots();
|
||||
|
||||
adventure_request_timer = NULL;
|
||||
adventure_create_timer = NULL;
|
||||
adventure_leave_timer = NULL;
|
||||
adventure_door_timer = NULL;
|
||||
adv_requested_data = NULL;
|
||||
adventure_stats_timer = NULL;
|
||||
adventure_leaderboard_timer = NULL;
|
||||
adv_data = NULL;
|
||||
adventure_request_timer = nullptr;
|
||||
adventure_create_timer = nullptr;
|
||||
adventure_leave_timer = nullptr;
|
||||
adventure_door_timer = nullptr;
|
||||
adv_requested_data = nullptr;
|
||||
adventure_stats_timer = nullptr;
|
||||
adventure_leaderboard_timer = nullptr;
|
||||
adv_data = nullptr;
|
||||
adv_requested_theme = 0;
|
||||
adv_requested_id = 0;
|
||||
adv_requested_member_count = 0;
|
||||
@@ -332,7 +332,7 @@ Client::~Client() {
|
||||
Bot::ProcessBotOwnerRefDelete(this);
|
||||
#endif
|
||||
if(IsInAGuild())
|
||||
guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), 0, time(NULL));
|
||||
guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), 0, time(nullptr));
|
||||
|
||||
Mob* horse = entity_list.GetMob(this->CastToClient()->GetHorseId());
|
||||
if (horse)
|
||||
@@ -353,9 +353,9 @@ Client::~Client() {
|
||||
ReportConnectingState();
|
||||
}
|
||||
|
||||
if(m_tradeskill_object != NULL) {
|
||||
if(m_tradeskill_object != nullptr) {
|
||||
m_tradeskill_object->Close();
|
||||
m_tradeskill_object = NULL;
|
||||
m_tradeskill_object = nullptr;
|
||||
}
|
||||
|
||||
#ifdef CLIENT_LOGS
|
||||
@@ -366,10 +366,10 @@ Client::~Client() {
|
||||
// if(AbilityTimer || GetLevel()>=51)
|
||||
// database.UpdateAndDeleteAATimers(CharacterID());
|
||||
|
||||
ChangeSQLLog(NULL);
|
||||
ChangeSQLLog(nullptr);
|
||||
if(IsDueling() && GetDuelTarget() != 0) {
|
||||
Entity* entity = entity_list.GetID(GetDuelTarget());
|
||||
if(entity != NULL && entity->IsClient()) {
|
||||
if(entity != nullptr && entity->IsClient()) {
|
||||
entity->CastToClient()->SetDueling(false);
|
||||
entity->CastToClient()->SetDuelTarget(0);
|
||||
entity_list.DuelMessage(entity->CastToClient(),this,true);
|
||||
@@ -383,7 +383,7 @@ Client::~Client() {
|
||||
shield_target->shielder[y].shielder_bonus = 0;
|
||||
}
|
||||
}
|
||||
shield_target = NULL;
|
||||
shield_target = nullptr;
|
||||
}
|
||||
|
||||
if(GetTarget())
|
||||
@@ -556,7 +556,7 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
|
||||
database.SaveBuffs(this);
|
||||
|
||||
TotalSecondsPlayed += (time(NULL) - m_pp.lastlogin);
|
||||
TotalSecondsPlayed += (time(nullptr) - m_pp.lastlogin);
|
||||
m_pp.timePlayedMin = (TotalSecondsPlayed / 60);
|
||||
m_pp.RestTimer = rest_timer.GetRemainingTime() / 1000;
|
||||
|
||||
@@ -573,7 +573,7 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
memset(&m_mercinfo, 0, sizeof(struct MercInfo));
|
||||
}
|
||||
|
||||
m_pp.lastlogin = time(NULL);
|
||||
m_pp.lastlogin = time(nullptr);
|
||||
if (pQueuedSaveWorkID) {
|
||||
dbasync->CancelWork(pQueuedSaveWorkID);
|
||||
pQueuedSaveWorkID = 0;
|
||||
@@ -644,7 +644,7 @@ void Client::SaveBackup() {
|
||||
|
||||
CLIENTPACKET::CLIENTPACKET()
|
||||
{
|
||||
app = NULL;
|
||||
app = nullptr;
|
||||
ack_req = false;
|
||||
}
|
||||
|
||||
@@ -768,7 +768,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
LogFile->write(EQEMuLog::Debug,"Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message);
|
||||
#endif
|
||||
|
||||
if (targetname == NULL) {
|
||||
if (targetname == nullptr) {
|
||||
targetname = (!GetTarget()) ? "" : GetTarget()->GetName();
|
||||
}
|
||||
|
||||
@@ -867,7 +867,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
}
|
||||
|
||||
Group* group = GetGroup();
|
||||
if(group != NULL) {
|
||||
if(group != nullptr) {
|
||||
group->GroupMessage(this,language,lang_skill,(const char*) message);
|
||||
}
|
||||
break;
|
||||
@@ -1883,8 +1883,8 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
||||
|
||||
// pp also hold this info; should we pull from there or inventory?
|
||||
// (update: i think pp should do it, as this holds LoY dye - plus, this is ugly code with Inventory!)
|
||||
const Item_Struct* item = NULL;
|
||||
const ItemInst* inst = NULL;
|
||||
const Item_Struct* item = nullptr;
|
||||
const ItemInst* inst = nullptr;
|
||||
if ((inst = m_inv[SLOT_HANDS]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
ns->spawn.equipment[MATERIAL_HANDS] = item->Material;
|
||||
@@ -2707,7 +2707,7 @@ bool Client::BindWound(Mob* bindmob, bool start, bool fail){
|
||||
bind_out->type = 1; // Done
|
||||
QueuePacket(outapp);
|
||||
bind_out->type = 0;
|
||||
CheckIncreaseSkill(BIND_WOUND, NULL, 5);
|
||||
CheckIncreaseSkill(BIND_WOUND, nullptr, 5);
|
||||
|
||||
int maxHPBonus = spellbonuses.MaxBindWound + itembonuses.MaxBindWound + aabonuses.MaxBindWound;
|
||||
|
||||
@@ -3512,12 +3512,12 @@ void Client::Insight(uint32 t_id)
|
||||
}
|
||||
|
||||
void Client::ChangeSQLLog(const char *file) {
|
||||
if(SQL_log != NULL) {
|
||||
if(SQL_log != nullptr) {
|
||||
fclose(SQL_log);
|
||||
SQL_log = NULL;
|
||||
SQL_log = nullptr;
|
||||
}
|
||||
if(file != NULL) {
|
||||
if(strstr(file, "..") != NULL) {
|
||||
if(file != nullptr) {
|
||||
if(strstr(file, "..") != nullptr) {
|
||||
Message(13, ".. is forbibben in SQL log file names.");
|
||||
return;
|
||||
}
|
||||
@@ -3525,14 +3525,14 @@ void Client::ChangeSQLLog(const char *file) {
|
||||
snprintf(buf, 511, "%s%s", SQL_LOG_PATH, file);
|
||||
buf[511] = '\0';
|
||||
SQL_log = fopen(buf, "a");
|
||||
if(SQL_log == NULL) {
|
||||
if(SQL_log == nullptr) {
|
||||
Message(13, "Unable to open SQL log file: %s\n", strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Client::LogSQL(const char *fmt, ...) {
|
||||
if(SQL_log == NULL)
|
||||
if(SQL_log == nullptr)
|
||||
return;
|
||||
|
||||
va_list argptr;
|
||||
@@ -3575,11 +3575,11 @@ void Client::SendRules(Client* client)
|
||||
database.GetVariable("Rules", rules, 4096);
|
||||
|
||||
ptr = strtok(rules, "\n");
|
||||
while(ptr != NULL)
|
||||
while(ptr != nullptr)
|
||||
{
|
||||
|
||||
client->Message(0,"%s",ptr);
|
||||
ptr = strtok(NULL, "\n");
|
||||
ptr = strtok(nullptr, "\n");
|
||||
}
|
||||
safe_delete_array(rules);
|
||||
}
|
||||
@@ -3711,7 +3711,7 @@ void Client::SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID) {
|
||||
|
||||
PendingTranslocateData = *ts;
|
||||
PendingTranslocate=true;
|
||||
TranslocateTime = time(NULL);
|
||||
TranslocateTime = time(nullptr);
|
||||
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
@@ -3909,7 +3909,7 @@ void Client::KeyRingList()
|
||||
iter != keyring.end();
|
||||
++iter)
|
||||
{
|
||||
if ((item = database.GetItem(*iter))!=NULL) {
|
||||
if ((item = database.GetItem(*iter))!=nullptr) {
|
||||
Message(4,item->Name);
|
||||
}
|
||||
}
|
||||
@@ -3997,7 +3997,7 @@ void Client::UpdateLFP() {
|
||||
|
||||
uint16 Client::GetPrimarySkillValue()
|
||||
{
|
||||
SkillType skill = HIGHEST_SKILL; //because NULL == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
SkillType skill = HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
bool equiped = m_inv.GetItem(13);
|
||||
|
||||
if (!equiped)
|
||||
@@ -4702,7 +4702,7 @@ void Client::SetStartZone(uint32 zoneid, float x, float y, float z)
|
||||
|
||||
// check to make sure the zone is valid
|
||||
const char *target_zone_name = database.GetZoneName(zoneid);
|
||||
if(target_zone_name == NULL)
|
||||
if(target_zone_name == nullptr)
|
||||
return;
|
||||
|
||||
m_pp.binds[4].zoneId = zoneid;
|
||||
@@ -5543,8 +5543,8 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
insr->TargetID = requester->GetID();
|
||||
insr->playerid = requestee->GetID();
|
||||
|
||||
const Item_Struct* item = NULL;
|
||||
const ItemInst* inst = NULL;
|
||||
const Item_Struct* item = nullptr;
|
||||
const ItemInst* inst = nullptr;
|
||||
|
||||
for(int16 L = 0; L <= 20; L++) {
|
||||
inst = requestee->GetInv().GetItem(L);
|
||||
@@ -5978,9 +5978,9 @@ void Client::SendTargetCommand(uint32 EntityID)
|
||||
|
||||
void Client::LocateCorpse()
|
||||
{
|
||||
Corpse *ClosestCorpse = NULL;
|
||||
Corpse *ClosestCorpse = nullptr;
|
||||
if(!GetTarget())
|
||||
ClosestCorpse = entity_list.GetClosestCorpse(this, NULL);
|
||||
ClosestCorpse = entity_list.GetClosestCorpse(this, nullptr);
|
||||
else if(GetTarget()->IsCorpse())
|
||||
ClosestCorpse = entity_list.GetClosestCorpse(this, GetTarget()->CastToCorpse()->GetOwnerName());
|
||||
else
|
||||
@@ -6080,10 +6080,10 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
pet.duration = pet_duration;
|
||||
pet.npc_id = record.npc_type;
|
||||
|
||||
NPCType *made_npc = NULL;
|
||||
NPCType *made_npc = nullptr;
|
||||
|
||||
const NPCType *npc_type = database.GetNPCType(pet.npc_id);
|
||||
if(npc_type == NULL) {
|
||||
if(npc_type == nullptr) {
|
||||
LogFile->write(EQEMuLog::Error, "Unknown npc type for doppelganger spell id: %d", spell_id);
|
||||
Message(0,"Unable to find pet!");
|
||||
return;
|
||||
@@ -6141,14 +6141,14 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
TempPets(true);
|
||||
|
||||
while(summon_count > 0) {
|
||||
NPCType *npc_dup = NULL;
|
||||
if(made_npc != NULL) {
|
||||
NPCType *npc_dup = nullptr;
|
||||
if(made_npc != nullptr) {
|
||||
npc_dup = new NPCType;
|
||||
memcpy(npc_dup, made_npc, sizeof(NPCType));
|
||||
}
|
||||
|
||||
NPC* npca = new NPC(
|
||||
(npc_dup!=NULL)?npc_dup:npc_type, //make sure we give the NPC the correct data pointer
|
||||
(npc_dup!=nullptr)?npc_dup:npc_type, //make sure we give the NPC the correct data pointer
|
||||
0,
|
||||
GetX()+swarm_pet_x[summon_count], GetY()+swarm_pet_y[summon_count],
|
||||
GetZ(), GetHeading(), FlyMode3);
|
||||
@@ -6170,7 +6170,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
npca->GetSwarmInfo()->target = target->GetID();
|
||||
|
||||
//we allocated a new NPC type object, give the NPC ownership of that memory
|
||||
if(npc_dup != NULL)
|
||||
if(npc_dup != nullptr)
|
||||
npca->GiveNPCTypeData(npc_dup);
|
||||
|
||||
entity_list.AddNPC(npca);
|
||||
@@ -6887,7 +6887,7 @@ void Client::RemoveXTarget(Mob *m, bool OnlyAutoSlots)
|
||||
|
||||
XTargets[i].ID = 0;
|
||||
|
||||
SendXTargetPacket(i, NULL);
|
||||
SendXTargetPacket(i, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6985,7 +6985,7 @@ void Client::RemoveGroupXTargets()
|
||||
{
|
||||
XTargets[i].ID = 0;
|
||||
XTargets[i].Name[0] = 0;
|
||||
SendXTargetPacket(i, NULL);
|
||||
SendXTargetPacket(i, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user