From 7560b6b0a72c19c9e86b1b0bb5e4128413f813b2 Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Sat, 4 May 2013 18:06:58 -0700 Subject: [PATCH 1/3] NULL to nullptr --- common/BasePacket.cpp | 4 +- common/BasePacket.h | 2 +- common/Condition.cpp | 14 +- common/EQDB.cpp | 4 +- common/EQDBRes.cpp | 6 +- common/EQDBRes.h | 2 +- common/EQEmuConfig.cpp | 12 +- common/EQEmuConfig.h | 4 +- common/EQPacket.cpp | 4 +- common/EQPacket.h | 8 +- common/EQStream.cpp | 72 +- common/EQStreamFactory.cpp | 18 +- common/EQStreamIdent.cpp | 4 +- common/EQStreamLocator.h | 4 +- common/EQStreamProxy.cpp | 10 +- common/EmuTCPConnection.cpp | 4 +- common/EmuTCPServer.cpp | 6 +- common/Item.cpp | 58 +- common/Item.h | 10 +- common/MiscFunctions.cpp | 14 +- common/MiscFunctions.h | 6 +- common/ProcLauncher.cpp | 26 +- common/SocketLib/File.cpp | 4 +- common/SocketLib/HttpdCookies.cpp | 10 +- common/SocketLib/HttpdForm.cpp | 18 +- common/SocketLib/HttpdSocket.cpp | 14 +- common/SocketLib/MemFile.cpp | 4 +- common/SocketLib/MemFile.h | 2 +- common/SocketLib/Mime.cpp | 2 +- common/StackWalker/StackWalker.cpp | 168 ++-- common/StackWalker/StackWalker.h | 12 +- common/StructStrategy.cpp | 4 +- common/TCPConnection.cpp | 22 +- common/TCPServer.cpp | 6 +- common/TCPServer.h | 2 +- common/XMLParser.cpp | 16 +- common/database.cpp | 122 +-- common/database.h | 10 +- common/dbasync.cpp | 4 +- common/debug.cpp | 6 +- common/eqtime.h | 2 +- common/extprofile.cpp | 2 +- common/guild_base.cpp | 34 +- common/ipc_mutex.cpp | 2 +- common/logsys.cpp | 4 +- common/memory_mapped_file.cpp | 16 +- common/misc.cpp | 14 +- common/opcodemgr.cpp | 8 +- common/packet_functions.cpp | 8 +- common/patches/Client62.cpp | 26 +- common/patches/RoF.cpp | 54 +- common/patches/SSDefine.h | 10 +- common/patches/SoD.cpp | 38 +- common/patches/SoF.cpp | 34 +- common/patches/Titanium.cpp | 34 +- common/patches/Underfoot.cpp | 48 +- common/perl_EQDB.cpp | 28 +- common/perl_EQDBRes.cpp | 30 +- common/ptimer.cpp | 50 +- common/rdtsc.cpp | 2 +- common/rulesys.cpp | 24 +- common/rulesys.h | 6 +- common/shareddb.cpp | 46 +- common/timeoutmgr.cpp | 2 +- common/tinyxml/tinystr.cpp | 4 +- common/tinyxml/tinystr.h | 4 +- common/tinyxml/tinyxml.h | 8 +- eqlaunch/eqlaunch.cpp | 2 +- loginserver/Client.cpp | 2 +- loginserver/ClientManager.cpp | 2 +- loginserver/Config.cpp | 2 +- loginserver/DatabaseMySQL.cpp | 12 +- loginserver/DatabaseMySQL.h | 4 +- loginserver/DatabasePostgreSQL.cpp | 6 +- loginserver/DatabasePostgreSQL.h | 4 +- loginserver/Encryption.h | 6 +- loginserver/LoginServer.h | 4 +- loginserver/Main.cpp | 2 +- loginserver/ServerManager.cpp | 4 +- loginserver/ServerManager.h | 4 +- loginserver/WorldServer.cpp | 4 +- queryserv/database.h | 2 +- queryserv/lfguild.cpp | 8 +- queryserv/queryservconfig.cpp | 2 +- queryserv/queryservconfig.h | 4 +- tests/memory_mapped_file_test.h | 4 +- ucs/chatchannel.cpp | 18 +- ucs/clientlist.cpp | 32 +- ucs/database.cpp | 8 +- ucs/database.h | 2 +- ucs/ucsconfig.cpp | 2 +- ucs/ucsconfig.h | 4 +- utils/azone2/3d_base.hpp | 2 +- utils/azone2/awater.cpp | 8 +- utils/azone2/azone.cpp | 100 +-- utils/azone2/dat.cpp | 4 +- utils/azone2/global.hpp | 4 +- utils/azone2/listobj.cpp | 12 +- utils/azone2/pfs.cpp | 6 +- utils/azone2/ter.cpp | 8 +- utils/azone2/wld.cpp | 16 +- utils/azone2/zon.cpp | 18 +- utils/azone2/zonv4.cpp | 8 +- world/AdventureManager.cpp | 20 +- world/EQLConfig.cpp | 22 +- world/EQW.cpp | 18 +- world/EQWHTTPHandler.cpp | 12 +- world/EQWParser.cpp | 14 +- world/LauncherLink.cpp | 2 +- world/LauncherList.cpp | 8 +- world/WorldConfig.cpp | 2 +- world/WorldConfig.h | 4 +- world/client.cpp | 20 +- world/clientlist.cpp | 10 +- world/console.cpp | 4 +- world/lfplist.cpp | 6 +- world/net.cpp | 6 +- world/perl_EQLConfig.cpp | 58 +- world/perl_EQW.cpp | 122 +-- world/perl_HTTPRequest.cpp | 34 +- world/worlddb.cpp | 2 +- world/zonelist.cpp | 2 +- world/zoneserver.cpp | 8 +- zone/AA.cpp | 96 +- zone/Map.cpp | 32 +- zone/MobAI.cpp | 26 +- zone/Object.cpp | 68 +- zone/PlayerCorpse.cpp | 8 +- zone/QuestParserCollection.cpp | 30 +- zone/ZoneConfig.cpp | 2 +- zone/ZoneConfig.h | 4 +- zone/aggro.cpp | 28 +- zone/attack.cpp | 84 +- zone/basic_functions.h | 2 +- zone/beacon.cpp | 2 +- zone/bonuses.cpp | 2 +- zone/bot.cpp | 136 +-- zone/bot.h | 4 +- zone/client.cpp | 106 +-- zone/client.h | 20 +- zone/client_logs.cpp | 8 +- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 228 ++--- zone/client_process.cpp | 20 +- zone/command.cpp | 244 ++--- zone/doors.cpp | 12 +- zone/effects.cpp | 2 +- zone/embparser.cpp | 64 +- zone/embperl.cpp | 4 +- zone/embperl.h | 4 +- zone/embxs.cpp | 4 +- zone/entity.cpp | 68 +- zone/entity.h | 4 +- zone/exp.cpp | 12 +- zone/fearpath.cpp | 28 +- zone/forage.cpp | 52 +- zone/groups.cpp | 80 +- zone/groups.h | 4 +- zone/guild.cpp | 6 +- zone/guild_mgr.cpp | 92 +- zone/hate_list.cpp | 42 +- zone/hate_list.h | 4 +- zone/horse.cpp | 12 +- zone/inventory.cpp | 40 +- zone/loottables.cpp | 14 +- zone/map.h | 10 +- zone/merc.cpp | 46 +- zone/mob.cpp | 54 +- zone/mob.h | 44 +- zone/net.cpp | 6 +- zone/npc.cpp | 36 +- zone/npc.h | 4 +- zone/object.h | 2 +- zone/parser.cpp | 6 +- zone/pathing.cpp | 58 +- zone/perl_PlayerCorpse.cpp | 128 +-- zone/perl_client.cpp | 854 +++++++++--------- zone/perl_doors.cpp | 110 +-- zone/perl_entity.cpp | 348 ++++---- zone/perl_groups.cpp | 118 +-- zone/perl_hateentry.cpp | 14 +- zone/perl_mob.cpp | 1318 ++++++++++++++-------------- zone/perl_npc.cpp | 328 +++---- zone/perl_object.cpp | 138 +-- zone/perl_perlpacket.cpp | 78 +- zone/perl_questitem.cpp | 32 +- zone/perl_raids.cpp | 98 +-- zone/perlpacket.cpp | 38 +- zone/perlparser.cpp | 6 +- zone/pets.cpp | 22 +- zone/questmgr.cpp | 62 +- zone/questmgr.h | 8 +- zone/raids.cpp | 20 +- zone/raids.h | 2 +- zone/spawn2.cpp | 58 +- zone/spawn2.h | 2 +- zone/spawngroup.cpp | 2 +- zone/special_attacks.cpp | 48 +- zone/spell_effects.cpp | 36 +- zone/spells.cpp | 88 +- zone/tasks.cpp | 80 +- zone/titles.cpp | 6 +- zone/tradeskills.cpp | 34 +- zone/trading.cpp | 36 +- zone/trap.cpp | 34 +- zone/tribute.cpp | 6 +- zone/updatemgr.h | 2 +- zone/watermap.cpp | 20 +- zone/watermap.h | 2 +- zone/waypoints.cpp | 16 +- zone/worldserver.cpp | 22 +- zone/zone.cpp | 66 +- zone/zone.h | 4 +- zone/zonedb.cpp | 74 +- zone/zonedbasync.cpp | 2 +- zone/zoning.cpp | 16 +- 216 files changed, 4151 insertions(+), 4151 deletions(-) diff --git a/common/BasePacket.cpp b/common/BasePacket.cpp index 82fd13649..28d88659a 100644 --- a/common/BasePacket.cpp +++ b/common/BasePacket.cpp @@ -24,7 +24,7 @@ BasePacket::BasePacket(const unsigned char *buf, uint32 len) { - this->pBuffer=NULL; + this->pBuffer=nullptr; this->size=0; this->_wpos = 0; this->_rpos = 0; @@ -44,7 +44,7 @@ BasePacket::~BasePacket() { if (pBuffer) delete[] pBuffer; - pBuffer=NULL; + pBuffer=nullptr; } diff --git a/common/BasePacket.h b/common/BasePacket.h index 612689600..56a36c2ef 100644 --- a/common/BasePacket.h +++ b/common/BasePacket.h @@ -79,7 +79,7 @@ public: protected: virtual ~BasePacket(); - BasePacket() { pBuffer=NULL; size=0; _wpos = 0; _rpos = 0; } + BasePacket() { pBuffer=nullptr; size=0; _wpos = 0; _rpos = 0; } BasePacket(const unsigned char *buf, const uint32 len); }; diff --git a/common/Condition.cpp b/common/Condition.cpp index 48fb83ce5..27a2015fa 100644 --- a/common/Condition.cpp +++ b/common/Condition.cpp @@ -31,14 +31,14 @@ Condition::Condition() { - m_events[SignalEvent] = CreateEvent (NULL, // security + m_events[SignalEvent] = CreateEvent (nullptr, // security FALSE, // is auto-reset event? FALSE, // is signaled initially? - NULL); // name - m_events[BroadcastEvent] = CreateEvent (NULL, // security + nullptr); // name + m_events[BroadcastEvent] = CreateEvent (nullptr, // security TRUE, // is auto-reset event? FALSE, // is signaled initially? - NULL); // name + nullptr); // name m_waiters = 0; InitializeCriticalSection(&CSMutex); } @@ -92,8 +92,8 @@ void Condition::Wait() Condition::Condition() { - pthread_cond_init(&cond,NULL); - pthread_mutex_init(&mutex,NULL); + pthread_cond_init(&cond,nullptr); + pthread_mutex_init(&mutex,nullptr); } void Condition::Signal() @@ -129,7 +129,7 @@ struct timeval now; struct timespec timeout; int retcode=0; pthread_mutex_lock(&mutex); - gettimeofday(&now,NULL); + gettimeofday(&now,nullptr); now.tv_usec+=usec; timeout.tv_sec = now.tv_sec + (now.tv_usec/1000000); timeout.tv_nsec = (now.tv_usec%1000000) *1000; diff --git a/common/EQDB.cpp b/common/EQDB.cpp index c12d04b2e..b1f0166cd 100644 --- a/common/EQDB.cpp +++ b/common/EQDB.cpp @@ -53,11 +53,11 @@ EQDBRes * EQDB::query(Const_char *q) { return new EQDBRes(r); } else { //no result, give them back a 'true but empty' result set - return(new EQDBRes(NULL)); + return(new EQDBRes(nullptr)); } } - return NULL; + return nullptr; } //NOT THREAD SAFE! diff --git a/common/EQDBRes.cpp b/common/EQDBRes.cpp index 0a41f7467..d33b46bf2 100644 --- a/common/EQDBRes.cpp +++ b/common/EQDBRes.cpp @@ -21,7 +21,7 @@ vector EQDBRes::fetch_row_array() { vector array; - if(res == NULL) + if(res == nullptr) return(array); int count=mysql_num_fields(res); @@ -34,14 +34,14 @@ vector EQDBRes::fetch_row_array() { map EQDBRes::fetch_row_hash() { map rowhash; - if(res == NULL) + if(res == nullptr) return(rowhash); MYSQL_FIELD *fields; MYSQL_ROW row; unsigned long num_fields,i; - if (res && (num_fields=mysql_num_fields(res)) && (row = mysql_fetch_row(res))!=NULL && (fields = mysql_fetch_fields(res))!=NULL) { + if (res && (num_fields=mysql_num_fields(res)) && (row = mysql_fetch_row(res))!=nullptr && (fields = mysql_fetch_fields(res))!=nullptr) { for(i=0;i fetch_row_array(); map fetch_row_hash(); unsigned long * fetch_lengths() { return (res) ? mysql_fetch_lengths(res) : 0; } diff --git a/common/EQEmuConfig.cpp b/common/EQEmuConfig.cpp index 2bb8aca28..30d31606c 100644 --- a/common/EQEmuConfig.cpp +++ b/common/EQEmuConfig.cpp @@ -22,7 +22,7 @@ #include string EQEmuConfig::ConfigFile = "eqemu_config.xml"; -EQEmuConfig *EQEmuConfig::_config = NULL; +EQEmuConfig *EQEmuConfig::_config = nullptr; void EQEmuConfig::do_world(TiXmlElement *ele) { const char *text; @@ -100,12 +100,12 @@ void EQEmuConfig::do_world(TiXmlElement *ele) { // Check for locked sub_ele = ele->FirstChildElement("locked"); - if (sub_ele != NULL) + if (sub_ele != nullptr) Locked=true; // Get the element sub_ele = ele->FirstChildElement("tcp"); - if(sub_ele != NULL) { + if(sub_ele != nullptr) { text = sub_ele->Attribute("ip"); if (text) @@ -123,7 +123,7 @@ void EQEmuConfig::do_world(TiXmlElement *ele) { // Get the element sub_ele = ele->FirstChildElement("http"); - if(sub_ele != NULL) { + if(sub_ele != nullptr) { // text = sub_ele->Attribute("ip"); // if (text) @@ -228,7 +228,7 @@ void EQEmuConfig::do_zones(TiXmlElement *ele) { // Get the element sub_ele = ele->FirstChildElement("ports"); - if(sub_ele != NULL) { + if(sub_ele != nullptr) { text = sub_ele->Attribute("low"); if (text) @@ -296,7 +296,7 @@ void EQEmuConfig::do_launcher(TiXmlElement *ele) { // Get the element sub_ele = ele->FirstChildElement("timers"); - if(sub_ele != NULL) { + if(sub_ele != nullptr) { text = sub_ele->Attribute("restart"); if (text) RestartWait = atoi(text); diff --git a/common/EQEmuConfig.h b/common/EQEmuConfig.h index 41856fa92..36b0056df 100644 --- a/common/EQEmuConfig.h +++ b/common/EQEmuConfig.h @@ -204,7 +204,7 @@ public: // Produce a const singleton static const EQEmuConfig *get() { - if (_config == NULL) + if (_config == nullptr) LoadConfig(); return(_config); } @@ -214,7 +214,7 @@ public: // Load the config static bool LoadConfig() { - if (_config != NULL) + if (_config != nullptr) delete _config; _config=new EQEmuConfig; diff --git a/common/EQPacket.cpp b/common/EQPacket.cpp index 20f80b3af..9df2912fd 100644 --- a/common/EQPacket.cpp +++ b/common/EQPacket.cpp @@ -248,7 +248,7 @@ uint32 offset; memcpy(pBuffer,buf+offset,len-offset); size=len-offset; } else { - pBuffer=NULL; + pBuffer=nullptr; size=0; } OpMgr=&RawOpcodeManager; @@ -294,7 +294,7 @@ get running again... but might be a good thing some day. bool EQApplicationPacket::combine(const EQApplicationPacket *rhs) { uint32 newsize=0, offset=0; -unsigned char *tmpbuffer=NULL; +unsigned char *tmpbuffer=nullptr; if (opcode!=OP_AppCombined) { newsize=app_opcode_size+size+(size>254?3:1)+app_opcode_size+rhs->size+(rhs->size>254?3:1); diff --git a/common/EQPacket.h b/common/EQPacket.h index 675a35d1f..f8d4f11fb 100644 --- a/common/EQPacket.h +++ b/common/EQPacket.h @@ -58,7 +58,7 @@ protected: EQPacket(EmuOpcode opcode, const unsigned char *buf, const uint32 len); // EQPacket(const EQPacket &p) { } - EQPacket() { emu_opcode=OP_Unknown; pBuffer=NULL; size=0; } + EQPacket() { emu_opcode=OP_Unknown; pBuffer=nullptr; size=0; } }; @@ -102,11 +102,11 @@ class EQApplicationPacket : public EQPacket { // friend class EQProtocolPacket; friend class EQStream; public: - EQApplicationPacket() : EQPacket(OP_Unknown,NULL,0) + EQApplicationPacket() : EQPacket(OP_Unknown,nullptr,0) { app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; } - EQApplicationPacket(const EmuOpcode op) : EQPacket(op,NULL,0) + EQApplicationPacket(const EmuOpcode op) : EQPacket(op,nullptr,0) { app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; } - EQApplicationPacket(const EmuOpcode op, const uint32 len) : EQPacket(op,NULL,len) + EQApplicationPacket(const EmuOpcode op, const uint32 len) : EQPacket(op,nullptr,len) { app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; } EQApplicationPacket(const EmuOpcode op, const unsigned char *buf, const uint32 len) : EQPacket(op,buf,len) { app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; } diff --git a/common/EQStream.cpp b/common/EQStream.cpp index ae5c6953c..c9397f43e 100644 --- a/common/EQStream.cpp +++ b/common/EQStream.cpp @@ -65,7 +65,7 @@ void EQStream::init() { LastAckSent=-1; MaxSends=5; LastPacket=0; - oversize_buffer=NULL; + oversize_buffer=nullptr; oversize_length=0; oversize_offset=0; RateThreshold=RATEBASE/250; @@ -77,7 +77,7 @@ void EQStream::init() { retransmittimer = Timer::GetCurrentTime(); retransmittimeout = 500 * RuleR(EQStream, RetransmitTimeoutMult); //use 500ms as base before we have connection stats #endif - OpMgr = NULL; + OpMgr = nullptr; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { _log(NET__ERROR, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } @@ -88,7 +88,7 @@ if(NextSequencedSend > SequencedQueue.size()) { EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) { - EQRawApplicationPacket *ap=NULL; + EQRawApplicationPacket *ap=nullptr; _log(NET__APP_CREATE, _L "Creating new application packet, length %d" __L, p->size); _raw(NET__APP_CREATE_HEX, 0xFFFF, p); ap = p->MakeAppPacket(); @@ -97,7 +97,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len) { - EQRawApplicationPacket *ap=NULL; + EQRawApplicationPacket *ap=nullptr; _log(NET__APP_CREATE, _L "Creating new application packet, length %d" __L, len); _hex(NET__APP_CREATE_HEX, buf, len); ap = new EQRawApplicationPacket(buf, len); @@ -117,7 +117,7 @@ EQProtocolPacket *EQStream::MakeProtocolPacket(const unsigned char *buf, uint32 void EQStream::ProcessPacket(EQProtocolPacket *p) { uint32 processed=0,subpacket_length=0; - if (p == NULL) + if (p == nullptr) return; // Raw Application packet if (p->opcode > 0xff) { @@ -153,7 +153,7 @@ uint32 processed=0,subpacket_length=0; case OP_AppCombined: { processed=0; while(processedsize) { - EQRawApplicationPacket *ap=NULL; + EQRawApplicationPacket *ap=nullptr; if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) { _log(NET__NET_CREATE, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length); @@ -273,7 +273,7 @@ uint32 processed=0,subpacket_length=0; } } delete[] oversize_buffer; - oversize_buffer=NULL; + oversize_buffer=nullptr; oversize_offset=0; } } else { @@ -500,24 +500,24 @@ if(NextSequencedSend > SequencedQueue.size()) { void EQStream::QueuePacket(const EQApplicationPacket *p, bool ack_req) { - if(p == NULL) + if(p == nullptr) return; EQApplicationPacket *newp = p->Copy(); - if (newp != NULL) + if (newp != nullptr) FastQueuePacket(&newp, ack_req); } void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req) { EQApplicationPacket *pack=*p; - *p = NULL; //clear caller's pointer.. effectively takes ownership + *p = nullptr; //clear caller's pointer.. effectively takes ownership - if(pack == NULL) + if(pack == nullptr) return; - if(OpMgr == NULL || *OpMgr == NULL) { + if(OpMgr == nullptr || *OpMgr == nullptr) { _log(NET__DEBUG, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); delete pack; return; @@ -557,7 +557,7 @@ uint32 length; unsigned char *tmpbuff=new unsigned char[p->size+3]; length=p->serialize(opcode, tmpbuff); - EQProtocolPacket *out=new EQProtocolPacket(OP_Fragment,NULL,MaxLen-4); + EQProtocolPacket *out=new EQProtocolPacket(OP_Fragment,nullptr,MaxLen-4); *(uint32 *)(out->pBuffer+2)=htonl(p->Size()); used=MaxLen-10; memcpy(out->pBuffer+6,tmpbuff,used); @@ -566,7 +566,7 @@ uint32 length; while (usedpBuffer+2,tmpbuff+used,chunksize); out->size=chunksize+2; @@ -669,7 +669,7 @@ deque::iterator sitr; MOutboundQueue.lock(); // Place to hold the base packet t combine into - EQProtocolPacket *p=NULL; + EQProtocolPacket *p=nullptr; #ifdef RETRANSMITS // if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue @@ -702,7 +702,7 @@ deque::iterator sitr; _log(NET__NET_COMBINE, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); ReadyToSend.push(p); BytesWritten+=p->size; - p=NULL; + p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair @@ -761,7 +761,7 @@ continue; _log(NET__NET_COMBINE, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; - p=NULL; + p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair @@ -864,7 +864,7 @@ EQProtocolPacket *EQStream::Read(int eq_fd, sockaddr_in *from) { int socklen; int length=0; -EQProtocolPacket *p=NULL; +EQProtocolPacket *p=nullptr; char temp[15]; socklen=sizeof(sockaddr); @@ -893,7 +893,7 @@ char temp[15]; void EQStream::SendSessionResponse() { -EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,NULL,sizeof(SessionResponse)); +EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,nullptr,sizeof(SessionResponse)); SessionResponse *Response=(SessionResponse *)out->pBuffer; Response->Session=htonl(Session); Response->MaxLength=htonl(MaxLen); @@ -915,10 +915,10 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,NULL,sizeof(Sessio void EQStream::SendSessionRequest() { -EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,NULL,sizeof(SessionRequest)); +EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(SessionRequest)); SessionRequest *Request=(SessionRequest *)out->pBuffer; memset(Request,0,sizeof(SessionRequest)); - Request->Session=htonl(time(NULL)); + Request->Session=htonl(time(nullptr)); Request->MaxLength=htonl(512); _log(NET__NET_TRACE, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); @@ -931,7 +931,7 @@ void EQStream::_SendDisconnect() if(GetState() == CLOSED) return; - EQProtocolPacket *out=new EQProtocolPacket(OP_SessionDisconnect,NULL,sizeof(uint32)); + EQProtocolPacket *out=new EQProtocolPacket(OP_SessionDisconnect,nullptr,sizeof(uint32)); *(uint32 *)out->pBuffer=htonl(Session); NonSequencedPush(out); @@ -947,7 +947,7 @@ void EQStream::InboundQueuePush(EQRawApplicationPacket *p) EQApplicationPacket *EQStream::PopPacket() { -EQRawApplicationPacket *p=NULL; +EQRawApplicationPacket *p=nullptr; MInboundQueue.lock(); if (InboundQueue.size()) { @@ -959,7 +959,7 @@ EQRawApplicationPacket *p=NULL; //resolve the opcode if we can. if(p) { - if(OpMgr != NULL && *OpMgr != NULL) { + if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); #if EQDEBUG >= 4 if(emu_op == OP_Unknown) { @@ -975,7 +975,7 @@ EQRawApplicationPacket *p=NULL; EQRawApplicationPacket *EQStream::PopRawPacket() { -EQRawApplicationPacket *p=NULL; +EQRawApplicationPacket *p=nullptr; MInboundQueue.lock(); if (InboundQueue.size()) { @@ -987,7 +987,7 @@ EQRawApplicationPacket *p=NULL; //resolve the opcode if we can. if(p) { - if(OpMgr != NULL && *OpMgr != NULL) { + if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); #if EQDEBUG >= 4 if(emu_op == OP_Unknown) { @@ -1003,7 +1003,7 @@ EQRawApplicationPacket *p=NULL; EQRawApplicationPacket *EQStream::PeekPacket() { -EQRawApplicationPacket *p=NULL; +EQRawApplicationPacket *p=nullptr; MInboundQueue.lock(); if (InboundQueue.size()) { @@ -1017,7 +1017,7 @@ EQRawApplicationPacket *p=NULL; void EQStream::InboundQueueClear() { -EQApplicationPacket *p=NULL; +EQApplicationPacket *p=nullptr; _log(NET__APP_TRACE, _L "Clearing inbound queue" __L); @@ -1060,7 +1060,7 @@ bool flag; void EQStream::OutboundQueueClear() { -EQProtocolPacket *p=NULL; +EQProtocolPacket *p=nullptr; _log(NET__APP_TRACE, _L "Clearing outbound queue" __L); @@ -1090,7 +1090,7 @@ if(NextSequencedSend > SequencedQueue.size()) { void EQStream::PacketQueueClear() { -EQProtocolPacket *p=NULL; +EQProtocolPacket *p=nullptr; _log(NET__APP_TRACE, _L "Clearing future packet queue" __L); @@ -1223,8 +1223,8 @@ void EQStream::ProcessQueue() return; } - EQProtocolPacket *qp=NULL; - while((qp=RemoveQueue(NextInSeq))!=NULL) { + EQProtocolPacket *qp=nullptr; + while((qp=RemoveQueue(NextInSeq))!=nullptr) { _log(NET__DEBUG, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); ProcessPacket(qp); delete qp; @@ -1235,7 +1235,7 @@ void EQStream::ProcessQueue() EQProtocolPacket *EQStream::RemoveQueue(uint16 seq) { map::iterator itr; -EQProtocolPacket *qp=NULL; +EQProtocolPacket *qp=nullptr; if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) { qp=itr->second; PacketQueue.erase(itr); @@ -1408,7 +1408,7 @@ void EQStream::Close() { //this could be expanded to check more than the fitst opcode if //we needed more complex matching EQStream::MatchState EQStream::CheckSignature(const Signature *sig) { - EQRawApplicationPacket *p = NULL; + EQRawApplicationPacket *p = nullptr; MatchState res = MatchNotReady; MInboundQueue.lock(); @@ -1419,10 +1419,10 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) { if(InboundQueue.size() > 1) { p = InboundQueue[1]; } else { - p = NULL; + p = nullptr; } } - if(p == NULL) { + if(p == nullptr) { //first opcode is ignored, and nothing else remains... keep waiting } else if(p->opcode == sig->first_eq_opcode) { //opcode matches, check length.. diff --git a/common/EQStreamFactory.cpp b/common/EQStreamFactory.cpp index 850b686cd..56b1f9da7 100644 --- a/common/EQStreamFactory.cpp +++ b/common/EQStreamFactory.cpp @@ -35,7 +35,7 @@ EQStreamFactory *fs=(EQStreamFactory *)eqfs; _log(COMMON__THREADS, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif - THREAD_RETURN(NULL); + THREAD_RETURN(nullptr); } ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) @@ -52,7 +52,7 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) _log(COMMON__THREADS, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif - THREAD_RETURN(NULL); + THREAD_RETURN(nullptr); } EQStreamFactory::EQStreamFactory(EQStreamType type, int port, uint32 timeout) @@ -112,15 +112,15 @@ struct sockaddr_in address; _beginthread(EQStreamFactoryReaderLoop,0, this); _beginthread(EQStreamFactoryWriterLoop,0, this); #else - pthread_create(&t1,NULL,EQStreamFactoryReaderLoop,this); - pthread_create(&t2,NULL,EQStreamFactoryWriterLoop,this); + pthread_create(&t1,nullptr,EQStreamFactoryReaderLoop,this); + pthread_create(&t2,nullptr,EQStreamFactoryWriterLoop,this); #endif return true; } EQStream *EQStreamFactory::Pop() { -EQStream *s=NULL; +EQStream *s=nullptr; //cout << "Pop():Locking MNewStreams" << endl; MNewStreams.lock(); if (NewStreams.size()) { @@ -167,7 +167,7 @@ timeval sleep_time; sleep_time.tv_sec=30; sleep_time.tv_usec=0; - if ((num=select(sock+1,&readset,NULL,NULL,&sleep_time))<0) { + if ((num=select(sock+1,&readset,nullptr,nullptr,&sleep_time))<0) { // What do we wanna do? continue; } else if (num==0) @@ -204,7 +204,7 @@ timeval sleep_time; EQStream *curstream = stream_itr->second; //dont bother processing incoming packets for closed connections if(curstream->CheckClosed()) - curstream = NULL; + curstream = nullptr; else curstream->PutInUse(); MStreams.unlock(); //the in use flag prevents the stream from being deleted while we are using it. @@ -293,8 +293,8 @@ Timer DecayTimer(20); stream_itr->second->Decay(); //bullshit checking, to see if this is really happening, GDB seems to think so... - if(stream_itr->second == NULL) { - fprintf(stderr, "ERROR: NULL Stream encountered in EQStreamFactory::WriterLoop for: %s", stream_itr->first.c_str()); + if(stream_itr->second == nullptr) { + fprintf(stderr, "ERROR: nullptr Stream encountered in EQStreamFactory::WriterLoop for: %s", stream_itr->first.c_str()); continue; } diff --git a/common/EQStreamIdent.cpp b/common/EQStreamIdent.cpp index 2ecbd3988..2cc5385e9 100644 --- a/common/EQStreamIdent.cpp +++ b/common/EQStreamIdent.cpp @@ -146,12 +146,12 @@ void EQStreamIdentifier::Process() { void EQStreamIdentifier::AddStream(EQStream *&eqs) { m_streams.push_back(new Record(eqs)); - eqs = NULL; + eqs = nullptr; } EQStreamInterface *EQStreamIdentifier::PopIdentified() { if(m_identified.empty()) - return(NULL); + return(nullptr); EQStreamInterface *res = m_identified.front(); m_identified.pop(); return(res); diff --git a/common/EQStreamLocator.h b/common/EQStreamLocator.h index acd5bf8e8..27d17aeb3 100644 --- a/common/EQStreamLocator.h +++ b/common/EQStreamLocator.h @@ -99,7 +99,7 @@ inline bool operator==(const EQStreamInfo &l, const EQStreamInfo &r) { return(l.src_ip == r.src_ip && l.src_port == r.src_port && l.dst_ip == r.dst_ip && l.dst_port == r.dst_port); } -//Forces the pointer T thing so we can return NULL +//Forces the pointer T thing so we can return nullptr template class EQStreamLocator { protected: @@ -157,7 +157,7 @@ public: //may not be a constant time operation in theory, and update our //stored copy only on insert or delete if(res == streams.end()) - return(NULL); + return(nullptr); return(res->second); } diff --git a/common/EQStreamProxy.cpp b/common/EQStreamProxy.cpp index 7480662af..1268b378d 100644 --- a/common/EQStreamProxy.cpp +++ b/common/EQStreamProxy.cpp @@ -10,7 +10,7 @@ EQStreamProxy::EQStreamProxy(EQStream *&stream, const StructStrategy *structs, O m_structs(structs), m_opcodes(opcodes) { - stream = NULL; //take the stream. + stream = nullptr; //take the stream. m_stream->SetOpcodeManager(m_opcodes); } @@ -28,7 +28,7 @@ const EQClientVersion EQStreamProxy::ClientVersion() const } void EQStreamProxy::QueuePacket(const EQApplicationPacket *p, bool ack_req) { - if(p == NULL) + if(p == nullptr) return; EQApplicationPacket *newp = p->Copy(); @@ -36,15 +36,15 @@ void EQStreamProxy::QueuePacket(const EQApplicationPacket *p, bool ack_req) { } void EQStreamProxy::FastQueuePacket(EQApplicationPacket **p, bool ack_req) { - if(p == NULL || *p == NULL) + if(p == nullptr || *p == nullptr) return; m_structs->Encode(p, m_stream, ack_req); } EQApplicationPacket *EQStreamProxy::PopPacket() { EQApplicationPacket *pack = m_stream->PopPacket(); - if(pack == NULL) - return(NULL); + if(pack == nullptr) + return(nullptr); //pass this packet through the struct strategy. m_structs->Decode(pack); diff --git a/common/EmuTCPConnection.cpp b/common/EmuTCPConnection.cpp index 8044051f4..a4108b0bb 100644 --- a/common/EmuTCPConnection.cpp +++ b/common/EmuTCPConnection.cpp @@ -76,7 +76,7 @@ EmuTCPConnection::EmuTCPConnection(uint32 ID, EmuTCPServer* iServer, SOCKET in_s timeout_timer(SERVER_TIMEOUT * 2) { id = 0; - Server = NULL; + Server = nullptr; pOldFormat = iOldFormat; #ifdef MINILOGIN TCPMode = modePacket; @@ -282,7 +282,7 @@ bool EmuTCPConnection::SendPacket(EmuTCPNetPacket_Struct* tnps) { ServerPacket* EmuTCPConnection::PopPacket() { ServerPacket* ret; if (!MOutQueueLock.trylock()) - return NULL; + return nullptr; ret = OutQueue.pop(); MOutQueueLock.unlock(); return ret; diff --git a/common/EmuTCPServer.cpp b/common/EmuTCPServer.cpp index 63cfeef1a..362e462af 100644 --- a/common/EmuTCPServer.cpp +++ b/common/EmuTCPServer.cpp @@ -42,7 +42,7 @@ void EmuTCPServer::SendPacket(EmuTCPNetPacket_Struct** tnps) { MInQueue.lock(); m_InQueue.push(*tnps); MInQueue.unlock(); - tnps = NULL; + tnps = nullptr; } void EmuTCPServer::CheckInQueue() { @@ -61,7 +61,7 @@ void EmuTCPServer::CheckInQueue() { } EmuTCPNetPacket_Struct* EmuTCPServer::InQueuePop() { - EmuTCPNetPacket_Struct* ret = NULL; + EmuTCPNetPacket_Struct* ret = nullptr; MInQueue.lock(); if(!m_InQueue.empty()) { ret = m_InQueue.front(); @@ -80,7 +80,7 @@ EmuTCPConnection *EmuTCPServer::FindConnection(uint32 iID) { if ((*cur)->GetID() == iID) return *cur; } - return(NULL); + return(nullptr); } diff --git a/common/Item.cpp b/common/Item.cpp index c5779cae0..023f341e9 100644 --- a/common/Item.cpp +++ b/common/Item.cpp @@ -162,13 +162,13 @@ ItemInst::ItemInst(const ItemInst& copy) iter_contents it; for (it=copy.m_contents.begin(); it!=copy.m_contents.end(); it++) { ItemInst* inst_old = it->second; - ItemInst* inst_new = NULL; + ItemInst* inst_new = nullptr; if (inst_old) { inst_new = inst_old->Clone(); } - if (inst_new != NULL) { + if (inst_new != nullptr) { m_contents[it->first] = inst_new; } } @@ -293,7 +293,7 @@ uint32 ItemInst::GetItemID(uint8 slot) const { const ItemInst *item; uint32 id=0; - if ((item=GetItem(slot))!=NULL) + if ((item=GetItem(slot))!=nullptr) id= item->GetItem()->ID; return id; @@ -330,7 +330,7 @@ ItemInst* ItemInst::GetAugment(uint8 slot) const if (m_item->ItemClass == ItemClassCommon) return GetItem(slot); - return NULL; + return nullptr; } // Remove augment from item and destroy it @@ -346,7 +346,7 @@ ItemInst* ItemInst::RemoveAugment(uint8 index) if (m_item->ItemClass == ItemClassCommon) return PopItem(index); - return NULL; + return nullptr; } // Add an augment to the item @@ -377,7 +377,7 @@ ItemInst* ItemInst::GetItem(uint8 index) const return inst; } - return NULL; + return nullptr; } void ItemInst::PutItem(uint8 index, const ItemInst& inst) @@ -472,7 +472,7 @@ ItemInst* ItemInst::PopItem(uint8 index) } // Return pointer that needs to be deleted (or otherwise managed) - return NULL; + return nullptr; } // Put item onto back of queue @@ -491,7 +491,7 @@ void ItemInstQueue::push_front(ItemInst* inst) ItemInst* ItemInstQueue::pop() { if (m_list.size() == 0) - return NULL; + return nullptr; ItemInst* inst = m_list.front(); m_list.pop_front(); @@ -501,14 +501,14 @@ ItemInst* ItemInstQueue::pop() // Look at item at front of queue ItemInst* ItemInstQueue::peek_front() const { - return (m_list.size()==0) ? NULL : m_list.front(); + return (m_list.size()==0) ? nullptr : m_list.front(); } // Retrieve item at specified slot; returns false if item not found ItemInst* Inventory::GetItem(int16 slot_id) const { _CP(Inventory_GetItem); - ItemInst* result = NULL; + ItemInst* result = nullptr; // Cursor if (slot_id == SLOT_CURSOR) { @@ -979,7 +979,7 @@ bool Inventory::CheckNoDrop(int16 slot_id) { // Returns item pointer if full delete was successful ItemInst* Inventory::PopItem(int16 slot_id) { - ItemInst* p = NULL; + ItemInst* p = nullptr; if (slot_id==SLOT_CURSOR) { // Cursor p = m_cursor.pop(); @@ -1007,7 +1007,7 @@ ItemInst* Inventory::PopItem(int16 slot_id) else { // Is slot inside bag? ItemInst* baginst = GetItem(Inventory::CalcSlotId(slot_id)); - if (baginst != NULL && baginst->IsType(ItemClassContainer)) { + if (baginst != nullptr && baginst->IsType(ItemClassContainer)) { p = baginst->PopItem(Inventory::CalcBagIdx(slot_id)); } } @@ -1063,7 +1063,7 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo void Inventory::dumpInventory() { iter_inst it; iter_contents itb; - ItemInst* inst = NULL; + ItemInst* inst = nullptr; // Check item: After failed checks, check bag contents (if bag) printf("Worn items:\n"); @@ -1168,15 +1168,15 @@ ItemInst* Inventory::_GetItem(const map& bucket, int16 slot_id } // Not found! - return NULL; + return nullptr; } // Internal Method: "put" item into bucket, without regard for what is currently in bucket // Assumes item has already been allocated int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) { - // If putting a NULL into slot, we need to remove slot without memory delete - if (inst == NULL) { + // If putting a nullptr into slot, we need to remove slot without memory delete + if (inst == nullptr) { //Why do we not delete the poped item here???? PopItem(slot_id); return slot_id; @@ -1232,7 +1232,7 @@ int16 Inventory::_HasItem(map& bucket, uint32 item_id, uint8 q { iter_inst it; iter_contents itb; - ItemInst* inst = NULL; + ItemInst* inst = nullptr; uint8 quantity_found = 0; // Check item: After failed checks, check bag contents (if bag) @@ -1322,7 +1322,7 @@ int16 Inventory::_HasItemByUse(map& bucket, uint8 use, uint8 q { iter_inst it; iter_contents itb; - ItemInst* inst = NULL; + ItemInst* inst = nullptr; uint8 quantity_found = 0; // Check item: After failed checks, check bag contents (if bag) @@ -1390,7 +1390,7 @@ int16 Inventory::_HasItemByLoreGroup(map& bucket, uint32 loreg { iter_inst it; iter_contents itb; - ItemInst* inst = NULL; + ItemInst* inst = nullptr; // Check item: After failed checks, check bag contents (if bag) for (it=bucket.begin(); it!=bucket.end(); it++) { @@ -1690,13 +1690,13 @@ EvoItemInst::EvoItemInst(const EvoItemInst ©) { iter_contents it; for (it=copy.m_contents.begin(); it!=copy.m_contents.end(); it++) { ItemInst* inst_old = it->second; - ItemInst* inst_new = NULL; + ItemInst* inst_new = nullptr; if (inst_old) { inst_new = inst_old->Clone(); } - if (inst_new != NULL) { + if (inst_new != nullptr) { m_contents[it->first] = inst_new; } } @@ -1708,11 +1708,11 @@ EvoItemInst::EvoItemInst(const EvoItemInst ©) { m_exp = copy.m_exp; m_evolveLvl = copy.m_evolveLvl; m_activated = copy.m_activated; - m_evolveInfo = NULL; + m_evolveInfo = nullptr; if (copy.m_scaledItem) m_scaledItem = new Item_Struct(*copy.m_scaledItem); else - m_scaledItem = NULL; + m_scaledItem = nullptr; } EvoItemInst::EvoItemInst(const ItemInst &basecopy) { @@ -1731,13 +1731,13 @@ EvoItemInst::EvoItemInst(const ItemInst &basecopy) { iter_contents it; for (it=copy->m_contents.begin(); it!=copy->m_contents.end(); it++) { ItemInst* inst_old = it->second; - ItemInst* inst_new = NULL; + ItemInst* inst_new = nullptr; if (inst_old) { inst_new = inst_old->Clone(); } - if (inst_new != NULL) { + if (inst_new != nullptr) { m_contents[it->first] = inst_new; } } @@ -1750,8 +1750,8 @@ EvoItemInst::EvoItemInst(const ItemInst &basecopy) { m_exp = 0; m_evolveLvl = 0; m_activated = false; - m_evolveInfo = NULL; - m_scaledItem = NULL; + m_evolveInfo = nullptr; + m_scaledItem = nullptr; } EvoItemInst::EvoItemInst(const Item_Struct* item, int16 charges) { @@ -1770,8 +1770,8 @@ EvoItemInst::EvoItemInst(const Item_Struct* item, int16 charges) { m_exp = 0; m_evolveLvl = 0; m_activated = false; - m_evolveInfo = NULL; - m_scaledItem = NULL; + m_evolveInfo = nullptr; + m_scaledItem = nullptr; } EvoItemInst::~EvoItemInst() { diff --git a/common/Item.h b/common/Item.h index 2f0da8312..4b765221d 100644 --- a/common/Item.h +++ b/common/Item.h @@ -247,13 +247,13 @@ public: ///////////////////////// // Constructors/Destructor - ItemInst(const Item_Struct* item = NULL, int16 charges = 0); + ItemInst(const Item_Struct* item = nullptr, int16 charges = 0); ItemInst(SharedDatabase *db, uint32 item_id, int16 charges = 0); ItemInst(ItemUseType use_type) { m_use_type = use_type; - m_item = NULL; + m_item = nullptr; m_charges = 0; m_price = 0; m_instnodrop = false; @@ -357,7 +357,7 @@ public: void DeleteCustomData(std::string identifier); // Allows treatment of this object as though it were a pointer to m_item - operator bool() const { return (m_item != NULL); } + operator bool() const { return (m_item != nullptr); } // Compare inner Item_Struct of two ItemInst objects bool operator==(const ItemInst& right) const { return (this->m_item == right.m_item); } @@ -408,7 +408,7 @@ public: // constructor and destructor EvoItemInst(const EvoItemInst& copy); EvoItemInst(const ItemInst& copy); - EvoItemInst(const Item_Struct* item = NULL, int16 charges = 0); + EvoItemInst(const Item_Struct* item = nullptr, int16 charges = 0); ~EvoItemInst(); // accessors... a lot of these are for evolving items (not complete yet) @@ -424,7 +424,7 @@ public: EvoItemInst* Clone() const; const Item_Struct* GetItem() const; const Item_Struct* GetUnscaledItem() const; - void Initialize(SharedDatabase *db = NULL); + void Initialize(SharedDatabase *db = nullptr); void ScaleItem(); bool EvolveOnAllKills() const; int8 GetMaxEvolveLvl() const; diff --git a/common/MiscFunctions.cpp b/common/MiscFunctions.cpp index eaafe8ad8..f6cd00e63 100644 --- a/common/MiscFunctions.cpp +++ b/common/MiscFunctions.cpp @@ -123,7 +123,7 @@ bool strn0cpyt(char* dest, const char* source, uint32 size) { const char *MakeUpperString(const char *source) { static char str[128]; if (!source) - return NULL; + return nullptr; MakeUpperString(source, str); return str; } @@ -144,7 +144,7 @@ void MakeUpperString(const char *source, char *target) { const char *MakeLowerString(const char *source) { static char str[128]; if (!source) - return NULL; + return nullptr; MakeLowerString(source, str); return str; } @@ -316,12 +316,12 @@ uint32 ResolveIP(const char* hostname, char* errbuf) { } struct sockaddr_in server_sin; #ifdef _WINDOWS - PHOSTENT phostent = NULL; + PHOSTENT phostent = nullptr; #else - struct hostent *phostent = NULL; + struct hostent *phostent = nullptr; #endif server_sin.sin_family = AF_INET; - if ((phostent = gethostbyname(hostname)) == NULL) { + if ((phostent = gethostbyname(hostname)) == nullptr) { #ifdef _WINDOWS if (errbuf) snprintf(errbuf, ERRBUF_SIZE, "Unable to get the host name. Error: %i", WSAGetLastError()); @@ -396,7 +396,7 @@ int MakeRandomInt(int low, int high) //return (rand()%(high-low+1) + (low)); if(!WELLRNG_init) { WELLRNG_init = true; - oneseed( rnd_hash( time(NULL), clock() ) ); + oneseed( rnd_hash( time(nullptr), clock() ) ); WELLRNG19937 = case_1; } unsigned int randomnum = ((WELLRNG19937)()); @@ -414,7 +414,7 @@ double MakeRandomFloat(double low, double high) //return (rand() / (double)RAND_MAX * (high - low) + low); if(!WELLRNG_init) { WELLRNG_init = true; - oneseed( rnd_hash( time(NULL), clock() ) ); + oneseed( rnd_hash( time(nullptr), clock() ) ); WELLRNG19937 = case_1; } return ((WELLRNG19937)() / (double)0xffffffffUL * (high - low) + low); diff --git a/common/MiscFunctions.h b/common/MiscFunctions.h index 9dbed2478..2ed8a8954 100644 --- a/common/MiscFunctions.h +++ b/common/MiscFunctions.h @@ -149,7 +149,7 @@ public: AutoDelete(T** iVar, T* iSetTo = 0) { init(iVar, iSetTo); } - AutoDelete() { pVar = NULL; } + AutoDelete() { pVar = nullptr; } void init(T** iVar, T* iSetTo = 0) { pVar = iVar; @@ -157,11 +157,11 @@ public: *pVar = iSetTo; } ~AutoDelete() { - if(pVar != NULL) + if(pVar != nullptr) safe_delete(*pVar); } void ReallyClearIt() { - pVar = NULL; + pVar = nullptr; } private: T** pVar; diff --git a/common/ProcLauncher.cpp b/common/ProcLauncher.cpp index e46589032..de317886f 100644 --- a/common/ProcLauncher.cpp +++ b/common/ProcLauncher.cpp @@ -107,7 +107,7 @@ void ProcLauncher::Process() { void ProcLauncher::ProcessTerminated(std::map::iterator &it) { - if(it->second->handler != NULL) + if(it->second->handler != nullptr) it->second->handler->OnTerminate(it->first, it->second); #ifdef _WINDOWS @@ -121,7 +121,7 @@ void ProcLauncher::ProcessTerminated(std::map::iterator &it) { ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) { //consume the pointer Spec *it = to_launch; - to_launch = NULL; + to_launch = nullptr; #ifdef _WINDOWS STARTUPINFO siStartInfo; @@ -138,7 +138,7 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) { siStartInfo.dwFlags = 0; //handle output redirection. - HANDLE logOut = NULL; + HANDLE logOut = nullptr; BOOL inherit_handles = FALSE; if(it->logFile.length() > 0) { inherit_handles = TRUE; @@ -146,7 +146,7 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) { SECURITY_ATTRIBUTES saAttr; saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); saAttr.bInheritHandle = TRUE; //we want this handle to be inherited by the child. - saAttr.lpSecurityDescriptor = NULL; + saAttr.lpSecurityDescriptor = nullptr; logOut = CreateFile( it->logFile.c_str(), //lpFileName FILE_WRITE_DATA, //dwDesiredAccess @@ -154,12 +154,12 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) { &saAttr, //lpSecurityAttributes CREATE_ALWAYS, //dwCreationDisposition FILE_FLAG_NO_BUFFERING, //dwFlagsAndAttributes - NULL ); //hTemplateFile + nullptr ); //hTemplateFile //configure the startup info to redirect output appropriately. siStartInfo.hStdError = logOut; siStartInfo.hStdOutput = logOut; - siStartInfo.hStdInput = NULL; + siStartInfo.hStdInput = nullptr; siStartInfo.dwFlags |= STARTF_USESTDHANDLES; } @@ -179,12 +179,12 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) { bFuncRetn = CreateProcess(it->program.c_str(), const_cast(args.c_str()), // command line - NULL, // process security attributes - NULL, // primary thread security attributes + nullptr, // process security attributes + nullptr, // primary thread security attributes inherit_handles, // handles are not inherited 0, // creation flags (CREATE_NEW_PROCESS_GROUP maybe) - NULL, // use parent's environment - NULL, // use parent's current directory + nullptr, // use parent's environment + nullptr, // use parent's current directory &siStartInfo, // STARTUPINFO pointer &it->proc_info); // receives PROCESS_INFORMATION @@ -197,7 +197,7 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) { //keep process handle open to get exit code CloseHandle(it->proc_info.hThread); //we dont need their thread handle - if(logOut != NULL) + if(logOut != nullptr) CloseHandle(logOut); //we dont want their output handle either. ProcRef res = it->proc_info.dwProcessId; @@ -216,7 +216,7 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) { for(r = 1; r <= it->args.size(); r++) { argv[r] = const_cast(it->args[r-1].c_str()); } - argv[r] = NULL; + argv[r] = nullptr; ProcRef res = fork(); //cant use vfork since we are opening the log file. if(res == -1) { @@ -334,7 +334,7 @@ void ProcLauncher::HandleSigChild(int signum) { ProcLauncher::Spec::Spec() { - handler = NULL; + handler = nullptr; } ProcLauncher::Spec::Spec(const Spec &other) { diff --git a/common/SocketLib/File.cpp b/common/SocketLib/File.cpp index 50a7d9a34..a49e6caad 100644 --- a/common/SocketLib/File.cpp +++ b/common/SocketLib/File.cpp @@ -43,7 +43,7 @@ namespace SOCKETS_NAMESPACE { File::File() -:m_fil(NULL) +:m_fil(nullptr) { } @@ -85,7 +85,7 @@ size_t File::fwrite(const char *ptr, size_t size, size_t nmemb) char *File::fgets(char *s, int size) { - return m_fil ? ::fgets(s, size, m_fil) : NULL; + return m_fil ? ::fgets(s, size, m_fil) : nullptr; } diff --git a/common/SocketLib/HttpdCookies.cpp b/common/SocketLib/HttpdCookies.cpp index 0c0486688..4d9fccb1b 100644 --- a/common/SocketLib/HttpdCookies.cpp +++ b/common/SocketLib/HttpdCookies.cpp @@ -93,14 +93,14 @@ bool HttpdCookies::getvalue(const std::string& name,std::string& buffer) //char void HttpdCookies::replacevalue(const std::string& name,const std::string& value) { - COOKIE *c = NULL; + COOKIE *c = nullptr; for (cookie_v::iterator it = m_cookies.begin(); it != m_cookies.end(); it++) { c = *it; if (!strcasecmp(c -> name.c_str(),name.c_str())) break; - c = NULL; + c = nullptr; } if (c) @@ -126,14 +126,14 @@ void HttpdCookies::replacevalue(const std::string& name,int i) size_t HttpdCookies::getlength(const std::string& name) { - COOKIE *c = NULL; + COOKIE *c = nullptr; for (cookie_v::iterator it = m_cookies.begin(); it != m_cookies.end(); it++) { c = *it; if (!strcasecmp(c -> name.c_str(),name.c_str())) break; - c = NULL; + c = nullptr; } return c ? c -> value.size() : 0; } @@ -223,7 +223,7 @@ void HttpdCookies::setcookie(HTTPSocket *sock, const std::string& domain, const const std::string& HttpdCookies::expiredatetime() { - time_t t = time(NULL); + time_t t = time(nullptr); struct tm * tp = gmtime(&t); const char *days[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; diff --git a/common/SocketLib/HttpdForm.cpp b/common/SocketLib/HttpdForm.cpp index cf7375ce9..b7eb4ada8 100644 --- a/common/SocketLib/HttpdForm.cpp +++ b/common/SocketLib/HttpdForm.cpp @@ -47,7 +47,7 @@ namespace SOCKETS_NAMESPACE { HttpdForm::HttpdForm(IFile *infil) : raw(false) { - CGI *cgi = NULL; + CGI *cgi = nullptr; char *c_t = getenv("CONTENT_TYPE"); char *c_l = getenv("CONTENT_LENGTH"); size_t extra = 2; @@ -59,7 +59,7 @@ HttpdForm::HttpdForm(IFile *infil) : raw(false) if (c_t && !strncmp(c_t, "multipart/form-data",19)) { Parse pa(c_t,";="); - char *tempcmp = NULL; + char *tempcmp = nullptr; size_t tc = 0; size_t l = 0; std::string str = pa.getword(); @@ -209,7 +209,7 @@ HttpdForm::HttpdForm(IFile *infil) : raw(false) #else sprintf(fn,"/tmp/%s",current_filename.c_str()); #endif - if ((fil = fopen(fn, "wb")) != NULL) + if ((fil = fopen(fn, "wb")) != nullptr) { infil -> fread(&c,1,1); while (!infil -> eof()) @@ -353,7 +353,7 @@ HttpdForm::HttpdForm(IFile *infil) : raw(false) HttpdForm::HttpdForm(const std::string& buffer,size_t l) : raw(false) { - CGI *cgi = NULL; + CGI *cgi = nullptr; char slask[8888]; char name[200]; int i = 0; @@ -424,7 +424,7 @@ HttpdForm::HttpdForm(const std::string& buffer,size_t l) : raw(false) HttpdForm::~HttpdForm() { - CGI *cgi = NULL; //,*tmp; + CGI *cgi = nullptr; //,*tmp; for (cgi_v::iterator it = m_cgi.begin(); it != m_cgi.end(); it++) { @@ -525,7 +525,7 @@ bool HttpdForm::getnext(std::string& n,std::string& v) //char *n,size_t len,char int HttpdForm::getvalue(const std::string& n,std::string& v) //char *v,size_t len) { - CGI *cgi = NULL; + CGI *cgi = nullptr; int r = 0; for (cgi_v::iterator it = m_cgi.begin(); it != m_cgi.end(); it++) @@ -533,7 +533,7 @@ int HttpdForm::getvalue(const std::string& n,std::string& v) //char *v,size_t le cgi = *it; if (cgi -> name == n) break; - cgi = NULL; + cgi = nullptr; } if (cgi) { @@ -572,7 +572,7 @@ std::string HttpdForm::getvalue(const std::string& n) size_t HttpdForm::getlength(const std::string& n) { - CGI *cgi = NULL; + CGI *cgi = nullptr; size_t l; for (cgi_v::iterator it = m_cgi.begin(); it != m_cgi.end(); it++) @@ -580,7 +580,7 @@ size_t HttpdForm::getlength(const std::string& n) cgi = *it; if (cgi -> name == n) break; - cgi = NULL; + cgi = nullptr; } l = cgi ? cgi -> value.size() : 0; if (cgi && !raw) diff --git a/common/SocketLib/HttpdSocket.cpp b/common/SocketLib/HttpdSocket.cpp index bfabf6706..bd803877a 100644 --- a/common/SocketLib/HttpdSocket.cpp +++ b/common/SocketLib/HttpdSocket.cpp @@ -64,11 +64,11 @@ std::string HttpdSocket::m_start = ""; HttpdSocket::HttpdSocket(uint32 ID, SOCKET in_socket, uint32 irIP, uint16 irPort) : HTTPSocket(ID,in_socket,irIP,irPort) ,m_content_length(0) -,m_file(NULL) +,m_file(nullptr) ,m_received(0) ,m_request_id(++m_request_count) -,m_cookies(NULL) -,m_form(NULL) +,m_cookies(nullptr) +,m_form(nullptr) { m_http_date = datetime2httpdate(GetDate()); if (!m_start.size()) @@ -289,7 +289,7 @@ std::string HttpdSocket::datetime2httpdate(const std::string& dt) std::string HttpdSocket::GetDate() { - time_t t = time(NULL); + time_t t = time(nullptr); struct tm* tp = localtime(&t); char slask[40]; if (tp) @@ -315,16 +315,16 @@ void HttpdSocket::Reset() if (m_file) { delete m_file; - m_file = NULL; + m_file = nullptr; } m_received = 0; m_request_id = ++m_request_count; if (m_cookies) delete m_cookies; - m_cookies = NULL; + m_cookies = nullptr; if (m_form) delete m_form; - m_form = NULL; + m_form = nullptr; } diff --git a/common/SocketLib/MemFile.cpp b/common/SocketLib/MemFile.cpp index d52174798..7c50356f8 100644 --- a/common/SocketLib/MemFile.cpp +++ b/common/SocketLib/MemFile.cpp @@ -66,8 +66,8 @@ MemFile::MemFile(const std::string& path) :m_path(path) ,m_temporary(false) ,m_base(m_files[path]) -,m_current_read(NULL) -,m_current_write(NULL) +,m_current_read(nullptr) +,m_current_write(nullptr) ,m_read_ptr(0) ,m_write_ptr(0) { diff --git a/common/SocketLib/MemFile.h b/common/SocketLib/MemFile.h index bd82abe01..de777e424 100644 --- a/common/SocketLib/MemFile.h +++ b/common/SocketLib/MemFile.h @@ -48,7 +48,7 @@ public: /** File block structure. \ingroup file */ struct block_t { - block_t() : next(NULL) {} + block_t() : next(nullptr) {} struct block_t *next; char data[BLOCKSIZE]; }; diff --git a/common/SocketLib/Mime.cpp b/common/SocketLib/Mime.cpp index 04944bb5b..282a34e77 100644 --- a/common/SocketLib/Mime.cpp +++ b/common/SocketLib/Mime.cpp @@ -37,7 +37,7 @@ Mime::Mime(const std::string& filename) { bool Mime::LoadMimeFile(const std::string& filename) { FILE *fil; - if ((fil = fopen(filename.c_str(),"rt")) != NULL) { + if ((fil = fopen(filename.c_str(),"rt")) != nullptr) { char * slask = new char[1000]; fgets(slask,1000,fil); while (!feof(fil)) diff --git a/common/StackWalker/StackWalker.cpp b/common/StackWalker/StackWalker.cpp index 1a6659c97..6931c30f5 100644 --- a/common/StackWalker/StackWalker.cpp +++ b/common/StackWalker/StackWalker.cpp @@ -104,7 +104,7 @@ typedef struct _tagSTACKFRAME64 { ADDRESS64 AddrFrame; // frame pointer ADDRESS64 AddrStack; // stack pointer ADDRESS64 AddrBStore; // backing store pointer - PVOID FuncTableEntry; // pointer to pdata/fpo or NULL + PVOID FuncTableEntry; // pointer to pdata/fpo or nullptr DWORD64 Params[4]; // possible arguments to the function BOOL Far; // WOW far call BOOL Virtual; // is this a virtual frame? @@ -187,44 +187,44 @@ public: StackWalkerInternal(StackWalker *parent, HANDLE hProcess) { m_parent = parent; - m_hDbhHelp = NULL; - pSC = NULL; + m_hDbhHelp = nullptr; + pSC = nullptr; m_hProcess = hProcess; - m_szSymPath = NULL; - pSFTA = NULL; - pSGLFA = NULL; - pSGMB = NULL; - pSGMI = NULL; - pSGO = NULL; - pSGSFA = NULL; - pSI = NULL; - pSLM = NULL; - pSSO = NULL; - pSW = NULL; - pUDSN = NULL; - pSGSP = NULL; + m_szSymPath = nullptr; + pSFTA = nullptr; + pSGLFA = nullptr; + pSGMB = nullptr; + pSGMI = nullptr; + pSGO = nullptr; + pSGSFA = nullptr; + pSI = nullptr; + pSLM = nullptr; + pSSO = nullptr; + pSW = nullptr; + pUDSN = nullptr; + pSGSP = nullptr; } ~StackWalkerInternal() { - if (pSC != NULL) + if (pSC != nullptr) pSC(m_hProcess); // SymCleanup - if (m_hDbhHelp != NULL) + if (m_hDbhHelp != nullptr) FreeLibrary(m_hDbhHelp); - m_hDbhHelp = NULL; - m_parent = NULL; - if(m_szSymPath != NULL) + m_hDbhHelp = nullptr; + m_parent = nullptr; + if(m_szSymPath != nullptr) free(m_szSymPath); - m_szSymPath = NULL; + m_szSymPath = nullptr; } BOOL Init(LPCSTR szSymPath) { - if (m_parent == NULL) + if (m_parent == nullptr) return FALSE; // Dynamically load the Entry-Points for dbghelp.dll: // First try to load the newsest one from TCHAR szTemp[4096]; // But before wqe do this, we first check if the ".local" file exists - if (GetModuleFileName(NULL, szTemp, 4096) > 0) + if (GetModuleFileName(nullptr, szTemp, 4096) > 0) { _tcscat_s(szTemp, _T(".local")); if (GetFileAttributes(szTemp) == INVALID_FILE_ATTRIBUTES) @@ -240,7 +240,7 @@ public: } } // Still not found? Then try to load the 64-Bit version: - if ( (m_hDbhHelp == NULL) && (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0) ) + if ( (m_hDbhHelp == nullptr) && (GetEnvironmentVariable(_T("ProgramFiles"), szTemp, 4096) > 0) ) { _tcscat_s(szTemp, _T("\\Debugging Tools for Windows 64-Bit\\dbghelp.dll")); if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES) @@ -250,9 +250,9 @@ public: } } } - if (m_hDbhHelp == NULL) // if not already loaded, try to load a default-one + if (m_hDbhHelp == nullptr) // if not already loaded, try to load a default-one m_hDbhHelp = LoadLibrary( _T("dbghelp.dll") ); - if (m_hDbhHelp == NULL) + if (m_hDbhHelp == nullptr) return FALSE; pSI = (tSI) GetProcAddress(m_hDbhHelp, "SymInitialize" ); pSC = (tSC) GetProcAddress(m_hDbhHelp, "SymCleanup" ); @@ -271,18 +271,18 @@ public: pSLM = (tSLM) GetProcAddress(m_hDbhHelp, "SymLoadModule64" ); pSGSP =(tSGSP) GetProcAddress(m_hDbhHelp, "SymGetSearchPath" ); - if ( pSC == NULL || pSFTA == NULL || pSGMB == NULL || pSGMI == NULL || - pSGO == NULL || pSGSFA == NULL || pSI == NULL || pSSO == NULL || - pSW == NULL || pUDSN == NULL || pSLM == NULL ) + if ( pSC == nullptr || pSFTA == nullptr || pSGMB == nullptr || pSGMI == nullptr || + pSGO == nullptr || pSGSFA == nullptr || pSI == nullptr || pSSO == nullptr || + pSW == nullptr || pUDSN == nullptr || pSLM == nullptr ) { FreeLibrary(m_hDbhHelp); - m_hDbhHelp = NULL; - pSC = NULL; + m_hDbhHelp = nullptr; + pSC = nullptr; return FALSE; } // SymInitialize - if (szSymPath != NULL) + if (szSymPath != nullptr) m_szSymPath = _strdup(szSymPath); if (this->pSI(m_hProcess, m_szSymPath, FALSE) == FALSE) this->m_parent->OnDbgHelpErr("SymInitialize", GetLastError(), 0); @@ -295,7 +295,7 @@ public: symOptions = this->pSSO(symOptions); char buf[StackWalker::STACKWALK_MAX_NAMELEN] = {0}; - if (this->pSGSP != NULL) + if (this->pSGSP != nullptr) { if (this->pSGSP(m_hProcess, buf, StackWalker::STACKWALK_MAX_NAMELEN) == FALSE) this->m_parent->OnDbgHelpErr("SymGetSearchPath", GetLastError(), 0); @@ -458,10 +458,10 @@ private: // try both dlls... const TCHAR *dllname[] = { _T("kernel32.dll"), _T("tlhelp32.dll") }; - HINSTANCE hToolhelp = NULL; - tCT32S pCT32S = NULL; - tM32F pM32F = NULL; - tM32N pM32N = NULL; + HINSTANCE hToolhelp = nullptr; + tCT32S pCT32S = nullptr; + tM32F pM32F = nullptr; + tM32N pM32N = nullptr; HANDLE hSnap; MODULEENTRY32 me; @@ -472,18 +472,18 @@ private: for (i = 0; i<(sizeof(dllname) / sizeof(dllname[0])); i++ ) { hToolhelp = LoadLibrary( dllname[i] ); - if (hToolhelp == NULL) + if (hToolhelp == nullptr) continue; pCT32S = (tCT32S) GetProcAddress(hToolhelp, "CreateToolhelp32Snapshot"); pM32F = (tM32F) GetProcAddress(hToolhelp, "Module32First"); pM32N = (tM32N) GetProcAddress(hToolhelp, "Module32Next"); - if ( (pCT32S != NULL) && (pM32F != NULL) && (pM32N != NULL) ) + if ( (pCT32S != nullptr) && (pM32F != nullptr) && (pM32N != nullptr) ) break; // found the functions! FreeLibrary(hToolhelp); - hToolhelp = NULL; + hToolhelp = nullptr; } - if (hToolhelp == NULL) + if (hToolhelp == nullptr) return FALSE; hSnap = pCT32S( TH32CS_SNAPMODULE, pid ); @@ -534,20 +534,20 @@ private: DWORD cbNeeded; MODULEINFO mi; HMODULE *hMods = 0; - char *tt = NULL; - char *tt2 = NULL; + char *tt = nullptr; + char *tt2 = nullptr; const SIZE_T TTBUFLEN = 8096; int cnt = 0; hPsapi = LoadLibrary( _T("psapi.dll") ); - if (hPsapi == NULL) + if (hPsapi == nullptr) return FALSE; pEPM = (tEPM) GetProcAddress( hPsapi, "EnumProcessModules" ); pGMFNE = (tGMFNE) GetProcAddress( hPsapi, "GetModuleFileNameExA" ); pGMBN = (tGMFNE) GetProcAddress( hPsapi, "GetModuleBaseNameA" ); pGMI = (tGMI) GetProcAddress( hPsapi, "GetModuleInformation" ); - if ( (pEPM == NULL) || (pGMFNE == NULL) || (pGMBN == NULL) || (pGMI == NULL) ) + if ( (pEPM == nullptr) || (pGMFNE == nullptr) || (pGMBN == nullptr) || (pGMI == nullptr) ) { // we couldn?t find all functions FreeLibrary(hPsapi); @@ -557,7 +557,7 @@ private: hMods = (HMODULE*) malloc(sizeof(HMODULE) * (TTBUFLEN / sizeof HMODULE)); tt = (char*) malloc(sizeof(char) * TTBUFLEN); tt2 = (char*) malloc(sizeof(char) * TTBUFLEN); - if ( (hMods == NULL) || (tt == NULL) || (tt2 == NULL) ) + if ( (hMods == nullptr) || (tt == nullptr) || (tt2 == nullptr) ) goto cleanup; if ( ! pEPM( hProcess, hMods, TTBUFLEN, &cbNeeded ) ) @@ -590,10 +590,10 @@ private: } cleanup: - if (hPsapi != NULL) FreeLibrary(hPsapi); - if (tt2 != NULL) free(tt2); - if (tt != NULL) free(tt); - if (hMods != NULL) free(hMods); + if (hPsapi != nullptr) FreeLibrary(hPsapi); + if (tt2 != nullptr) free(tt2); + if (tt != nullptr) free(tt); + if (hMods != nullptr) free(hMods); return cnt != 0; } // GetModuleListPSAPI @@ -603,7 +603,7 @@ private: CHAR *szImg = _strdup(img); CHAR *szMod = _strdup(mod); DWORD result = ERROR_SUCCESS; - if ( (szImg == NULL) || (szMod == NULL) ) + if ( (szImg == nullptr) || (szMod == nullptr) ) result = ERROR_NOT_ENOUGH_MEMORY; else { @@ -611,25 +611,25 @@ private: result = GetLastError(); } ULONGLONG fileVersion = 0; - if ( (m_parent != NULL) && (szImg != NULL) ) + if ( (m_parent != nullptr) && (szImg != nullptr) ) { // try to retrive the file-version: if ( (this->m_parent->m_options & StackWalker::RetrieveFileVersion) != 0) { - VS_FIXEDFILEINFO *fInfo = NULL; + VS_FIXEDFILEINFO *fInfo = nullptr; DWORD dwHandle; DWORD dwSize = GetFileVersionInfoSizeA(szImg, &dwHandle); if (dwSize > 0) { LPVOID vData = malloc(dwSize); - if (vData != NULL) + if (vData != nullptr) { if (GetFileVersionInfoA(szImg, dwHandle, dwSize, vData) != 0) { UINT len; TCHAR szSubBlock[] = _T("\\"); if (VerQueryValue(vData, szSubBlock, (LPVOID*) &fInfo, &len) == 0) - fInfo = NULL; + fInfo = nullptr; else { fileVersion = ((ULONGLONG)fInfo->dwFileVersionLS) + ((ULONGLONG)fInfo->dwFileVersionMS << 32); @@ -678,8 +678,8 @@ private: } this->m_parent->OnLoadModule(img, mod, baseAddr, size, result, szSymType, Module.LoadedImageName, fileVersion); } - if (szImg != NULL) free(szImg); - if (szMod != NULL) free(szMod); + if (szImg != nullptr) free(szImg); + if (szMod != nullptr) free(szMod); return result; } public: @@ -695,7 +695,7 @@ public: BOOL GetModuleInfo(HANDLE hProcess, DWORD64 baseAddr, IMAGEHLP_MODULE64_V2 *pModuleInfo) { - if(this->pSGMI == NULL) + if(this->pSGMI == nullptr) { SetLastError(ERROR_DLL_INIT_FAILED); return FALSE; @@ -703,7 +703,7 @@ public: // First try to use the larger ModuleInfo-Structure // memset(pModuleInfo, 0, sizeof(IMAGEHLP_MODULE64_V3)); // pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64_V3); -// if (this->pSGMI_V3 != NULL) +// if (this->pSGMI_V3 != nullptr) // { // if (this->pSGMI_V3(hProcess, baseAddr, pModuleInfo) != FALSE) // return TRUE; @@ -714,7 +714,7 @@ public: // could not retrive the bigger structure, try with the smaller one (as defined in VC7.1)... pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE64_V2); void *pData = malloc(4096); // reserve enough memory, so the bug in v6.3.5.1 does not lead to memory-overwrites... - if (pData == NULL) + if (pData == nullptr) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; @@ -742,7 +742,7 @@ StackWalker::StackWalker(DWORD dwProcessId, HANDLE hProcess) this->m_hProcess = hProcess; this->m_sw = new StackWalkerInternal(this, this->m_hProcess); this->m_dwProcessId = dwProcessId; - this->m_szSymPath = NULL; + this->m_szSymPath = nullptr; } StackWalker::StackWalker(int options, LPCSTR szSymPath, DWORD dwProcessId, HANDLE hProcess) { @@ -751,28 +751,28 @@ StackWalker::StackWalker(int options, LPCSTR szSymPath, DWORD dwProcessId, HANDL this->m_hProcess = hProcess; this->m_sw = new StackWalkerInternal(this, this->m_hProcess); this->m_dwProcessId = dwProcessId; - if (szSymPath != NULL) + if (szSymPath != nullptr) { this->m_szSymPath = _strdup(szSymPath); this->m_options |= SymBuildPath; } else - this->m_szSymPath = NULL; + this->m_szSymPath = nullptr; } StackWalker::~StackWalker() { - if (m_szSymPath != NULL) + if (m_szSymPath != nullptr) free(m_szSymPath); - m_szSymPath = NULL; - if (this->m_sw != NULL) + m_szSymPath = nullptr; + if (this->m_sw != nullptr) delete this->m_sw; - this->m_sw = NULL; + this->m_sw = nullptr; } BOOL StackWalker::LoadModules() { - if (this->m_sw == NULL) + if (this->m_sw == nullptr) { SetLastError(ERROR_DLL_INIT_FAILED); return FALSE; @@ -781,19 +781,19 @@ BOOL StackWalker::LoadModules() return TRUE; // Build the sym-path: - char *szSymPath = NULL; + char *szSymPath = nullptr; if ( (this->m_options & SymBuildPath) != 0) { const size_t nSymPathLen = 4096; szSymPath = (char*) malloc(nSymPathLen); - if (szSymPath == NULL) + if (szSymPath == nullptr) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } szSymPath[0] = 0; // Now first add the (optional) provided sympath: - if (this->m_szSymPath != NULL) + if (this->m_szSymPath != nullptr) { strcat_s(szSymPath, nSymPathLen, this->m_szSymPath); strcat_s(szSymPath, nSymPathLen, ";"); @@ -812,7 +812,7 @@ BOOL StackWalker::LoadModules() } // Now add the path for the main-module: - if (GetModuleFileNameA(NULL, szTemp, nTempLen) > 0) + if (GetModuleFileNameA(nullptr, szTemp, nTempLen) > 0) { szTemp[nTempLen-1] = 0; for (char *p = (szTemp+strlen(szTemp)-1); p >= szTemp; --p) @@ -870,7 +870,7 @@ BOOL StackWalker::LoadModules() // First Init the whole stuff... BOOL bRet = this->m_sw->Init(szSymPath); - if (szSymPath != NULL) free(szSymPath); szSymPath = NULL; + if (szSymPath != nullptr) free(szSymPath); szSymPath = nullptr; if (bRet == FALSE) { this->OnDbgHelpErr("Error while initializing dbghelp.dll", 0, 0); @@ -889,14 +889,14 @@ BOOL StackWalker::LoadModules() // This has to be done due to a problem with the "hProcess"-parameter in x64... // Because this class is in no case multi-threading-enabled (because of the limitations // of dbghelp.dll) it is "safe" to use a static-variable -static StackWalker::PReadProcessMemoryRoutine s_readMemoryFunction = NULL; -static LPVOID s_readMemoryFunction_UserData = NULL; +static StackWalker::PReadProcessMemoryRoutine s_readMemoryFunction = nullptr; +static LPVOID s_readMemoryFunction_UserData = nullptr; BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadProcessMemoryRoutine readMemoryFunction, LPVOID pUserData) { CONTEXT c;; CallstackEntry csEntry; - IMAGEHLP_SYMBOL64 *pSym = NULL; + IMAGEHLP_SYMBOL64 *pSym = nullptr; StackWalkerInternal::IMAGEHLP_MODULE64_V2 Module; IMAGEHLP_LINE64 Line; int frameNum; @@ -904,7 +904,7 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro if (m_modulesLoaded == FALSE) this->LoadModules(); // ignore the result... - if (this->m_sw->m_hDbhHelp == NULL) + if (this->m_sw->m_hDbhHelp == nullptr) { SetLastError(ERROR_DLL_INIT_FAILED); return FALSE; @@ -913,7 +913,7 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro s_readMemoryFunction = readMemoryFunction; s_readMemoryFunction_UserData = pUserData; - if (context == NULL) + if (context == nullptr) { // If no context is provided, capture the context if (hThread == GetCurrentThread()) @@ -989,7 +989,7 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro // assume that either you are done, or that the stack is so hosed that the next // deeper frame could not be found. // CONTEXT need not to be suplied if imageTyp is IMAGE_FILE_MACHINE_I386! - if ( ! this->m_sw->pSW(imageType, this->m_hProcess, hThread, &s, &c, myReadProcMem, this->m_sw->pSFTA, this->m_sw->pSGMB, NULL) ) + if ( ! this->m_sw->pSW(imageType, this->m_hProcess, hThread, &s, &c, myReadProcMem, this->m_sw->pSFTA, this->m_sw->pSGMB, nullptr) ) { this->OnDbgHelpErr("StackWalk64", GetLastError(), s.AddrPC.Offset); break; @@ -1028,7 +1028,7 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro } // show line number info, NT5.0-method (SymGetLineFromAddr64()) - if (this->m_sw->pSGLFA != NULL ) + if (this->m_sw->pSGLFA != nullptr ) { // yes, we have SymGetLineFromAddr64() if (this->m_sw->pSGLFA(this->m_hProcess, s.AddrPC.Offset, &(csEntry.offsetFromLine), &Line) != FALSE) { @@ -1078,7 +1078,7 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro break; default: //_snprintf( ty, sizeof ty, "symtype=%ld", (long) Module.SymType ); - csEntry.symTypeString = NULL; + csEntry.symTypeString = nullptr; break; } @@ -1109,7 +1109,7 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro cleanup: if (pSym) free( pSym ); - if (context == NULL) + if (context == nullptr) ResumeThread(hThread); return TRUE; @@ -1123,7 +1123,7 @@ BOOL __stdcall StackWalker::myReadProcMem( LPDWORD lpNumberOfBytesRead ) { - if (s_readMemoryFunction == NULL) + if (s_readMemoryFunction == nullptr) { SIZE_T st; BOOL bRet = ReadProcessMemory(hProcess, (LPVOID) qwBaseAddress, lpBuffer, nSize, &st); diff --git a/common/StackWalker/StackWalker.h b/common/StackWalker/StackWalker.h index 808a18810..0c3236ffb 100644 --- a/common/StackWalker/StackWalker.h +++ b/common/StackWalker/StackWalker.h @@ -66,7 +66,7 @@ public: StackWalker( int options = OptionsAll, // 'int' is by design, to combine the enum-flags - LPCSTR szSymPath = NULL, + LPCSTR szSymPath = nullptr, DWORD dwProcessId = GetCurrentProcessId(), HANDLE hProcess = GetCurrentProcess() ); @@ -86,9 +86,9 @@ public: BOOL ShowCallstack( HANDLE hThread = GetCurrentThread(), - const CONTEXT *context = NULL, - PReadProcessMemoryRoutine readMemoryFunction = NULL, - LPVOID pUserData = NULL // optional to identify some data in the 'readMemoryFunction'-callback + const CONTEXT *context = nullptr, + PReadProcessMemoryRoutine readMemoryFunction = nullptr, + LPVOID pUserData = nullptr // optional to identify some data in the 'readMemoryFunction'-callback ); #if _MSC_VER >= 1300 @@ -157,11 +157,11 @@ protected: #define GET_CURRENT_CONTEXT(c, contextFlags) \ do { \ memset(&c, 0, sizeof(CONTEXT)); \ - EXCEPTION_POINTERS *pExp = NULL; \ + EXCEPTION_POINTERS *pExp = nullptr; \ __try { \ throw 0; \ } __except( ( (pExp = GetExceptionInformation()) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_EXECUTE_HANDLER)) {} \ - if (pExp != NULL) \ + if (pExp != nullptr) \ memcpy(&c, pExp->ContextRecord, sizeof(CONTEXT)); \ c.ContextFlags = contextFlags; \ } while(0); diff --git a/common/StructStrategy.cpp b/common/StructStrategy.cpp index e18e77c13..7b71180e3 100644 --- a/common/StructStrategy.cpp +++ b/common/StructStrategy.cpp @@ -31,7 +31,7 @@ void StructStrategy::Decode(EQApplicationPacket *p) const { void StructStrategy::ErrorEncoder(EQApplicationPacket **in_p, EQStream *dest, bool ack_req) { EQApplicationPacket *p = *in_p; - *in_p = NULL; + *in_p = nullptr; _log(NET__STRUCTS, "Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); @@ -67,7 +67,7 @@ namespace StructStrategyFactory { map::const_iterator res; res = strategies.find(first_opcode); if(res == strategies.end()) - return(NULL); + return(nullptr); return(res->second); } diff --git a/common/TCPConnection.cpp b/common/TCPConnection.cpp index e61e213c0..c4a4f79b3 100644 --- a/common/TCPConnection.cpp +++ b/common/TCPConnection.cpp @@ -56,8 +56,8 @@ TCPConnection::TCPConnection() pState = TCPS_Ready; pFree = false; pEcho = false; - recvbuf = NULL; - sendbuf = NULL; + recvbuf = nullptr; + sendbuf = nullptr; pRunLoop = false; charAsyncConnect = 0; pAsyncConnect = false; @@ -78,8 +78,8 @@ TCPConnection::TCPConnection(uint32 ID, SOCKET in_socket, uint32 irIP, uint16 ir pState = TCPS_Connected; pFree = false; pEcho = false; - recvbuf = NULL; - sendbuf = NULL; + recvbuf = nullptr; + sendbuf = nullptr; pRunLoop = false; charAsyncConnect = 0; pAsyncConnect = false; @@ -180,7 +180,7 @@ bool TCPConnection::Send(const uchar* data, int32 size) { void TCPConnection::ServerSendQueuePushEnd(const uchar* data, int32 size) { MSendQueue.lock(); - if (sendbuf == NULL) { + if (sendbuf == nullptr) { sendbuf = new uchar[size]; sendbuf_size = size; sendbuf_used = 0; @@ -387,7 +387,7 @@ void TCPConnection::AsyncConnect(uint32 irIP, uint16 irPort) { _beginthread(TCPConnectionLoop, 0, this); #else pthread_t thread; - pthread_create(&thread, NULL, TCPConnectionLoop, this); + pthread_create(&thread, nullptr, TCPConnectionLoop, this); #endif } return; @@ -433,7 +433,7 @@ bool TCPConnection::ConnectIP(uint32 in_ip, uint16 in_port, char* errbuf) { _beginthread(TCPConnectionLoop, 0, this); #else pthread_t thread; - pthread_create(&thread, NULL, TCPConnectionLoop, this); + pthread_create(&thread, nullptr, TCPConnectionLoop, this); #endif } @@ -729,7 +729,7 @@ bool TCPConnection::ProcessReceivedData(char* errbuf) { case 10: case 13: // newline marker { - char *line = NULL; + char *line = nullptr; if (i==0) { // empty line if(!m_previousLineEnd) { //char right before this was NOT a CR, report the empty line. @@ -772,7 +772,7 @@ bool TCPConnection::ProcessReceivedData(char* errbuf) { } - if(line != NULL) { + if(line != nullptr) { bool finish_proc = false; finish_proc = LineOutQueuePush(line); if(finish_proc) @@ -896,7 +896,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); #endif if (tmp == 0) { - THREAD_RETURN(NULL); + THREAD_RETURN(nullptr); } TCPConnection* tcpc = (TCPConnection*) tmp; #ifndef WIN32 @@ -932,7 +932,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { _log(COMMON__THREADS, "Ending TCPConnectionLoop with thread ID %d", pthread_self()); #endif - THREAD_RETURN(NULL); + THREAD_RETURN(nullptr); } bool TCPConnection::RunLoop() { diff --git a/common/TCPServer.cpp b/common/TCPServer.cpp index d7056dc05..175dc0b3b 100644 --- a/common/TCPServer.cpp +++ b/common/TCPServer.cpp @@ -33,7 +33,7 @@ BaseTCPServer::BaseTCPServer(uint16 in_port) { _beginthread(BaseTCPServer::TCPServerLoop, 0, this); #else pthread_t thread; - pthread_create(&thread, NULL, &BaseTCPServer::TCPServerLoop, this); + pthread_create(&thread, nullptr, &BaseTCPServer::TCPServerLoop, this); #endif } @@ -67,7 +67,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); #endif if (tmp == 0) { - THREAD_RETURN(NULL); + THREAD_RETURN(nullptr); } BaseTCPServer* tcps = (BaseTCPServer*) tmp; @@ -87,7 +87,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { _log(COMMON__THREADS, "Ending TCPServerLoop with thread ID %d", pthread_self()); #endif - THREAD_RETURN(NULL); + THREAD_RETURN(nullptr); } void BaseTCPServer::Process() { diff --git a/common/TCPServer.h b/common/TCPServer.h index 73b6dde6e..2a5b95ad3 100644 --- a/common/TCPServer.h +++ b/common/TCPServer.h @@ -71,7 +71,7 @@ public: } T * NewQueuePop() { - T * ret = NULL; + T * ret = nullptr; MNewQueue.lock(); if(!m_NewQueue.empty()) { ret = m_NewQueue.front(); diff --git a/common/XMLParser.cpp b/common/XMLParser.cpp index 21d02a8e1..481dbf81f 100644 --- a/common/XMLParser.cpp +++ b/common/XMLParser.cpp @@ -31,14 +31,14 @@ bool XMLParser::ParseFile(const char *file, const char *root_ele) { } TiXmlElement *root = doc.FirstChildElement( root_ele ); - if(root == NULL) { + if(root == nullptr) { printf("Unable to find root '%s' in %s\n",root_ele, file); return(false); } ParseOkay=true; - TiXmlNode *main_element = NULL; + TiXmlNode *main_element = nullptr; while( (main_element = root->IterateChildren( main_element )) ) { if(main_element->Type() != TiXmlNode::ELEMENT) continue; //skip crap we dont care about @@ -71,30 +71,30 @@ bool XMLParser::ParseFile(const char *file, const char *root_ele) { const char *XMLParser::ParseTextBlock(TiXmlNode *within, const char *name, bool optional) { TiXmlElement * txt = within->FirstChildElement(name); - if(txt == NULL) { + if(txt == nullptr) { if(!optional) { printf("Unable to find a '%s' element on %s element at line %d\n", name, within->Value(), within->Row()); ParseOkay=false; } - return(NULL); + return(nullptr); } TiXmlNode *contents = txt->FirstChild(); - if(contents == NULL || contents->Type() != TiXmlNode::TEXT) { + if(contents == nullptr || contents->Type() != TiXmlNode::TEXT) { if(!optional) printf("Node '%s' was expected to be a text element in %s element at line %d\n", name, txt->Value(), txt->Row()); - return(NULL); + return(nullptr); } return(contents->Value()); } const char *XMLParser::GetText(TiXmlNode *within, bool optional) { TiXmlNode *contents = within->FirstChild(); - if(contents == NULL || contents->Type() != TiXmlNode::TEXT) { + if(contents == nullptr || contents->Type() != TiXmlNode::TEXT) { if(!optional) { printf("Node was expected to be a text element in %s element at line %d\n", within->Value(), within->Row()); ParseOkay=false; } - return(NULL); + return(nullptr); } return(contents->Value()); } diff --git a/common/database.cpp b/common/database.cpp index f0e686979..c03ad97cf 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -428,7 +428,7 @@ bool Database::ReserveName(uint32 account_id, char* name) char errbuf[MYSQL_ERRMSG_SIZE]; char *query = 0; - if (!RunQuery(query, MakeAnyLenString(&query, "INSERT into character_ SET account_id=%i, name='%s', profile=NULL", account_id, name), errbuf)) { + if (!RunQuery(query, MakeAnyLenString(&query, "INSERT into character_ SET account_id=%i, name='%s', profile=nullptr", account_id, name), errbuf)) { cerr << "Error in ReserveName query '" << query << "' " << errbuf << endl; safe_delete_array(query); return false; @@ -465,7 +465,7 @@ bool Database::DeleteCharacter(char *name) if (query) { safe_delete_array(query); - query = NULL; + query = nullptr; } matches = mysql_num_rows(result); if(matches == 1) @@ -482,7 +482,7 @@ bool Database::DeleteCharacter(char *name) if(result) { mysql_free_result(result); - result = NULL; + result = nullptr; } return false; } @@ -490,7 +490,7 @@ bool Database::DeleteCharacter(char *name) if(result) { mysql_free_result(result); - result = NULL; + result = nullptr; } @@ -499,195 +499,195 @@ bool Database::DeleteCharacter(char *name) printf("DeleteCharacter: deleting '%s' (id %d): ", name, charid); printf(" quest_globals"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from quest_globals WHERE charid='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from quest_globals WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" character_tasks"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from character_tasks WHERE charid='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from character_tasks WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" character_activities"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from character_activities WHERE charid='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from character_activities WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" character_enabledtasks"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from character_enabledtasks WHERE charid='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from character_enabledtasks WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" completed_tasks"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from completed_tasks WHERE charid='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from completed_tasks WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" friends"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from friends WHERE charid='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from friends WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" mail"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from mail WHERE charid='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from mail WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" ptimers"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from timers WHERE char_id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from timers WHERE char_id='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" inventory"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from inventory WHERE charid='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from inventory WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" guild_members"); #endif #ifdef BOTS - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM guild_members WHERE char_id='%d' AND GetMobTypeById(%i) = 'C'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM guild_members WHERE char_id='%d' AND GetMobTypeById(%i) = 'C'", charid), errbuf, nullptr, &affected_rows); #else - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM guild_members WHERE char_id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM guild_members WHERE char_id='%d'", charid), errbuf, nullptr, &affected_rows); #endif if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" recipes"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM char_recipe_list WHERE char_id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM char_recipe_list WHERE char_id='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" adventure_stats"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM adventure_stats WHERE player_id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM adventure_stats WHERE player_id='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" zone_flags"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM zone_flags WHERE charID='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM zone_flags WHERE charID='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" titles"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM titles WHERE char_id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM titles WHERE char_id='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" titlesets"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM player_titlesets WHERE char_id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM player_titlesets WHERE char_id='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" keyring"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM keyring WHERE char_id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM keyring WHERE char_id='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" factions"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM faction_values WHERE char_id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM faction_values WHERE char_id='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" instances"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_lockout_player WHERE charid='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_lockout_player WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 printf(" _character"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE from character_ WHERE id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE from character_ WHERE id='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } if(affected_rows != 1) // here we have to have a match or it's an error { @@ -698,11 +698,11 @@ bool Database::DeleteCharacter(char *name) #if DEBUG >= 5 printf(" alternate currency"); #endif - RunQuery(query, MakeAnyLenString(&query, "DELETE FROM character_alt_currency WHERE char_id='%d'", charid), errbuf, NULL, &affected_rows); + RunQuery(query, MakeAnyLenString(&query, "DELETE FROM character_alt_currency WHERE char_id='%d'", charid), errbuf, nullptr, &affected_rows); if(query) { safe_delete_array(query); - query = NULL; + query = nullptr; } #if DEBUG >= 5 @@ -764,7 +764,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven } const char *zname = GetZoneName(pp->zone_id); - if(zname == NULL) { + if(zname == nullptr) { //zone not in the DB, something to prevent crash... strn0cpy(zone, "qeynos", 49); pp->zone_id = 1; @@ -1184,7 +1184,7 @@ bool Database::GetSafePoints(const char* short_name, uint32 version, float* safe *minstatus = atoi(row[3]); if (minlevel != 0) *minlevel = atoi(row[4]); - if (flag_needed != NULL) + if (flag_needed != nullptr) strcpy(flag_needed, row[5]); mysql_free_result(result); return true; @@ -1196,9 +1196,9 @@ bool Database::GetSafePoints(const char* short_name, uint32 version, float* safe { cerr << "Error in GetSafePoint query '" << query << "' " << errbuf << endl; cerr << "If it errors, run the following querys:\n"; - cerr << "ALTER TABLE `zone` CHANGE `minium_level` `min_level` TINYINT(3) UNSIGNED DEFAULT \"0\" NOT NULL;\n"; - cerr << "ALTER TABLE `zone` CHANGE `minium_status` `min_status` TINYINT(3) UNSIGNED DEFAULT \"0\" NOT NULL;\n"; - cerr << "ALTER TABLE `zone` ADD flag_needed VARCHAR(128) NOT NULL DEFAULT '';\n"; + cerr << "ALTER TABLE `zone` CHANGE `minium_level` `min_level` TINYINT(3) UNSIGNED DEFAULT \"0\" NOT nullptr;\n"; + cerr << "ALTER TABLE `zone` CHANGE `minium_status` `min_status` TINYINT(3) UNSIGNED DEFAULT \"0\" NOT nullptr;\n"; + cerr << "ALTER TABLE `zone` ADD flag_needed VARCHAR(128) NOT nullptr DEFAULT '';\n"; safe_delete_array(query); } @@ -1682,7 +1682,7 @@ bool Database::MoveCharacterToZone(const char* charname, const char* zonename,ui char *query = 0; uint32 affected_rows = 0; - if(zonename == NULL || strlen(zonename) == 0) + if(zonename == nullptr || strlen(zonename) == 0) return(false); if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE character_ SET zonename = '%s',zoneid=%i,x=-1, y=-1, z=-1 WHERE name='%s'", zonename,zoneid, charname), errbuf, 0,&affected_rows)) { @@ -2113,7 +2113,7 @@ char *Database::GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* mainta row = mysql_fetch_row(result); unsigned long* Lengths = mysql_fetch_lengths(result); - if(row != NULL){ + if(row != nullptr){ if(leaderbuf) strcpy(leaderbuf, row[0]); @@ -2178,7 +2178,7 @@ MYSQL_ROW row; unsigned long num_fields,i; bool retval=false; rowmap.clear(); - if (result && (num_fields=mysql_num_fields(result)) && (row = mysql_fetch_row(result))!=NULL && (fields = mysql_fetch_fields(result))!=NULL) { + if (result && (num_fields=mysql_num_fields(result)) && (row = mysql_fetch_row(result))!=nullptr && (fields = mysql_fetch_fields(result))!=nullptr) { retval=true; for(i=0;i 0) { row = mysql_fetch_row(result); - while(row != NULL) + while(row != nullptr) { id = atoi(row[0]); DeleteInstance(id); @@ -2895,7 +2895,7 @@ void Database::AssignGroupToInstance(uint32 gid, uint32 instance_id) errbuf, &result)) { safe_delete_array(query); - while((row = mysql_fetch_row(result)) != NULL) + while((row = mysql_fetch_row(result)) != nullptr) { uint32 charid = atoi(row[0]); if(GetInstanceID(zone_id, charid, version) == 0) @@ -2924,7 +2924,7 @@ void Database::AssignRaidToInstance(uint32 rid, uint32 instance_id) errbuf, &result)) { safe_delete_array(query); - while((row = mysql_fetch_row(result)) != NULL) + while((row = mysql_fetch_row(result)) != nullptr) { uint32 charid = atoi(row[0]); if(GetInstanceID(zone_id, charid, version) == 0) @@ -3100,7 +3100,7 @@ void Database::UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win) } if(RunQuery(query, MakeAnyLenString(&query, "UPDATE `adventure_stats` SET %s=%s+1 WHERE player_id=%u", - field.c_str(), field.c_str(), char_id), errbuf, NULL, &affected)) + field.c_str(), field.c_str(), char_id), errbuf, nullptr, &affected)) { safe_delete_array(query); } @@ -3138,7 +3138,7 @@ bool Database::GetAdventureStats(uint32 char_id, uint32 &guk_w, uint32 &mir_w, u char_id), errbuf, &result)) { safe_delete_array(query); - while((row = mysql_fetch_row(result)) != NULL) + while((row = mysql_fetch_row(result)) != nullptr) { guk_w = atoi(row[0]); mir_w = atoi(row[1]); diff --git a/common/database.h b/common/database.h index ba194610c..f494484e0 100644 --- a/common/database.h +++ b/common/database.h @@ -38,7 +38,7 @@ using namespace std; //atoi is not uint32 or uint32 safe!!!! -#define atoul(str) strtoul(str, NULL, 10) +#define atoul(str) strtoul(str, nullptr, 10) //class Spawn; class Corpse; @@ -204,8 +204,8 @@ public: char* GetGroupLeaderForLogin(const char* name,char* leaderbuf); void SetGroupLeaderName(uint32 gid, const char* name); - char* GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank = NULL, char* assist = NULL, char* puller = NULL, char *marknpc = NULL, - GroupLeadershipAA_Struct* GLAA = NULL); + char* GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, + GroupLeadershipAA_Struct* GLAA = nullptr); void ClearGroupLeader(uint32 gid = 0); /* @@ -236,8 +236,8 @@ public: uint8 GetPEQZone(uint32 zoneID, uint32 version); const char* GetZoneName(uint32 zoneID, bool ErrorUnknown = false); uint8 GetServerType(); - bool GetSafePoints(const char* short_name, uint32 version, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, int16* minstatus = 0, uint8* minlevel = 0, char *flag_needed = NULL); - bool GetSafePoints(uint32 zoneID, uint32 version, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, int16* minstatus = 0, uint8* minlevel = 0, char *flag_needed = NULL) { return GetSafePoints(GetZoneName(zoneID), version, safe_x, safe_y, safe_z, minstatus, minlevel, flag_needed); } + bool GetSafePoints(const char* short_name, uint32 version, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, int16* minstatus = 0, uint8* minlevel = 0, char *flag_needed = nullptr); + bool GetSafePoints(uint32 zoneID, uint32 version, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, int16* minstatus = 0, uint8* minlevel = 0, char *flag_needed = nullptr) { return GetSafePoints(GetZoneName(zoneID), version, safe_x, safe_y, safe_z, minstatus, minlevel, flag_needed); } uint8 GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level); uint8 GetRaceSkill(uint8 skillid, uint8 in_race); bool LoadPTimers(uint32 charid, PTimerList &into); diff --git a/common/dbasync.cpp b/common/dbasync.cpp index 88afa3cd9..31e956180 100644 --- a/common/dbasync.cpp +++ b/common/dbasync.cpp @@ -65,7 +65,7 @@ ThreadReturnType DBAsyncLoop(void* tmp) { _log(COMMON__THREADS, "Ending DBAsyncLoop with thread ID %d", pthread_self()); #endif - THREAD_RETURN(NULL); + THREAD_RETURN(nullptr); } DBAsync::DBAsync(DBcore* iDBC) @@ -78,7 +78,7 @@ DBAsync::DBAsync(DBcore* iDBC) _beginthread(DBAsyncLoop, 0, this); #else pthread_t thread; - pthread_create(&thread, NULL, DBAsyncLoop, this); + pthread_create(&thread, nullptr, DBAsyncLoop, this); #endif } diff --git a/common/debug.cpp b/common/debug.cpp index 7a872a2fc..ebeed542f 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -45,9 +45,9 @@ EQEMuLog::EQEMuLog() { #else pLogStatus[i] = 0; #endif - logCallbackFmt[i] = NULL; - logCallbackBuf[i] = NULL; - logCallbackPva[i] = NULL; + logCallbackFmt[i] = nullptr; + logCallbackBuf[i] = nullptr; + logCallbackPva[i] = nullptr; } // TODO: Make this read from an ini or something, everyone has different opinions on what it should be #if EQDEBUG < 2 diff --git a/common/eqtime.h b/common/eqtime.h index d0dcbcfa3..5a60db27f 100644 --- a/common/eqtime.h +++ b/common/eqtime.h @@ -23,7 +23,7 @@ public: ~EQTime(); //Get functions - int getEQTimeOfDay( TimeOfDay_Struct *eqTimeOfDay ) { return(getEQTimeOfDay(time(NULL), eqTimeOfDay)); } + int getEQTimeOfDay( TimeOfDay_Struct *eqTimeOfDay ) { return(getEQTimeOfDay(time(nullptr), eqTimeOfDay)); } int getEQTimeOfDay( time_t timeConvert, TimeOfDay_Struct *eqTimeOfDay ); TimeOfDay_Struct getStartEQTime() { return eqTime.start_eqtime; } time_t getStartRealTime() { return eqTime.start_realtime; } diff --git a/common/extprofile.cpp b/common/extprofile.cpp index 0445eccdd..d4793873c 100644 --- a/common/extprofile.cpp +++ b/common/extprofile.cpp @@ -26,7 +26,7 @@ void InitExtendedProfile(ExtendedProfile_Struct *p) { } bool SetExtendedProfile(ExtendedProfile_Struct *to, char *old, unsigned int len) { - if(len == 0 || old == NULL) { + if(len == 0 || old == nullptr) { //handle old chars without an extended profile... InitExtendedProfile(to); return(true); diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 5bc2e589a..7a97adeba 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -31,7 +31,7 @@ const char *const BaseGuildManager::GuildActionNames[_MaxGuildAction] = { "HearGuildChat", "SpeakGuildChat", "Invite", "Remove", "Promote", "Demote", "Set_MOTD", "War/Peace" }; BaseGuildManager::BaseGuildManager() -: m_db(NULL) +: m_db(nullptr) { } @@ -43,7 +43,7 @@ bool BaseGuildManager::LoadGuilds() { ClearGuilds(); - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested to load guilds when we have no database object."); return(false); } @@ -107,7 +107,7 @@ bool BaseGuildManager::LoadGuilds() { } bool BaseGuildManager::RefreshGuild(uint32 guild_id) { - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested to refresh guild %d when we have no database object.", guild_id); return(false); } @@ -217,7 +217,7 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con } bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested to store guild %d when we have no database object.", guild_id); return(false); } @@ -310,7 +310,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { } uint32 BaseGuildManager::_GetFreeGuildID() { - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested find a free guild ID when we have no database object."); return(GUILD_NONE); } @@ -523,7 +523,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { m_guilds.erase(res); } - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested to delete guild %d when we have no database object.", guild_id); return(false); } @@ -552,7 +552,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { } bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested to rename guild %d when we have no database object.", guild_id); return(false); } @@ -592,7 +592,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { } bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested to set the leader for guild %d when we have no database object.", guild_id); return(false); } @@ -632,7 +632,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { } bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) { - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); return(false); } @@ -679,7 +679,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL) { - if(m_db == NULL) + if(m_db == nullptr) return(false); map::const_iterator res; @@ -720,7 +720,7 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL) bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) { - if(m_db == NULL) + if(m_db == nullptr) return(false); map::const_iterator res; @@ -760,7 +760,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) } bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested to set char to guild %d when we have no database object.", guild_id); return(false); } @@ -891,7 +891,7 @@ bool BaseGuildManager::DBSetTributeFlag(uint32 charid, bool enabled) { } bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) { - if(m_db == NULL) + if(m_db == nullptr) return(false); char errbuf[MYSQL_ERRMSG_SIZE]; @@ -921,7 +921,7 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) { } bool BaseGuildManager::_RunQuery(char *&query, int len, const char *errmsg) { - if(m_db == NULL) + if(m_db == nullptr) return(false); char errbuf[MYSQL_ERRMSG_SIZE]; @@ -981,7 +981,7 @@ static void ProcessGuildMember(MYSQL_ROW &row, CharGuildInfo &into) { bool BaseGuildManager::GetEntireGuild(uint32 guild_id, vector &members) { members.clear(); - if(m_db == NULL) + if(m_db == nullptr) return(false); char errbuf[MYSQL_ERRMSG_SIZE]; @@ -1012,7 +1012,7 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, vector & } bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested char info on %s when we have no database object.", char_name); return(false); } @@ -1054,7 +1054,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { } bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { - if(m_db == NULL) { + if(m_db == nullptr) { _log(GUILDS__DB, "Requested char info on %d when we have no database object.", char_id); return(false); } diff --git a/common/ipc_mutex.cpp b/common/ipc_mutex.cpp index 80a583ea8..8b83d54ca 100644 --- a/common/ipc_mutex.cpp +++ b/common/ipc_mutex.cpp @@ -44,7 +44,7 @@ namespace EQEmu { std::string final_name = "EQEmuMutex_"; final_name += name; - imp_->mut_ = CreateMutex(NULL, + imp_->mut_ = CreateMutex(nullptr, FALSE, final_name.c_str()); diff --git a/common/logsys.cpp b/common/logsys.cpp index ee5c8c06c..a7cd2d698 100644 --- a/common/logsys.cpp +++ b/common/logsys.cpp @@ -88,11 +88,11 @@ void log_toggle(LogType t) { bool load_log_settings(const char *filename) { //this is a terrible algorithm, but im lazy today FILE *f = fopen(filename, "r"); - if(f == NULL) + if(f == nullptr) return(false); char linebuf[512], type_name[256], value[256]; while(!feof(f)) { - if(fgets(linebuf, 512, f) == NULL) + if(fgets(linebuf, 512, f) == nullptr) continue; #ifdef _WINDOWS if (sscanf(linebuf, "%[^=]=%[^\n]\n", type_name, value) != 2) diff --git a/common/memory_mapped_file.cpp b/common/memory_mapped_file.cpp index e78cf2676..ca2ae0c6d 100644 --- a/common/memory_mapped_file.cpp +++ b/common/memory_mapped_file.cpp @@ -49,17 +49,17 @@ namespace EQEmu { HANDLE file = CreateFile(filename.c_str(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, + nullptr, OPEN_ALWAYS, 0, - NULL); + nullptr); if(file == INVALID_HANDLE_VALUE) { EQ_EXCEPT("Shared Memory", "Could not open a file for this shared memory segment."); } imp_->mapped_object_ = CreateFileMapping(file, - NULL, + nullptr, PAGE_READWRITE, 0, total_size, @@ -91,7 +91,7 @@ namespace EQEmu { } memory_ = reinterpret_cast( - mmap(NULL, total_size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, imp_->fd_, 0)); + mmap(nullptr, total_size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, imp_->fd_, 0)); if(memory_ == MAP_FAILED) { EQ_EXCEPT("Shared Memory", "Could not create a file mapping for this shared memory file."); @@ -118,17 +118,17 @@ namespace EQEmu { HANDLE file = CreateFile(filename.c_str(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, + nullptr, OPEN_ALWAYS, 0, - NULL); + nullptr); if(file == INVALID_HANDLE_VALUE) { EQ_EXCEPT("Shared Memory", "Could not open a file for this shared memory segment."); } imp_->mapped_object_ = CreateFileMapping(file, - NULL, + nullptr, PAGE_READWRITE, 0, total_size, @@ -160,7 +160,7 @@ namespace EQEmu { } memory_ = reinterpret_cast( - mmap(NULL, total_size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, imp_->fd_, 0)); + mmap(nullptr, total_size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, imp_->fd_, 0)); if(memory_ == MAP_FAILED) { EQ_EXCEPT("Shared Memory", "Could not create a file mapping for this shared memory file."); diff --git a/common/misc.cpp b/common/misc.cpp index 4220afcab..1bcfd90c9 100644 --- a/common/misc.cpp +++ b/common/misc.cpp @@ -41,7 +41,7 @@ int print_stacktrace() if (n != 0) { char **names = backtrace_symbols (ba, n); - if (names != NULL) + if (names != nullptr) { int i; cerr << "called from " << (char*)names[0] << endl; @@ -82,9 +82,9 @@ bool ItemParse(const char *data, int length, map > &items, i int i; char *end,*ptr; map field; -static char *buffer=NULL; +static char *buffer=nullptr; static int buffsize=0; -static char *temp=NULL; +static char *temp=nullptr; if (!buffsize || buffsize<(length+1)) { buffer=(char *)realloc(buffer,length+1); temp=(char *)realloc(temp,length+1); @@ -97,7 +97,7 @@ static char *temp=NULL; for(i=0;ipBuffer; Track_Struct *emu = (Track_Struct *) __emu_buffer; @@ -407,7 +407,7 @@ ENCODE(OP_ZoneEntry){ ENCODE_FORWARD(OP_ZoneSpawns); } ENCODE(OP_ZoneSpawns) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -502,7 +502,7 @@ ENCODE(OP_ItemLinkResponse) { ENCODE_FORWARD(OP_ItemPacket); } ENCODE(OP_ItemPacket) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -531,7 +531,7 @@ ENCODE(OP_ItemPacket) { ENCODE(OP_CharInventory) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -570,7 +570,7 @@ ENCODE(OP_CharInventory) { ENCODE(OP_GuildMemberList) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -660,7 +660,7 @@ ENCODE(OP_GuildMemberList) { ENCODE(OP_ReadBook) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; @@ -709,7 +709,7 @@ ENCODE(OP_Illusion) { ENCODE(OP_BazaarSearch) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *Buffer = (char *)in->pBuffer; @@ -949,10 +949,10 @@ DECODE(OP_FaceChange) { } char *SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth) { - char *serialization = NULL; - char *instance = NULL; + char *serialization = nullptr; + char *instance = nullptr; const char *protection=(const char *)"\\\\\\\\\\"; - char *sub_items[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; + char *sub_items[10] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; bool stackable=inst->IsStackable(); uint32 merchant_slot=inst->GetMerchantSlot(); int16 charges=inst->GetCharges(); diff --git a/common/patches/RoF.cpp b/common/patches/RoF.cpp index 72403850f..0f62d1081 100644 --- a/common/patches/RoF.cpp +++ b/common/patches/RoF.cpp @@ -18,14 +18,14 @@ namespace RoF { static const char *name = "RoF"; -static OpcodeManager *opcodes = NULL; +static OpcodeManager *opcodes = nullptr; static Strategy struct_strategy; char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth); void Register(EQStreamIdentifier &into) { //create our opcode manager if we havent already - if(opcodes == NULL) { + if(opcodes == nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -69,7 +69,7 @@ void Reload() { //opcode managers because we need to change the manager pointer, which means //we need to go to every stream and replace it's manager. - if(opcodes != NULL) { + if(opcodes != nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -403,7 +403,7 @@ static inline structs::MainInvItemSlotStruct MainInvTitaniumToRoFSlot(uint32 Tit ENCODE(OP_TaskHistoryReply) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; // First we need to calculate the length of the new packet in->SetReadPosition(4); @@ -522,7 +522,7 @@ ENCODE(OP_TaskHistoryReply) ENCODE(OP_TaskDescription) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; EQApplicationPacket *outapp = new EQApplicationPacket(OP_TaskDescription, in->size + 1); // Set the Write pointer as we don't know what has been done with the packet before we get it. @@ -539,7 +539,7 @@ ENCODE(OP_TaskDescription) outapp->WriteUInt32(in->ReadUInt32()); // Duration outapp->WriteUInt32(in->ReadUInt32()); // Unknown uint32 StartTime = in->ReadUInt32(); - outapp->WriteUInt32(time(NULL) - StartTime); // RoF has elapsed time here rather than starttime + outapp->WriteUInt32(time(nullptr) - StartTime); // RoF has elapsed time here rather than starttime // Copy the rest of the packet verbatim uint32 BytesLeftToCopy = in->size - in->GetReadPosition(); @@ -564,7 +564,7 @@ ENCODE(OP_OpenNewTasksWindow) { structs::AvailableTaskTrailer_Struct* __eq_AvailableTaskTrailer; EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; @@ -847,7 +847,7 @@ ENCODE(OP_LeadershipExpUpdate) { ENCODE(OP_PlayerProfile) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; PlayerProfile_Struct *emu = (PlayerProfile_Struct *) __emu_buffer; @@ -1631,7 +1631,7 @@ ENCODE(OP_NewZone) { ENCODE(OP_Track) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; Track_Struct *emu = (Track_Struct *) __emu_buffer; @@ -1709,7 +1709,7 @@ ENCODE(OP_PetBuffWindow) ENCODE(OP_Barter) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *Buffer = (char *)in->pBuffer; @@ -1750,7 +1750,7 @@ ENCODE(OP_Barter) ENCODE(OP_BazaarSearch) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *Buffer = (char *)in->pBuffer; @@ -1807,7 +1807,7 @@ ENCODE(OP_ZoneSpawns) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -2074,7 +2074,7 @@ ENCODE(OP_ZoneSpawns) ENCODE(OP_MercenaryDataResponse) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -2138,7 +2138,7 @@ ENCODE(OP_MercenaryDataResponse) { ENCODE(OP_MercenaryDataUpdate) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -2218,7 +2218,7 @@ ENCODE(OP_ItemLinkResponse) { ENCODE_FORWARD(OP_ItemPacket); } ENCODE(OP_ItemPacket) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer; @@ -2247,7 +2247,7 @@ ENCODE(OP_CharInventory) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; if(in->size == 0) { @@ -2325,7 +2325,7 @@ ENCODE(OP_CharInventory) { ENCODE(OP_GuildMemberList) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -2456,7 +2456,7 @@ ENCODE(OP_GroundSpawn) // We are not encoding the spawn_id field here, but it doesn't appear to matter. // EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; Object_Struct *emu = (Object_Struct *) in->pBuffer; @@ -2782,7 +2782,7 @@ ENCODE(OP_Buff) { eq->bufffade = 2; // Bit of a hack. OP_Buff appears to add/remove the buff while OP_BuffCreate adds/removes the actual buff icon - EQApplicationPacket *outapp = NULL; + EQApplicationPacket *outapp = nullptr; if(eq->bufffade == 1) { outapp = new EQApplicationPacket(OP_BuffCreate, 29); @@ -3086,7 +3086,7 @@ ENCODE(OP_AdventureMerchantSell) { ENCODE(OP_RaidUpdate) { EQApplicationPacket *inapp = *p; - *p = NULL; + *p = nullptr; unsigned char * __emu_buffer = inapp->pBuffer; RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer; @@ -3150,7 +3150,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); - *p = NULL; + *p = nullptr; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -3181,7 +3181,7 @@ ENCODE(OP_VetRewardsAvaliable) ENCODE(OP_WhoAllResponse) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *InBuffer = (char *)in->pBuffer; @@ -3481,7 +3481,7 @@ ENCODE(OP_GroupUpdate) ENCODE(OP_ChannelMessage) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; ChannelMessage_Struct *emu = (ChannelMessage_Struct *) in->pBuffer; @@ -3517,7 +3517,7 @@ ENCODE(OP_ChannelMessage) ENCODE(OP_GuildsList) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; uint32 NumberOfGuilds = in->size / 64; @@ -3768,7 +3768,7 @@ ENCODE(OP_WearChange) ENCODE(OP_SpawnAppearance) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *emu_buffer = in->pBuffer; @@ -3872,7 +3872,7 @@ ENCODE(OP_AltCurrencySell) ENCODE(OP_AltCurrency) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *emu_buffer = in->pBuffer; uint32 opcode = *((uint32*)emu_buffer); @@ -5307,7 +5307,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint for(int x = 0; x < 10; ++x) { - SubSerializations[x] = NULL; + SubSerializations[x] = nullptr; const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x); diff --git a/common/patches/SSDefine.h b/common/patches/SSDefine.h index 497fdc329..ea301e0de 100644 --- a/common/patches/SSDefine.h +++ b/common/patches/SSDefine.h @@ -18,7 +18,7 @@ #define FASTQUEUE(packet) dest->FastQueuePacket(&packet, ack_req); #define TAKE(packet_name) \ EQApplicationPacket *packet_name = *p; \ - *p = NULL; + *p = nullptr; //simple buffer-to-buffer movement for fixed length packets //the eq packet is mapped into `eq`, the emu packet into `emu` @@ -29,7 +29,7 @@ //like a direct encode, but for variable length packets (two stage) #define SETUP_VAR_ENCODE(emu_struct) \ EQApplicationPacket *__packet = *p; \ - *p = NULL; \ + *p = nullptr; \ unsigned char *__emu_buffer = __packet->pBuffer; \ emu_struct *emu = (emu_struct *) __emu_buffer; \ uint32 __i = 0; \ @@ -67,7 +67,7 @@ _log(NET__STRUCTS, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ - *p = NULL; \ + *p = nullptr; \ return; \ } #define ENCODE_LENGTH_ATLEAST(struct_) \ @@ -75,7 +75,7 @@ _log(NET__STRUCTS, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ - *p = NULL; \ + *p = nullptr; \ return; \ } @@ -87,7 +87,7 @@ #define EAT_ENCODE(op) \ ENCODE(op) { \ delete *p; \ - *p = NULL; \ + *p = nullptr; \ } diff --git a/common/patches/SoD.cpp b/common/patches/SoD.cpp index 9e272a14c..7cbeae210 100644 --- a/common/patches/SoD.cpp +++ b/common/patches/SoD.cpp @@ -18,14 +18,14 @@ namespace SoD { static const char *name = "SoD"; -static OpcodeManager *opcodes = NULL; +static OpcodeManager *opcodes = nullptr; static Strategy struct_strategy; char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth); void Register(EQStreamIdentifier &into) { //create our opcode manager if we havent already - if(opcodes == NULL) { + if(opcodes == nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -69,7 +69,7 @@ void Reload() { //opcode managers because we need to change the manager pointer, which means //we need to go to every stream and replace it's manager. - if(opcodes != NULL) { + if(opcodes != nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -185,7 +185,7 @@ ENCODE(OP_OpenNewTasksWindow) { structs::AvailableTaskTrailer_Struct* __eq_AvailableTaskTrailer; EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; @@ -749,7 +749,7 @@ ENCODE(OP_NewZone) { ENCODE(OP_Track) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; Track_Struct *emu = (Track_Struct *) __emu_buffer; @@ -795,7 +795,7 @@ ENCODE(OP_Track) ENCODE(OP_PetBuffWindow) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; @@ -832,7 +832,7 @@ ENCODE(OP_PetBuffWindow) ENCODE(OP_Barter) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *Buffer = (char *)in->pBuffer; @@ -889,7 +889,7 @@ DECODE(OP_InspectRequest) { ENCODE(OP_BazaarSearch) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *Buffer = (char *)in->pBuffer; @@ -945,7 +945,7 @@ ENCODE(OP_ZoneEntry){ ENCODE_FORWARD(OP_ZoneSpawns); } ENCODE(OP_ZoneSpawns) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1261,7 +1261,7 @@ ENCODE(OP_ZoneSpawns) { ENCODE(OP_MercenaryDataResponse) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1328,7 +1328,7 @@ ENCODE(OP_MercenaryDataResponse) { ENCODE(OP_MercenaryDataUpdate) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1399,7 +1399,7 @@ ENCODE(OP_ItemLinkResponse) { ENCODE_FORWARD(OP_ItemPacket); } ENCODE(OP_ItemPacket) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer; @@ -1428,7 +1428,7 @@ ENCODE(OP_CharInventory) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; if(in->size == 0) { @@ -1506,7 +1506,7 @@ ENCODE(OP_CharInventory) { ENCODE(OP_GuildMemberList) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1875,7 +1875,7 @@ ENCODE(OP_Trader) { if((*p)->size != sizeof(TraderBuy_Struct)) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; dest->FastQueuePacket(&in, ack_req); return; } @@ -2033,7 +2033,7 @@ ENCODE(OP_AdventureMerchantSell) { ENCODE(OP_RaidUpdate) { EQApplicationPacket *inapp = *p; - *p = NULL; + *p = nullptr; unsigned char * __emu_buffer = inapp->pBuffer; RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer; @@ -2097,7 +2097,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); - *p = NULL; + *p = nullptr; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -2128,7 +2128,7 @@ ENCODE(OP_VetRewardsAvaliable) ENCODE(OP_WhoAllResponse) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *InBuffer = (char *)in->pBuffer; @@ -3453,7 +3453,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint for(int x = 0; x < 10; ++x) { - SubSerializations[x] = NULL; + SubSerializations[x] = nullptr; const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x); diff --git a/common/patches/SoF.cpp b/common/patches/SoF.cpp index 873f3f19d..823f62d11 100644 --- a/common/patches/SoF.cpp +++ b/common/patches/SoF.cpp @@ -18,14 +18,14 @@ namespace SoF { static const char *name = "SoF"; -static OpcodeManager *opcodes = NULL; +static OpcodeManager *opcodes = nullptr; static Strategy struct_strategy; char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth); void Register(EQStreamIdentifier &into) { //create our opcode manager if we havent already - if(opcodes == NULL) { + if(opcodes == nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -69,7 +69,7 @@ void Reload() { //opcode managers because we need to change the manager pointer, which means //we need to go to every stream and replace it's manager. - if(opcodes != NULL) { + if(opcodes != nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -185,7 +185,7 @@ ENCODE(OP_OpenNewTasksWindow) { structs::AvailableTaskTrailer_Struct* __eq_AvailableTaskTrailer; EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; @@ -748,7 +748,7 @@ ENCODE(OP_NewZone) { ENCODE(OP_Track) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; Track_Struct *emu = (Track_Struct *) __emu_buffer; @@ -783,7 +783,7 @@ ENCODE(OP_ZoneEntry){ ENCODE_FORWARD(OP_ZoneSpawns); } ENCODE(OP_ZoneSpawns) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -903,7 +903,7 @@ ENCODE(OP_ZoneSpawns) { uint32 ofs; uint32 val; uint8 rnd = rand() & 0x0F; - if (sep == NULL) + if (sep == nullptr) { ofs = 0; if ((emu->lastName[2] < '0') || (emu->lastName[2] > '9')) @@ -917,7 +917,7 @@ ENCODE(OP_ZoneSpawns) { } else { - sep[0] = NULL; + sep[0] = nullptr; ofs = atoi(&emu->lastName[2]); sep[0] = '='; if ((sep[1] < '0') || (sep[1] > '9')) @@ -1012,7 +1012,7 @@ ENCODE(OP_ItemLinkResponse) { ENCODE_FORWARD(OP_ItemPacket); } ENCODE(OP_ItemPacket) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer; @@ -1041,7 +1041,7 @@ ENCODE(OP_CharInventory) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; if(in->size == 0) { @@ -1119,7 +1119,7 @@ ENCODE(OP_CharInventory) { ENCODE(OP_GuildMemberList) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1460,14 +1460,14 @@ ENCODE(OP_BazaarSearch) { if(((*p)->size == sizeof(BazaarReturnDone_Struct)) || ((*p)->size == sizeof(BazaarWelcome_Struct))) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; dest->FastQueuePacket(&in, ack_req); return; } //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1513,7 +1513,7 @@ ENCODE(OP_Trader) { if((*p)->size != sizeof(TraderBuy_Struct)) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; dest->FastQueuePacket(&in, ack_req); return; } @@ -1671,7 +1671,7 @@ ENCODE(OP_AdventureMerchantSell) { ENCODE(OP_RaidUpdate) { EQApplicationPacket *inapp = *p; - *p = NULL; + *p = nullptr; unsigned char * __emu_buffer = inapp->pBuffer; RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer; @@ -1735,7 +1735,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); - *p = NULL; + *p = nullptr; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -2772,7 +2772,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint for(int x = 0; x < 10; ++x) { - SubSerializations[x] = NULL; + SubSerializations[x] = nullptr; const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x); diff --git a/common/patches/Titanium.cpp b/common/patches/Titanium.cpp index 8f4624bed..bfc88040d 100644 --- a/common/patches/Titanium.cpp +++ b/common/patches/Titanium.cpp @@ -16,14 +16,14 @@ namespace Titanium { static const char *name = "Titanium"; -static OpcodeManager *opcodes = NULL; +static OpcodeManager *opcodes = nullptr; static Strategy struct_strategy; char *SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth); void Register(EQStreamIdentifier &into) { //create our opcode manager if we havent already - if(opcodes == NULL) { + if(opcodes == nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -67,7 +67,7 @@ void Reload() { //opcode managers because we need to change the manager pointer, which means //we need to go to every stream and replace it's manager. - if(opcodes != NULL) { + if(opcodes != nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -422,7 +422,7 @@ ENCODE(OP_Track) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; Track_Struct *emu = (Track_Struct *) __emu_buffer; @@ -457,7 +457,7 @@ ENCODE(OP_ZoneEntry){ ENCODE_FORWARD(OP_ZoneSpawns); } ENCODE(OP_ZoneSpawns) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -594,7 +594,7 @@ ENCODE(OP_ItemLinkResponse) { ENCODE_FORWARD(OP_ItemPacket); } ENCODE(OP_ItemPacket) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -624,7 +624,7 @@ ENCODE(OP_ItemPacket) { ENCODE(OP_CharInventory) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -666,14 +666,14 @@ ENCODE(OP_BazaarSearch) { if(((*p)->size == sizeof(BazaarReturnDone_Struct)) || ((*p)->size == sizeof(BazaarWelcome_Struct))) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; dest->FastQueuePacket(&in, ack_req); return; } //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -719,7 +719,7 @@ ENCODE(OP_Trader) { if((*p)->size != sizeof(TraderBuy_Struct)) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; dest->FastQueuePacket(&in, ack_req); return; } @@ -745,7 +745,7 @@ ENCODE(OP_TraderBuy) { ENCODE(OP_GuildMemberList) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -839,7 +839,7 @@ ENCODE(OP_GuildMemberList) { ENCODE(OP_ReadBook) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; @@ -898,7 +898,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); - *p = NULL; + *p = nullptr; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -1212,7 +1212,7 @@ DECODE(OP_InspectAnswer) { ENCODE(OP_LFGuild) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; uint32 Command = in->ReadUInt32(); @@ -1367,10 +1367,10 @@ DECODE(OP_LFGuild) } char *SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth) { - char *serialization = NULL; - char *instance = NULL; + char *serialization = nullptr; + char *instance = nullptr; const char *protection=(const char *)"\\\\\\\\\\"; - char *sub_items[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; + char *sub_items[10] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; bool stackable=inst->IsStackable(); uint32 merchant_slot=inst->GetMerchantSlot(); int16 charges=inst->GetCharges(); diff --git a/common/patches/Underfoot.cpp b/common/patches/Underfoot.cpp index d56a21d3b..44c65cc8b 100644 --- a/common/patches/Underfoot.cpp +++ b/common/patches/Underfoot.cpp @@ -19,14 +19,14 @@ namespace Underfoot { static const char *name = "Underfoot"; -static OpcodeManager *opcodes = NULL; +static OpcodeManager *opcodes = nullptr; static Strategy struct_strategy; char* SerializeItem(const ItemInst *inst, int16 slot_id, uint32 *length, uint8 depth); void Register(EQStreamIdentifier &into) { //create our opcode manager if we havent already - if(opcodes == NULL) { + if(opcodes == nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -70,7 +70,7 @@ void Reload() { //opcode managers because we need to change the manager pointer, which means //we need to go to every stream and replace it's manager. - if(opcodes != NULL) { + if(opcodes != nullptr) { //TODO: get this file name from the config file string opfile = "patch_"; opfile += name; @@ -186,7 +186,7 @@ ENCODE(OP_OpenNewTasksWindow) { structs::AvailableTaskTrailer_Struct* __eq_AvailableTaskTrailer; EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; @@ -775,7 +775,7 @@ ENCODE(OP_NewZone) { ENCODE(OP_Track) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; Track_Struct *emu = (Track_Struct *) __emu_buffer; @@ -821,7 +821,7 @@ ENCODE(OP_Track) ENCODE(OP_PetBuffWindow) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; @@ -860,7 +860,7 @@ ENCODE(OP_PetBuffWindow) ENCODE(OP_Barter) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *Buffer = (char *)in->pBuffer; @@ -901,7 +901,7 @@ ENCODE(OP_Barter) ENCODE(OP_BazaarSearch) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *Buffer = (char *)in->pBuffer; @@ -957,7 +957,7 @@ ENCODE(OP_ZoneEntry){ ENCODE_FORWARD(OP_ZoneSpawns); } ENCODE(OP_ZoneSpawns) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1272,7 +1272,7 @@ ENCODE(OP_ZoneSpawns) { ENCODE(OP_MercenaryDataResponse) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1335,7 +1335,7 @@ ENCODE(OP_MercenaryDataResponse) { ENCODE(OP_MercenaryDataUpdate) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1411,7 +1411,7 @@ ENCODE(OP_ItemLinkResponse) { ENCODE_FORWARD(OP_ItemPacket); } ENCODE(OP_ItemPacket) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *__emu_buffer = in->pBuffer; ItemPacket_Struct *old_item_pkt=(ItemPacket_Struct *)__emu_buffer; @@ -1440,7 +1440,7 @@ ENCODE(OP_CharInventory) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; if(in->size == 0) { @@ -1518,7 +1518,7 @@ ENCODE(OP_CharInventory) { ENCODE(OP_GuildMemberList) { //consume the packet EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; //store away the emu struct unsigned char *__emu_buffer = in->pBuffer; @@ -1646,7 +1646,7 @@ ENCODE(OP_GroundSpawn) // We are not encoding the spawn_id field here, or a size but it doesn't appear to matter. // EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; Object_Struct *emu = (Object_Struct *) in->pBuffer; @@ -1935,7 +1935,7 @@ ENCODE(OP_Trader) { if((*p)->size != sizeof(TraderBuy_Struct)) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; dest->FastQueuePacket(&in, ack_req); return; } @@ -2093,7 +2093,7 @@ ENCODE(OP_AdventureMerchantSell) { ENCODE(OP_RaidUpdate) { EQApplicationPacket *inapp = *p; - *p = NULL; + *p = nullptr; unsigned char * __emu_buffer = inapp->pBuffer; RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer; @@ -2157,7 +2157,7 @@ ENCODE(OP_VetRewardsAvaliable) unsigned char * __emu_buffer = inapp->pBuffer; uint32 count = ((*p)->Size() / sizeof(InternalVeteranReward)); - *p = NULL; + *p = nullptr; EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_VetRewardsAvaliable, (sizeof(structs::VeteranReward)*count)); uchar *old_data = __emu_buffer; @@ -2188,7 +2188,7 @@ ENCODE(OP_VetRewardsAvaliable) ENCODE(OP_WhoAllResponse) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; char *InBuffer = (char *)in->pBuffer; @@ -2438,7 +2438,7 @@ ENCODE(OP_GroupUpdate) ENCODE(OP_ChannelMessage) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; ChannelMessage_Struct *emu = (ChannelMessage_Struct *) in->pBuffer; @@ -2474,7 +2474,7 @@ ENCODE(OP_ChannelMessage) ENCODE(OP_GuildsList) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; uint32 NumberOfGuilds = in->size / 64; @@ -2742,7 +2742,7 @@ ENCODE(OP_WearChange) ENCODE(OP_SpawnAppearance) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *emu_buffer = in->pBuffer; @@ -2793,7 +2793,7 @@ ENCODE(OP_AltCurrencySell) ENCODE(OP_AltCurrency) { EQApplicationPacket *in = *p; - *p = NULL; + *p = nullptr; unsigned char *emu_buffer = in->pBuffer; uint32 opcode = *((uint32*)emu_buffer); @@ -3881,7 +3881,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint for(int x = 0; x < 10; ++x) { - SubSerializations[x] = NULL; + SubSerializations[x] = nullptr; const ItemInst* subitem = ((const ItemInst*)inst)->GetItem(x); diff --git a/common/perl_EQDB.cpp b/common/perl_EQDB.cpp index 0c653d666..35417b4a7 100644 --- a/common/perl_EQDB.cpp +++ b/common/perl_EQDB.cpp @@ -54,8 +54,8 @@ XS(XS_EQDB_field_count) } else Perl_croak(aTHX_ "THIS is not of type EQDB"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->field_count(); XSprePUSH; PUSHu((UV)RETVAL); @@ -80,8 +80,8 @@ XS(XS_EQDB_affected_rows) } else Perl_croak(aTHX_ "THIS is not of type EQDB"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->affected_rows(); XSprePUSH; PUSHu((UV)RETVAL); @@ -106,8 +106,8 @@ XS(XS_EQDB_insert_id) } else Perl_croak(aTHX_ "THIS is not of type EQDB"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->insert_id(); XSprePUSH; PUSHu((UV)RETVAL); @@ -132,8 +132,8 @@ XS(XS_EQDB_get_errno) } else Perl_croak(aTHX_ "THIS is not of type EQDB"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->get_errno(); XSprePUSH; PUSHu((UV)RETVAL); @@ -158,8 +158,8 @@ XS(XS_EQDB_error) } else Perl_croak(aTHX_ "THIS is not of type EQDB"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->error(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -184,8 +184,8 @@ XS(XS_EQDB_query) } else Perl_croak(aTHX_ "THIS is not of type EQDB"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->query(q); ST(0) = sv_newmortal(); @@ -212,8 +212,8 @@ XS(XS_EQDB_escape_string) } else Perl_croak(aTHX_ "THIS is not of type EQDB"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->escape_string(from); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; diff --git a/common/perl_EQDBRes.cpp b/common/perl_EQDBRes.cpp index bb09284a8..b1753e070 100644 --- a/common/perl_EQDBRes.cpp +++ b/common/perl_EQDBRes.cpp @@ -50,8 +50,8 @@ XS(XS_EQDBRes_num_rows) } else Perl_croak(aTHX_ "THIS is not of type EQDBRes"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->num_rows(); XSprePUSH; PUSHu((UV)RETVAL); @@ -76,8 +76,8 @@ XS(XS_EQDBRes_num_fields) } else Perl_croak(aTHX_ "THIS is not of type EQDBRes"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->num_fields(); XSprePUSH; PUSHu((UV)RETVAL); @@ -100,8 +100,8 @@ XS(XS_EQDBRes_DESTROY) } else Perl_croak(aTHX_ "THIS is not a reference"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); delete THIS; } @@ -123,8 +123,8 @@ XS(XS_EQDBRes_finish) } else Perl_croak(aTHX_ "THIS is not of type EQDBRes"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->finish(); } @@ -147,8 +147,8 @@ XS(XS_EQDBRes_fetch_row_array) } else Perl_croak(aTHX_ "THIS is not of type EQDBRes"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->fetch_row_array(); ST(0) = sv_newmortal(); @@ -187,8 +187,8 @@ XS(XS_EQDBRes_fetch_row_hash) } else Perl_croak(aTHX_ "THIS is not of type EQDBRes"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->fetch_row_hash(); ST(0) = sv_newmortal(); @@ -205,7 +205,7 @@ XS(XS_EQDBRes_fetch_row_hash) for(; cur != end; cur++) { /* get the element from the hash, creating if needed (will be needed) */ SV**ele = hv_fetch(hv, cur->first.c_str(), cur->first.length(), TRUE); - if(ele == NULL) { + if(ele == nullptr) { Perl_croak(aTHX_ "Unable to create a hash element for RETVAL"); break; } @@ -251,8 +251,8 @@ XS(XS_EQDBRes_fetch_lengths) } else Perl_croak(aTHX_ "THIS is not of type EQDBRes"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->fetch_lengths(); XSprePUSH; PUSHp((char *)RETVAL, sizeof(*RETVAL)); diff --git a/common/ptimer.cpp b/common/ptimer.cpp index 77aa034af..85acf6e6b 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -74,11 +74,11 @@ To use ptimers, you need to create the table below in your DB: Schema: CREATE TABLE timers ( - char_id INT(11) NOT NULL, - type MEDIUMINT UNSIGNED NOT NULL, - start INT UNSIGNED NOT NULL, - duration INT UNSIGNED NOT NULL, - enable TINYINT NOT NULL, + char_id INT(11) NOT nullptr, + type MEDIUMINT UNSIGNED NOT nullptr, + start INT UNSIGNED NOT nullptr, + duration INT UNSIGNED NOT nullptr, + enable TINYINT NOT nullptr, PRIMARY KEY(char_id, type) ); @@ -95,7 +95,7 @@ PersistentTimer *PersistentTimer::LoadTimer(Database *db, uint32 char_id, pTimer if(p->Load(db)) return(p); delete p; - return(NULL); + return(nullptr); } PersistentTimer::PersistentTimer(uint32 char_id, pTimerType type, uint32 in_timer_time) { @@ -153,8 +153,8 @@ bool PersistentTimer::Load(Database *db) { bool res = false; qcount = mysql_num_rows(result); if(qcount == 1 && (row = mysql_fetch_row(result)) ) { - start_time = strtoul(row[0], NULL, 10); - timer_time = strtoul(row[1], NULL, 10); + start_time = strtoul(row[0], nullptr, 10); + timer_time = strtoul(row[1], nullptr, 10); enabled = (row[2][0] == '1'); res = true; @@ -222,7 +222,7 @@ bool PersistentTimer::Clear(Database *db) { /* This function checks if the timer triggered */ bool PersistentTimer::Expired(Database *db, bool iReset) { - if (this == NULL) { + if (this == nullptr) { LogFile->write(EQEMuLog::Error, "Null timer during ->Check()!?\n"); return(true); } @@ -280,7 +280,7 @@ uint32 PersistentTimer::GetRemainingTime() { uint32 PersistentTimer::get_current_time() { timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); return(tv.tv_sec); } @@ -292,7 +292,7 @@ PTimerList::~PTimerList() { map::iterator s; s = _list.begin(); while(s != _list.end()) { - if(s->second != NULL) + if(s->second != nullptr) delete s->second; s++; } @@ -303,7 +303,7 @@ bool PTimerList::Load(Database *db) { map::iterator s; s = _list.begin(); while(s != _list.end()) { - if(s->second != NULL) + if(s->second != nullptr) delete s->second; s++; } @@ -340,14 +340,14 @@ bool PTimerList::Load(Database *db) { qcount = mysql_num_rows(result); while((row = mysql_fetch_row(result)) ) { type = atoi(row[0]); - start_time = strtoul(row[1], NULL, 10); - timer_time = strtoul(row[2], NULL, 10); + start_time = strtoul(row[1], nullptr, 10); + timer_time = strtoul(row[2], nullptr, 10); enabled = (row[3][0] == '1'); //if it expired allready, dont bother. cur = new PersistentTimer(_char_id, type, start_time, timer_time, enabled); - if(!cur->Expired(NULL)) + if(!cur->Expired(nullptr)) _list[type] = cur; else delete cur; @@ -366,7 +366,7 @@ bool PTimerList::Store(Database *db) { s = _list.begin(); bool res = true; while(s != _list.end()) { - if(s->second != NULL) { + if(s->second != nullptr) { #ifdef DEBUG_PTIMERS printf("Storing timer %u for char %lu\n", s->first, (unsigned long)_char_id); #endif @@ -405,7 +405,7 @@ bool PTimerList::Clear(Database *db) { } void PTimerList::Start(pTimerType type, uint32 duration) { - if(_list.count(type) == 1 && _list[type] != NULL) { + if(_list.count(type) == 1 && _list[type] != nullptr) { _list[type]->Start(duration); } else { _list[type] = new PersistentTimer(_char_id, type, duration); @@ -414,7 +414,7 @@ void PTimerList::Start(pTimerType type, uint32 duration) { void PTimerList::Clear(Database *db, pTimerType type) { if(_list.count(type) == 1) { - if(_list[type] != NULL) { + if(_list[type] != nullptr) { _list[type]->Clear(db); delete _list[type]; } @@ -425,7 +425,7 @@ void PTimerList::Clear(Database *db, pTimerType type) { bool PTimerList::Expired(Database *db, pTimerType type, bool reset) { if(_list.count(type) != 1) return(true); - if(_list[type] == NULL) + if(_list[type] == nullptr) return(true); return(_list[type]->Expired(db, reset)); } @@ -433,32 +433,32 @@ bool PTimerList::Expired(Database *db, pTimerType type, bool reset) { bool PTimerList::Enabled(pTimerType type) { if(_list.count(type) != 1) return(false); - if(_list[type] == NULL) + if(_list[type] == nullptr) return(false); return(_list[type]->Enabled()); } void PTimerList::Enable(pTimerType type) { - if(_list.count(type) == 1 && _list[type] != NULL) + if(_list.count(type) == 1 && _list[type] != nullptr) _list[type]->Enable(); } void PTimerList::Disable(pTimerType type) { - if(_list.count(type) == 1 && _list[type] != NULL) + if(_list.count(type) == 1 && _list[type] != nullptr) _list[type]->Disable(); } uint32 PTimerList::GetRemainingTime(pTimerType type) { if(_list.count(type) != 1) return(0); - if(_list[type] == NULL) + if(_list[type] == nullptr) return(0); return(_list[type]->GetRemainingTime()); } PersistentTimer *PTimerList::Get(pTimerType type) { if(_list.count(type) != 1) - return(NULL); + return(nullptr); return(_list[type]); } @@ -469,7 +469,7 @@ void PTimerList::ToVector(vector< pair > &out) { map::iterator s; s = _list.begin(); while(s != _list.end()) { - if(s->second != NULL) { + if(s->second != nullptr) { p.first = s->first; p.second = s->second; out.push_back(p); diff --git a/common/rdtsc.cpp b/common/rdtsc.cpp index d22a35c5f..085387efc 100644 --- a/common/rdtsc.cpp +++ b/common/rdtsc.cpp @@ -81,7 +81,7 @@ int64 RDTSC_Timer::rdtsc() { #else //fall back to get time of day timeval t; - gettimeofday(&t, NULL); + gettimeofday(&t, nullptr); res = ((int64)t.tv_sec) * 1000 + t.tv_usec; #endif #endif diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 5d0b1a078..a6ec1a708 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -35,17 +35,17 @@ Requred SQL: CREATE TABLE rule_sets ( - ruleset_id TINYINT UNSIGNED NOT NULL auto_increment, - name VARCHAR(255) NOT NULL, + ruleset_id TINYINT UNSIGNED NOT nullptr auto_increment, + name VARCHAR(255) NOT nullptr, PRIMARY KEY(ruleset_id) ); INSERT INTO rule_sets VALUES(0, "default"); UPDATE rule_sets SET ruleset_id=0; CREATE TABLE rule_values ( - ruleset_id TINYINT UNSIGNED NOT NULL, - rule_name VARCHAR(64) NOT NULL, - rule_value VARCHAR(10) NOT NULL, + ruleset_id TINYINT UNSIGNED NOT nullptr, + rule_name VARCHAR(64) NOT nullptr, + rule_value VARCHAR(10) NOT nullptr, INDEX(ruleset_id), PRIMARY KEY(ruleset_id,rule_name) ); @@ -107,7 +107,7 @@ RuleManager::CategoryType RuleManager::FindCategory(const char *catname) { bool RuleManager::ListRules(const char *catname, std::vector &into) { CategoryType cat = InvalidCategory; - if(catname != NULL) { + if(catname != nullptr) { cat = FindCategory(catname); if(cat == InvalidCategory) { _log(RULES__ERROR, "Unable to find category '%s'", catname); @@ -118,7 +118,7 @@ bool RuleManager::ListRules(const char *catname, std::vector &into int rcount = CountRules(); for(r = 0; r < rcount; r++) { const RuleInfo &rule = s_RuleInfo[r]; - if(catname == NULL || cat == rule.category) { + if(catname == nullptr || cat == rule.category) { into.push_back(rule.name); } } @@ -160,7 +160,7 @@ bool RuleManager::GetRule(const char *rule_name, std::string &ret_val) { } bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Database *db, bool db_save) { - if(rule_name == NULL || rule_value == NULL) + if(rule_name == nullptr || rule_value == nullptr) return(false); RuleType type; @@ -204,7 +204,7 @@ void RuleManager::ResetRules() { } bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 &index_into) { - if(rule_name == NULL) + if(rule_name == nullptr) return(false); int r; @@ -237,7 +237,7 @@ const char *RuleManager::_GetRuleName(RuleType type, uint16 index) { void RuleManager::SaveRules(Database *db, const char *ruleset) { - if(ruleset != NULL) { + if(ruleset != nullptr) { //saving to a specific name if(m_activeName != ruleset) { //a new name... @@ -292,7 +292,7 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { { safe_delete_array(query); while((row = mysql_fetch_row(result))) { - if(!SetRule(row[0], row[1], NULL, false)) + if(!SetRule(row[0], row[1], nullptr, false)) _log(RULES__ERROR, "Unable to interpret rule record for %s", row[0]); } mysql_free_result(result); @@ -380,7 +380,7 @@ int RuleManager::_FindOrCreateRuleset(Database *db, const char *ruleset) { if (!db->RunQuery(query, MakeAnyLenString(&query, "INSERT INTO rule_sets (ruleset_id, name) " " VALUES(0, '%s')", - rst),errbuf,NULL,NULL,&new_id)) + rst),errbuf,nullptr,nullptr,&new_id)) { _log(RULES__ERROR, "Fauled to create rule set in the database: %s: %s", query,errbuf); res = -1; diff --git a/common/rulesys.h b/common/rulesys.h index ca69530a8..060a44e82 100644 --- a/common/rulesys.h +++ b/common/rulesys.h @@ -102,7 +102,7 @@ public: bool ListRules(const char *catname, std::vector &into); bool ListCategories(std::vector &into); bool GetRule(const char *rule_name, std::string &ret_val); - bool SetRule(const char *rule_name, const char *rule_value, Database *db = NULL, bool db_save = false); + bool SetRule(const char *rule_name, const char *rule_value, Database *db = nullptr, bool db_save = false); int GetActiveRulesetID() const { return(m_activeRuleset); } const char *GetActiveRuleset() const { return(m_activeName.c_str()); } @@ -111,8 +111,8 @@ public: static bool ListRulesets(Database *db, std::map &into); void ResetRules(); - bool LoadRules(Database *db, const char *ruleset = NULL); - void SaveRules(Database *db, const char *ruleset = NULL); + bool LoadRules(Database *db, const char *ruleset = nullptr); + void SaveRules(Database *db, const char *ruleset = nullptr); private: RuleManager(); diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 9c8924a87..6fc251374 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -21,15 +21,15 @@ using namespace std; SharedDatabase::SharedDatabase() -: Database(), skill_caps_mmf(NULL), items_mmf(NULL), items_hash(NULL), faction_mmf(NULL), faction_hash(NULL), - loot_table_mmf(NULL), loot_drop_mmf(NULL), loot_table_hash(NULL), loot_drop_hash(NULL) +: Database(), skill_caps_mmf(nullptr), items_mmf(nullptr), items_hash(nullptr), faction_mmf(nullptr), faction_hash(nullptr), + loot_table_mmf(nullptr), loot_drop_mmf(nullptr), loot_table_hash(nullptr), loot_drop_hash(nullptr) { } SharedDatabase::SharedDatabase(const char* host, const char* user, const char* passwd, const char* database, uint32 port) -: Database(host, user, passwd, database, port), skill_caps_mmf(NULL), items_mmf(NULL), items_hash(NULL), - faction_mmf(NULL), faction_hash(NULL), loot_table_mmf(NULL), loot_drop_mmf(NULL), loot_table_hash(NULL), - loot_drop_hash(NULL) +: Database(host, user, passwd, database, port), skill_caps_mmf(nullptr), items_mmf(nullptr), items_hash(nullptr), + faction_mmf(nullptr), faction_hash(nullptr), loot_table_mmf(nullptr), loot_drop_mmf(nullptr), loot_table_hash(nullptr), + loot_drop_hash(nullptr) { } @@ -487,7 +487,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { ((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id); if(is_charid) - SaveInventory(id,NULL,slot_id); + SaveInventory(id,nullptr,slot_id); } } else { @@ -727,7 +727,7 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) { char query[] = "SELECT MAX(id), count(*) FROM items"; if (RunQuery(query, static_cast(strlen(query)), errbuf, &result)) { row = mysql_fetch_row(result); - if (row != NULL && row[1] != 0) { + if (row != nullptr && row[1] != 0) { item_count = atoi(row[1]); if(row[0]) max_id = atoi(row[0]); @@ -1020,19 +1020,19 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ const Item_Struct* SharedDatabase::GetItem(uint32 id) { if(!items_hash || id > items_hash->max_key()) { - return NULL; + return nullptr; } if(items_hash->exists(id)) { return &(items_hash->at(id)); } - return NULL; + return nullptr; } const Item_Struct* SharedDatabase::IterateItems(uint32* id) { if(!items_hash || !id) { - return NULL; + return nullptr; } for(;;) { @@ -1047,7 +1047,7 @@ const Item_Struct* SharedDatabase::IterateItems(uint32* id) { } } - return NULL; + return nullptr; } string SharedDatabase::GetBook(const char *txtfile) @@ -1104,14 +1104,14 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) { const NPCFactionList* SharedDatabase::GetNPCFactionEntry(uint32 id) { if(!faction_hash) { - return NULL; + return nullptr; } if(faction_hash->exists(id)) { return &(faction_hash->at(id)); } - return NULL; + return nullptr; } void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_count, uint32 max_lists) { @@ -1305,8 +1305,8 @@ uint32 SharedDatabase::SetPlayerProfile_MQ(char** query, uint32 account_id, uint // Create appropriate ItemInst class ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) { - const Item_Struct* item = NULL; - ItemInst* inst = NULL; + const Item_Struct* item = nullptr; + ItemInst* inst = nullptr; item = GetItem(item_id); if (item) { inst = CreateBaseItem(item, charges); @@ -1324,7 +1324,7 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, // Create appropriate ItemInst class ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) { - ItemInst* inst = NULL; + ItemInst* inst = nullptr; if (item) { inst = CreateBaseItem(item, charges); inst->PutAugment(this, 0, aug1); @@ -1338,7 +1338,7 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin } ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) { - ItemInst* inst = NULL; + ItemInst* inst = nullptr; if (item) { // if maxcharges is -1 that means it is an unlimited use item. // set it to 1 charge so that it is usable on creation @@ -1592,12 +1592,12 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe } const EvolveInfo* SharedDatabase::GetEvolveInfo(uint32 loregroup) { - return NULL; // nothing here for now... database and/or sharemem pulls later + return nullptr; // nothing here for now... database and/or sharemem pulls later } int SharedDatabase::GetMaxSpellID() { char errbuf[MYSQL_ERRMSG_SIZE]; - char *query = NULL; + char *query = nullptr; MYSQL_RES *result; MYSQL_ROW row; int32 ret = 0; @@ -1930,7 +1930,7 @@ bool SharedDatabase::LoadLoot() { const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) { if(!loot_table_hash) - return NULL; + return nullptr; try { if(loot_table_hash->exists(loottable_id)) { @@ -1939,12 +1939,12 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) { } catch(std::exception &ex) { LogFile->write(EQEMuLog::Error, "Could not get loot table: %s", ex.what()); } - return NULL; + return nullptr; } const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) { if(!loot_drop_hash) - return NULL; + return nullptr; try { if(loot_drop_hash->exists(lootdrop_id)) { @@ -1953,7 +1953,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) { } catch(std::exception &ex) { LogFile->write(EQEMuLog::Error, "Could not get loot drop: %s", ex.what()); } - return NULL; + return nullptr; } void SharedDatabase::GetPlayerInspectMessage(char* playername, InspectMessage_Struct* message) { diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index a29041823..aeebf7706 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -52,7 +52,7 @@ void TimeoutManager::CheckTimeouts() { //methods called by Timeoutable objects: void TimeoutManager::AddMember(Timeoutable *who) { - if(who == NULL) + if(who == nullptr) return; DeleteMember(who); //just in case... prolly not needed. diff --git a/common/tinyxml/tinystr.cpp b/common/tinyxml/tinystr.cpp index 413f5c344..57aa56792 100644 --- a/common/tinyxml/tinystr.cpp +++ b/common/tinyxml/tinystr.cpp @@ -42,7 +42,7 @@ TiXmlString::TiXmlString (const char* instring) if (!instring) { allocated = 0; - cstring = NULL; + cstring = nullptr; current_length = 0; return; } @@ -68,7 +68,7 @@ TiXmlString::TiXmlString (const TiXmlString& copy) if (! copy . allocated) { allocated = 0; - cstring = NULL; + cstring = nullptr; current_length = 0; return; } diff --git a/common/tinyxml/tinystr.h b/common/tinyxml/tinystr.h index 39605020e..6f1edca9b 100644 --- a/common/tinyxml/tinystr.h +++ b/common/tinyxml/tinystr.h @@ -55,7 +55,7 @@ class TiXmlString TiXmlString () { allocated = 0; - cstring = NULL; + cstring = nullptr; current_length = 0; } @@ -184,7 +184,7 @@ class TiXmlString { if (cstring) delete [] cstring; - cstring = NULL; + cstring = nullptr; allocated = 0; current_length = 0; } diff --git a/common/tinyxml/tinyxml.h b/common/tinyxml/tinyxml.h index 916dea954..cea3bebfd 100644 --- a/common/tinyxml/tinyxml.h +++ b/common/tinyxml/tinyxml.h @@ -495,7 +495,7 @@ public: #endif /** Add a new node related to this. Adds a child past the LastChild. - Returns a pointer to the new object or NULL if an error occured. + Returns a pointer to the new object or nullptr if an error occured. */ TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); @@ -512,17 +512,17 @@ public: TiXmlNode* LinkEndChild( TiXmlNode* addThis ); /** Add a new node related to this. Adds a child before the specified child. - Returns a pointer to the new object or NULL if an error occured. + Returns a pointer to the new object or nullptr if an error occured. */ TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); /** Add a new node related to this. Adds a child after the specified child. - Returns a pointer to the new object or NULL if an error occured. + Returns a pointer to the new object or nullptr if an error occured. */ TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); /** Replace a child of this node. - Returns a pointer to the new object or NULL if an error occured. + Returns a pointer to the new object or nullptr if an error occured. */ TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 052d849fe..06ccd718b 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) { */ //the storage passed to putenv must remain valid... crazy unix people const char *pv = getenv("LD_LIBRARY_PATH"); - if(pv == NULL) { + if(pv == nullptr) { putenv(strdup("LD_LIBRARY_PATH=.")); } else { char *v = (char *) malloc(strlen(pv) + 19); diff --git a/loginserver/Client.cpp b/loginserver/Client.cpp index 5335c08cd..a487849e1 100644 --- a/loginserver/Client.cpp +++ b/loginserver/Client.cpp @@ -191,7 +191,7 @@ void Client::Handle_Login(const char* data, unsigned int size) string e_user; string e_hash; - char *e_buffer = NULL; + char *e_buffer = nullptr; unsigned int d_account_id = 0; string d_pass_hash; diff --git a/loginserver/ClientManager.cpp b/loginserver/ClientManager.cpp index 2083925d0..73791ef6b 100644 --- a/loginserver/ClientManager.cpp +++ b/loginserver/ClientManager.cpp @@ -185,7 +185,7 @@ void ClientManager::RemoveExistingClient(unsigned int account_id) Client *ClientManager::GetClient(unsigned int account_id) { - Client *cur = NULL; + Client *cur = nullptr; int count = 0; list::iterator iter = clients.begin(); while(iter != clients.end()) diff --git a/loginserver/Config.cpp b/loginserver/Config.cpp index 7841e441e..ecf544464 100644 --- a/loginserver/Config.cpp +++ b/loginserver/Config.cpp @@ -46,7 +46,7 @@ string Config::GetVariable(string title, string parameter) */ void Config::Parse(const char *file_name) { - if(file_name == NULL) + if(file_name == nullptr) { server_log->Log(log_error, "Config::Parse(), file_name passed was null."); return; diff --git a/loginserver/DatabaseMySQL.cpp b/loginserver/DatabaseMySQL.cpp index 5409405e6..df1577f3d 100644 --- a/loginserver/DatabaseMySQL.cpp +++ b/loginserver/DatabaseMySQL.cpp @@ -35,12 +35,12 @@ DatabaseMySQL::DatabaseMySQL(string user, string pass, string host, string port, this->host = host; this->name = name; - db = mysql_init(NULL); + db = mysql_init(nullptr); if(db) { my_bool r = 1; mysql_options(db, MYSQL_OPT_RECONNECT, &r); - if(!mysql_real_connect(db, host.c_str(), user.c_str(), pass.c_str(), name.c_str(), atoi(port.c_str()), NULL, 0)) + if(!mysql_real_connect(db, host.c_str(), user.c_str(), pass.c_str(), name.c_str(), atoi(port.c_str()), nullptr, 0)) { mysql_close(db); server_log->Log(log_database, "Failed to connect to MySQL database."); @@ -84,7 +84,7 @@ bool DatabaseMySQL::GetLoginDataFromAccountName(string name, string &password, u if(res) { - while((row = mysql_fetch_row(res)) != NULL) + while((row = mysql_fetch_row(res)) != nullptr) { id = atoi(row[0]); password = row[1]; @@ -128,7 +128,7 @@ bool DatabaseMySQL::GetWorldRegistration(string long_name, string short_name, un res = mysql_use_result(db); if(res) { - if((row = mysql_fetch_row(res)) != NULL) + if((row = mysql_fetch_row(res)) != nullptr) { id = atoi(row[0]); desc = row[1]; @@ -153,7 +153,7 @@ bool DatabaseMySQL::GetWorldRegistration(string long_name, string short_name, un res = mysql_use_result(db); if(res) { - if((row = mysql_fetch_row(res)) != NULL) + if((row = mysql_fetch_row(res)) != nullptr) { account = row[0]; password = row[1]; @@ -264,7 +264,7 @@ bool DatabaseMySQL::CreateWorldRegistration(string long_name, string short_name, res = mysql_use_result(db); if(res) { - if((row = mysql_fetch_row(res)) != NULL) + if((row = mysql_fetch_row(res)) != nullptr) { id = atoi(row[0]) + 1; mysql_free_result(res); diff --git a/loginserver/DatabaseMySQL.h b/loginserver/DatabaseMySQL.h index 6bb0c6682..87aa2c45b 100644 --- a/loginserver/DatabaseMySQL.h +++ b/loginserver/DatabaseMySQL.h @@ -37,7 +37,7 @@ public: /** * Constructor, sets our database to null. */ - DatabaseMySQL() { db = NULL; } + DatabaseMySQL() { db = nullptr; } /** * Constructor, tries to set our database to connect to the supplied options. @@ -52,7 +52,7 @@ public: /** * @return Returns true if the database successfully connected. */ - virtual bool IsConnected() { return (db != NULL); } + virtual bool IsConnected() { return (db != nullptr); } /** * Retrieves the login data (password hash and account id) from the account name provided diff --git a/loginserver/DatabasePostgreSQL.cpp b/loginserver/DatabasePostgreSQL.cpp index a74787d73..fd23ff347 100644 --- a/loginserver/DatabasePostgreSQL.cpp +++ b/loginserver/DatabasePostgreSQL.cpp @@ -30,8 +30,8 @@ extern LoginServer server; DatabasePostgreSQL::DatabasePostgreSQL(string user, string pass, string host, string port, string name) { - db = NULL; - db = PQsetdbLogin(host.c_str(), port.c_str(), NULL, NULL, name.c_str(), user.c_str(), pass.c_str()); + db = nullptr; + db = PQsetdbLogin(host.c_str(), port.c_str(), nullptr, nullptr, name.c_str(), user.c_str(), pass.c_str()); if(!db) { server_log->Log(log_database, "Failed to connect to PostgreSQL Database."); @@ -41,7 +41,7 @@ DatabasePostgreSQL::DatabasePostgreSQL(string user, string pass, string host, st { server_log->Log(log_database, "Failed to connect to PostgreSQL Database."); PQfinish(db); - db = NULL; + db = nullptr; } } diff --git a/loginserver/DatabasePostgreSQL.h b/loginserver/DatabasePostgreSQL.h index 1b7638d34..28922f403 100644 --- a/loginserver/DatabasePostgreSQL.h +++ b/loginserver/DatabasePostgreSQL.h @@ -37,7 +37,7 @@ public: /** * Constructor, sets our database to null. */ - DatabasePostgreSQL() { db = NULL; } + DatabasePostgreSQL() { db = nullptr; } /** * Constructor, tries to set our database to connect to the supplied options. @@ -52,7 +52,7 @@ public: /** * Returns true if the database successfully connected. */ - virtual bool IsConnected() { return (db != NULL); } + virtual bool IsConnected() { return (db != nullptr); } /** * Retrieves the login data (password hash and account id) from the account name provided diff --git a/loginserver/Encryption.h b/loginserver/Encryption.h index b3fe3a506..10c432794 100644 --- a/loginserver/Encryption.h +++ b/loginserver/Encryption.h @@ -36,9 +36,9 @@ class Encryption { public: /** - * Constructor, sets all member pointers to NULL. + * Constructor, sets all member pointers to nullptr. */ - Encryption() : h_dll(NULL), encrypt_func(NULL), decrypt_func(NULL), delete_func(NULL) { }; + Encryption() : h_dll(nullptr), encrypt_func(nullptr), decrypt_func(nullptr), delete_func(nullptr) { }; /** * Destructor, if it's loaded it unloads this library. @@ -48,7 +48,7 @@ public: /** * Returns true if the dll is loaded, otherwise false. */ - inline bool Loaded() { return (h_dll != NULL); } + inline bool Loaded() { return (h_dll != nullptr); } /** * Loads the plugin. diff --git a/loginserver/LoginServer.h b/loginserver/LoginServer.h index c4075ea62..a3fc7301f 100644 --- a/loginserver/LoginServer.h +++ b/loginserver/LoginServer.h @@ -40,9 +40,9 @@ public: * but it's the most trivial way to do this. */ #ifdef WIN32 - LoginServer() : config(NULL), db(NULL), eq_crypto(NULL), SM(NULL) { } + LoginServer() : config(nullptr), db(nullptr), eq_crypto(nullptr), SM(nullptr) { } #else - LoginServer() : config(NULL), db(NULL) { } + LoginServer() : config(nullptr), db(nullptr) { } #endif Config *config; diff --git a/loginserver/Main.cpp b/loginserver/Main.cpp index 6a77be9b4..5714456d5 100644 --- a/loginserver/Main.cpp +++ b/loginserver/Main.cpp @@ -44,7 +44,7 @@ int main() set_exception_handler(); //Create our error log, is of format login_.log - time_t current_time = time(NULL); + time_t current_time = time(nullptr); stringstream log_name(stringstream::in | stringstream::out); #ifdef WIN32 log_name << ".\\logs\\login_" << (unsigned int)current_time << ".log"; diff --git a/loginserver/ServerManager.cpp b/loginserver/ServerManager.cpp index f703ce925..c40cfd462 100644 --- a/loginserver/ServerManager.cpp +++ b/loginserver/ServerManager.cpp @@ -54,7 +54,7 @@ ServerManager::~ServerManager() void ServerManager::Process() { ProcessDisconnect(); - EmuTCPConnection *tcp_c = NULL; + EmuTCPConnection *tcp_c = nullptr; while(tcp_c = tcps->NewQueuePop()) { in_addr tmp; @@ -126,7 +126,7 @@ WorldServer* ServerManager::GetServerByAddress(unsigned int address) iter++; } - return NULL; + return nullptr; } EQApplicationPacket *ServerManager::CreateServerListPacket(Client *c) diff --git a/loginserver/ServerManager.h b/loginserver/ServerManager.h index bb14c2449..c3b410b3f 100644 --- a/loginserver/ServerManager.h +++ b/loginserver/ServerManager.h @@ -64,12 +64,12 @@ public: /** * Checks to see if there is a server exists with this name, ignoring option. */ - bool ServerExists(string l_name, string s_name, WorldServer *ignore = NULL); + bool ServerExists(string l_name, string s_name, WorldServer *ignore = nullptr); /** * Destroys a server with this name, ignoring option. */ - void DestroyServerByName(string l_name, string s_name, WorldServer *ignore = NULL); + void DestroyServerByName(string l_name, string s_name, WorldServer *ignore = nullptr); private: /** diff --git a/loginserver/WorldServer.cpp b/loginserver/WorldServer.cpp index 3b00351c6..b641161d7 100644 --- a/loginserver/WorldServer.cpp +++ b/loginserver/WorldServer.cpp @@ -59,7 +59,7 @@ void WorldServer::Reset() bool WorldServer::Process() { - ServerPacket *app = NULL; + ServerPacket *app = nullptr; while(app = connection->PopPacket()) { if(server.options.IsWorldTraceOn()) @@ -223,7 +223,7 @@ bool WorldServer::Process() } delete app; - app = NULL; + app = nullptr; } return true; } diff --git a/queryserv/database.h b/queryserv/database.h index 0aebb6ae2..f38d5db98 100644 --- a/queryserv/database.h +++ b/queryserv/database.h @@ -36,7 +36,7 @@ using namespace std; //atoi is not uint32 or uint32 safe!!!! -#define atoul(str) strtoul(str, NULL, 10) +#define atoul(str) strtoul(str, nullptr, 10) class Database : public DBcore { public: diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index 9f33d039f..af44817a9 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -262,7 +262,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char safe_delete_array(query); - uint32 Now = time(NULL); + uint32 Now = time(nullptr); if(Toggle == 1) { @@ -313,7 +313,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char safe_delete_array(query); - uint32 Now = time(NULL); + uint32 Now = time(nullptr); if(Toggle == 1) { @@ -351,7 +351,7 @@ void LFGuildManager::ExpireEntries() for(it = Players.begin(); it != Players.end(); ++it) { - if((*it).TimePosted + 604800 <= (uint32)time(NULL)) + if((*it).TimePosted + 604800 <= (uint32)time(nullptr)) { if(!database.RunQuery(query, MakeAnyLenString(&query, "DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()), errbuf, 0, 0)) _log(QUERYSERV__ERROR, "Error expiring player LFGuild entry, query was %s, %s", query, errbuf); @@ -364,7 +364,7 @@ void LFGuildManager::ExpireEntries() for(it2 = Guilds.begin(); it2 != Guilds.end(); ++it2) { - if((*it2).TimePosted + 2592000 <= time(NULL)) + if((*it2).TimePosted + 2592000 <= time(nullptr)) { if(!database.RunQuery(query, MakeAnyLenString(&query, "DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()), errbuf, 0, 0)) _log(QUERYSERV__ERROR, "Error removing guild LFGuild entry, query was %s, %s", query, errbuf); diff --git a/queryserv/queryservconfig.cpp b/queryserv/queryservconfig.cpp index 9720554ba..7680648ed 100644 --- a/queryserv/queryservconfig.cpp +++ b/queryserv/queryservconfig.cpp @@ -22,7 +22,7 @@ #include "../common/debug.h" #include "queryservconfig.h" -queryservconfig *queryservconfig::_chat_config = NULL; +queryservconfig *queryservconfig::_chat_config = nullptr; string queryservconfig::GetByName(const string &var_name) const { return(EQEmuConfig::GetByName(var_name)); diff --git a/queryserv/queryservconfig.h b/queryserv/queryservconfig.h index d0c6533bc..61830e3da 100644 --- a/queryserv/queryservconfig.h +++ b/queryserv/queryservconfig.h @@ -36,14 +36,14 @@ public: // Produce a const singleton static const queryservconfig *get() { - if (_chat_config == NULL) + if (_chat_config == nullptr) LoadConfig(); return(_chat_config); } // Load the config static bool LoadConfig() { - if (_chat_config != NULL) + if (_chat_config != nullptr) delete _chat_config; _chat_config=new queryservconfig; _config=_chat_config; diff --git a/tests/memory_mapped_file_test.h b/tests/memory_mapped_file_test.h index c5ef60525..cccf73162 100644 --- a/tests/memory_mapped_file_test.h +++ b/tests/memory_mapped_file_test.h @@ -40,7 +40,7 @@ public: TEST_ASSERT(mmf.Size() == 512); unsigned char *data = reinterpret_cast(mmf.Get()); - TEST_ASSERT(data != NULL); + TEST_ASSERT(data != nullptr); *reinterpret_cast(data) = 562; } @@ -50,7 +50,7 @@ public: TEST_ASSERT(mmf.Size() == 512); unsigned char *data = reinterpret_cast(mmf.Get()); - TEST_ASSERT(data != NULL); + TEST_ASSERT(data != nullptr); uint32 val = *reinterpret_cast(data); TEST_ASSERT(val == 562); diff --git a/ucs/chatchannel.cpp b/ucs/chatchannel.cpp index 163a6301e..6167c7e05 100644 --- a/ucs/chatchannel.cpp +++ b/ucs/chatchannel.cpp @@ -85,7 +85,7 @@ ChatChannel* ChatChannelList::FindChannel(string Name) { iterator.Advance(); } - return NULL; + return nullptr; } void ChatChannelList::SendAllChannels(Client *c) { @@ -452,13 +452,13 @@ bool ChatChannel::IsClientInChannel(Client *c) { ChatChannel *ChatChannelList::AddClientToChannel(string ChannelName, Client *c) { - if(!c) return NULL; + if(!c) return nullptr; if((ChannelName.length() > 0) && (isdigit(ChannelName[0]))) { c->GeneralChannelMessage("The channel name can not begin with a number."); - return NULL; + return nullptr; } string NormalisedName, Password; @@ -477,7 +477,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(string ChannelName, Client *c) c->GeneralChannelMessage("The channel name or password cannot exceed 64 characters."); - return NULL; + return nullptr; } _log(UCS__TRACE, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); @@ -493,11 +493,11 @@ ChatChannel *ChatChannelList::AddClientToChannel(string ChannelName, Client *c) c->GeneralChannelMessage(Message); - return NULL; + return nullptr; } if(RequiredChannel->IsClientInChannel(c)) - return NULL; + return nullptr; if(RequiredChannel->IsInvitee(c->GetName())) { @@ -518,12 +518,12 @@ ChatChannel *ChatChannelList::AddClientToChannel(string ChannelName, Client *c) c->GeneralChannelMessage("Incorrect password for channel " + (NormalisedName)); - return NULL; + return nullptr; } ChatChannel *ChatChannelList::RemoveClientFromChannel(string inChannelName, Client *c) { - if(!c) return NULL; + if(!c) return nullptr; string ChannelName = inChannelName; @@ -533,7 +533,7 @@ ChatChannel *ChatChannelList::RemoveClientFromChannel(string inChannelName, Clie ChatChannel *RequiredChannel = FindChannel(ChannelName); if(!RequiredChannel) - return NULL; + return nullptr; // RemoveClient will return false if there is no-one left in the channel, and the channel is not permanent and has // no password. diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index 92cf7806c..9a857c3cd 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -69,7 +69,7 @@ void Client::SendUptime() { ms -= m * 60000; uint32 s = ms / 1000; - char *Buffer = NULL; + char *Buffer = nullptr; MakeAnyLenString(&Buffer, "UCS has been up for %02id %02ih %02im %02is", d, h, m, s); GeneralChannelMessage(Buffer); @@ -510,7 +510,7 @@ Client::Client(EQStream *eqs) { Revoked = false; for(int i = 0; i < MAX_JOINED_CHANNELS ; i++) - JoinedChannels[i] = NULL; + JoinedChannels[i] = nullptr; TotalKarma = 0; AttemptedMessages = 0; @@ -533,13 +533,13 @@ Client::~Client() { if(AccountGrabUpdateTimer) { delete AccountGrabUpdateTimer; - AccountGrabUpdateTimer = NULL; + AccountGrabUpdateTimer = nullptr; } if(GlobalChatLimiterTimer) { delete GlobalChatLimiterTimer; - GlobalChatLimiterTimer = NULL; + GlobalChatLimiterTimer = nullptr; } } @@ -964,7 +964,7 @@ Client *Clientlist::FindCharacter(string CharacterName) { } - return NULL; + return nullptr; } void Client::AddToChannelList(ChatChannel *JoinedChannel) { @@ -972,7 +972,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) { if(!JoinedChannel) return; for(int i = 0; i < MAX_JOINED_CHANNELS; i++) - if(JoinedChannels[i] == NULL) { + if(JoinedChannels[i] == nullptr) { JoinedChannels[i] = JoinedChannel; _log(UCS__TRACE, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); return; @@ -989,7 +989,7 @@ void Client::RemoveFromChannelList(ChatChannel *JoinedChannel) { for(int j = i; j < (MAX_JOINED_CHANNELS - 1); j++) JoinedChannels[j] = JoinedChannels[j + 1]; - JoinedChannels[MAX_JOINED_CHANNELS - 1] = NULL; + JoinedChannels[MAX_JOINED_CHANNELS - 1] = nullptr; break; } @@ -1066,7 +1066,7 @@ void Client::JoinChannels(string ChannelNameList) { for(int i = 0; i < MAX_JOINED_CHANNELS ; i++) { - if(JoinedChannels[i] != NULL) { + if(JoinedChannels[i] != nullptr) { if(ChannelCount) { @@ -1155,7 +1155,7 @@ void Client::LeaveChannels(string ChannelNameList) { for(int i = 0; i < MAX_JOINED_CHANNELS ; i++) { - if(JoinedChannels[i] != NULL) { + if(JoinedChannels[i] != nullptr) { if(ChannelCount) { @@ -1213,7 +1213,7 @@ void Client::LeaveAllChannels(bool SendUpdatedChannelList) { ChannelList->RemoveClientFromChannel(JoinedChannels[i]->GetName(), this); - JoinedChannels[i] = NULL; + JoinedChannels[i] = nullptr; } } @@ -1258,7 +1258,7 @@ void Client::SendChannelList() { for(int i = 0; i < MAX_JOINED_CHANNELS ; i++) { - if(JoinedChannels[i] != NULL) { + if(JoinedChannels[i] != nullptr) { if(ChannelCount) ChannelMessage = ChannelMessage + ","; @@ -1313,7 +1313,7 @@ void Client::SendChannelMessage(string Message) { if(GetKarma() < RuleI(Chat, KarmaGlobalChatLimit)) { - CharacterEntry *char_ent = NULL; + CharacterEntry *char_ent = nullptr; for(int x = 0; x < Characters.size(); ++x) { if(Characters[x].Name.compare(GetName()) == 0) @@ -1426,7 +1426,7 @@ void Client::SendChannelMessageByNumber(string Message) { { if(GetKarma() < RuleI(Chat, KarmaGlobalChatLimit)) { - CharacterEntry *char_ent = NULL; + CharacterEntry *char_ent = nullptr; for(int x = 0; x < Characters.size(); ++x) { if(Characters[x].Name.compare(GetName()) == 0) @@ -2171,7 +2171,7 @@ string Client::ChannelSlotName(int SlotNumber) { if((SlotNumber < 1 ) || (SlotNumber > MAX_JOINED_CHANNELS)) return ""; - if(JoinedChannels[SlotNumber - 1] == NULL) + if(JoinedChannels[SlotNumber - 1] == nullptr) return ""; return JoinedChannels[SlotNumber - 1]->GetName(); @@ -2261,7 +2261,7 @@ Client *Clientlist::IsCharacterOnline(string CharacterName) { } - return NULL; + return nullptr; } int Client::GetMailBoxNumber(string CharacterName) { @@ -2281,7 +2281,7 @@ void Client::SendNotification(int MailBoxNumber, string Subject, string From, in char Sequence[100]; - sprintf(TimeStamp, "%i", (int)time(NULL)); + sprintf(TimeStamp, "%i", (int)time(nullptr)); sprintf(sMessageID, "%i", MessageID); diff --git a/ucs/database.cpp b/ucs/database.cpp index f8900862c..e03339b0b 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -583,7 +583,7 @@ bool Database::SendMail(string Recipient, string From, string Subject, string Bo uint32 LastMsgID; - int Now = time(NULL); // time returns a 64 bit int on Windows at least, which vsnprintf doesn't like. + int Now = time(nullptr); // time returns a 64 bit int on Windows at least, which vsnprintf doesn't like. if(!RunQuery(query, MakeAnyLenString(&query, MailQuery, CharacterID, Now, From.c_str(), EscSubject, EscBody, RecipientsString.c_str(), 1), errbuf, 0, 0, &LastMsgID)) { @@ -661,7 +661,7 @@ void Database::ExpireMail() { // Expire Trash if(RuleI(Mail, ExpireTrash) >= 0) { if(RunQuery(query, MakeAnyLenString(&query, "delete from `mail` where `status`=4 and `timestamp` < %i", - time(NULL) - RuleI(Mail, ExpireTrash)), errbuf, 0, &AffectedRows)) { + time(nullptr) - RuleI(Mail, ExpireTrash)), errbuf, 0, &AffectedRows)) { _log(UCS__INIT, "Expired %i trash messages.", AffectedRows); } else { @@ -672,7 +672,7 @@ void Database::ExpireMail() { // Expire Read if(RuleI(Mail, ExpireRead) >= 0) { if(RunQuery(query, MakeAnyLenString(&query, "delete from `mail` where `status`=3 and `timestamp` < %i", - time(NULL) - RuleI(Mail, ExpireRead)), errbuf, 0, &AffectedRows)) { + time(nullptr) - RuleI(Mail, ExpireRead)), errbuf, 0, &AffectedRows)) { _log(UCS__INIT, "Expired %i read messages.", AffectedRows); } else { @@ -683,7 +683,7 @@ void Database::ExpireMail() { // Expire Unread if(RuleI(Mail, ExpireUnread) >= 0) { if(RunQuery(query, MakeAnyLenString(&query, "delete from `mail` where `status`=1 and `timestamp` < %i", - time(NULL) - RuleI(Mail, ExpireUnread)), errbuf, 0, &AffectedRows)) { + time(nullptr) - RuleI(Mail, ExpireUnread)), errbuf, 0, &AffectedRows)) { _log(UCS__INIT, "Expired %i unread messages.", AffectedRows); } else { diff --git a/ucs/database.h b/ucs/database.h index fafb23989..ad047e928 100644 --- a/ucs/database.h +++ b/ucs/database.h @@ -36,7 +36,7 @@ using namespace std; //atoi is not uint32 or uint32 safe!!!! -#define atoul(str) strtoul(str, NULL, 10) +#define atoul(str) strtoul(str, nullptr, 10) class Database : public DBcore { public: diff --git a/ucs/ucsconfig.cpp b/ucs/ucsconfig.cpp index 211199a6b..6ee149805 100644 --- a/ucs/ucsconfig.cpp +++ b/ucs/ucsconfig.cpp @@ -22,7 +22,7 @@ #include "../common/debug.h" #include "ucsconfig.h" -ucsconfig *ucsconfig::_chat_config = NULL; +ucsconfig *ucsconfig::_chat_config = nullptr; string ucsconfig::GetByName(const string &var_name) const { return(EQEmuConfig::GetByName(var_name)); diff --git a/ucs/ucsconfig.h b/ucs/ucsconfig.h index af3799e33..84fdf332d 100644 --- a/ucs/ucsconfig.h +++ b/ucs/ucsconfig.h @@ -36,14 +36,14 @@ public: // Produce a const singleton static const ucsconfig *get() { - if (_chat_config == NULL) + if (_chat_config == nullptr) LoadConfig(); return(_chat_config); } // Load the config static bool LoadConfig() { - if (_chat_config != NULL) + if (_chat_config != nullptr) delete _chat_config; _chat_config=new ucsconfig; _config=_chat_config; diff --git a/utils/azone2/3d_base.hpp b/utils/azone2/3d_base.hpp index 6277a3bec..6576b4730 100644 --- a/utils/azone2/3d_base.hpp +++ b/utils/azone2/3d_base.hpp @@ -63,7 +63,7 @@ struct Texture { class Model { public: - Model() { IncludeInMap = false; verts = NULL; vert_count = 0; polys = NULL; poly_count = 0; tex = NULL; tex_count = 0; name = NULL; } + Model() { IncludeInMap = false; verts = nullptr; vert_count = 0; polys = nullptr; poly_count = 0; tex = nullptr; tex_count = 0; name = nullptr; } ~Model() {} Vertex **verts; diff --git a/utils/azone2/awater.cpp b/utils/azone2/awater.cpp index 01704d4f2..ee15a02da 100644 --- a/utils/azone2/awater.cpp +++ b/utils/azone2/awater.cpp @@ -120,7 +120,7 @@ bool BuildWaterMap(const char *shortname, long DefaultRegionType) { archive = new PFSLoader(); FILE *s3df = fopen(bufs, "rb"); - if(s3df == NULL) { + if(s3df == nullptr) { // One day we may try EQG, but not today. printf("Unable to open s3d file '%s'.\n", bufs); return(false); @@ -133,7 +133,7 @@ bool BuildWaterMap(const char *shortname, long DefaultRegionType) { fileloader = new WLDLoader(); - if(fileloader->Open(NULL, (char *) shortname, archive) == 0) { + if(fileloader->Open(nullptr, (char *) shortname, archive) == 0) { printf("Error reading WLD from %s\n", bufs); return(false); } @@ -173,7 +173,7 @@ bool BuildWaterMap(const char *shortname, long DefaultRegionType) { } - if(tree==NULL) { + if(tree==nullptr) { printf("No BSP Tree. Bailing out\n"); return(false); } @@ -200,7 +200,7 @@ bool BuildWaterMap(const char *shortname, long DefaultRegionType) { sprintf(bufm, "%s.wtr", shortname); FILE *WaterFile = fopen(bufm, "wb"); - if(WaterFile == NULL) { + if(WaterFile == nullptr) { printf("Failed to open %s for writing\n", bufm); return(false); } diff --git a/utils/azone2/azone.cpp b/utils/azone2/azone.cpp index 90a69997f..c49b89e26 100644 --- a/utils/azone2/azone.cpp +++ b/utils/azone2/azone.cpp @@ -100,10 +100,10 @@ int main(int argc, char *argv[]) { } QTBuilder::QTBuilder() { - _root = NULL; + _root = nullptr; faceCount = 0; - faceBlock = NULL; + faceBlock = nullptr; #ifdef COUNT_MACTHES gEasyMatches = 0; @@ -114,12 +114,12 @@ QTBuilder::QTBuilder() { } QTBuilder::~QTBuilder() { - if(_root != NULL) + if(_root != nullptr) delete _root; - _root = NULL; - if(faceBlock != NULL) + _root = nullptr; + if(faceBlock != nullptr) delete [] faceBlock; - faceBlock = NULL; + faceBlock = nullptr; } bool QTBuilder::build(const char *shortname) { @@ -138,12 +138,12 @@ bool QTBuilder::build(const char *shortname) { archive = new PFSLoader(); fff = fopen(bufs, "rb"); - if(fff != NULL) + if(fff != nullptr) FileType = S3D; else { sprintf(bufs, "%s.eqg", shortname); fff = fopen(bufs, "rb"); - if(fff != NULL) + if(fff != nullptr) FileType = EQG; } @@ -160,17 +160,17 @@ bool QTBuilder::build(const char *shortname) { switch(FileType) { case S3D: fileloader = new WLDLoader(); - if(fileloader->Open(NULL, (char *) shortname, archive) == 0) { + if(fileloader->Open(nullptr, (char *) shortname, archive) == 0) { printf("Error reading WLD from %s\n", bufs); return(false); } break; case EQG: fileloader = new ZonLoader(); - if(fileloader->Open(NULL, (char *) shortname, archive) == 0) { + if(fileloader->Open(nullptr, (char *) shortname, archive) == 0) { delete fileloader; fileloader = new Zonv4Loader(); - if(fileloader->Open(NULL, (char *) shortname, archive) == 0) { + if(fileloader->Open(nullptr, (char *) shortname, archive) == 0) { printf("Error reading ZON/TER from %s\n", bufs); return(false); } @@ -296,7 +296,7 @@ bool QTBuilder::build(const char *shortname) { printf("Building quadtree.\n"); _root = new QTNode(this, minx, maxx, miny, maxy); - if(_root == NULL) { + if(_root == nullptr) { printf("Unable to allocate new QTNode.\n"); return(false); } @@ -332,13 +332,13 @@ bool QTBuilder::build(const char *shortname) { bool QTBuilder::writeMap(const char *file) { - if(_root == NULL) + if(_root == nullptr) return(false); printf("Writing map file.\n"); FILE *out = fopen(file, "wb"); - if(out == NULL) { + if(out == nullptr) { printf("Unable to open output file '%s'.\n", file); return(1); } @@ -370,7 +370,7 @@ bool QTBuilder::writeMap(const char *file) { //make our node blocks to write out... nodeHeader *nodes = new nodeHeader[head.node_count]; unsigned long *facelist = new unsigned long[head.facelist_count]; - if(nodes == NULL || facelist == NULL) { + if(nodes == nullptr || facelist == nullptr) { printf("Error allocating temporary memory for output.\n"); fclose(out); return(1); //no memory @@ -404,10 +404,10 @@ bool QTBuilder::writeMap(const char *file) { QTNode::QTNode(QTBuilder *b, float Tminx, float Tmaxx, float Tminy, float Tmaxy) { - node1 = NULL; - node2 = NULL; - node3 = NULL; - node4 = NULL; + node1 = nullptr; + node2 = nullptr; + node3 = nullptr; + node4 = nullptr; minx = Tminx; maxx = Tmaxx; miny = Tminy; @@ -423,18 +423,18 @@ QTNode::~QTNode() { } void QTNode::clearNodes() { - if(node1 != NULL) + if(node1 != nullptr) delete node1; - if(node2 != NULL) + if(node2 != nullptr) delete node2; - if(node3 != NULL) + if(node3 != nullptr) delete node3; - if(node4 != NULL) + if(node4 != nullptr) delete node4; - node1 = NULL; - node2 = NULL; - node3 = NULL; - node4 = NULL; + node1 = nullptr; + node2 = nullptr; + node3 = nullptr; + node4 = nullptr; } //assumes that both supplied arrays are big enough per countNodes/Facelists @@ -463,25 +463,25 @@ void QTNode::fillBlocks(nodeHeader *heads, unsigned long *flist, unsigned long & //branch node. head->flags = 0; - if(node1 != NULL) { + if(node1 != nullptr) { head->nodes[0] = hindex; node1->fillBlocks(heads, flist, hindex, findex); } else { head->nodes[0] = NODE_NONE; } - if(node2 != NULL) { + if(node2 != nullptr) { head->nodes[1] = hindex; node2->fillBlocks(heads, flist, hindex, findex); } else { head->nodes[1] = NODE_NONE; } - if(node3 != NULL) { + if(node3 != nullptr) { head->nodes[2] = hindex; node3->fillBlocks(heads, flist, hindex, findex); } else { head->nodes[2] = NODE_NONE; } - if(node4 != NULL) { + if(node4 != nullptr) { head->nodes[3] = hindex; node4->fillBlocks(heads, flist, hindex, findex); } else { @@ -492,26 +492,26 @@ void QTNode::fillBlocks(nodeHeader *heads, unsigned long *flist, unsigned long & unsigned long QTNode::countNodes() const { unsigned long c = 1; - if(node1 != NULL) + if(node1 != nullptr) c += node1->countNodes(); - if(node2 != NULL) + if(node2 != nullptr) c += node2->countNodes(); - if(node3 != NULL) + if(node3 != nullptr) c += node3->countNodes(); - if(node4 != NULL) + if(node4 != nullptr) c += node4->countNodes(); return(c); } unsigned long QTNode::countFacelists() const { unsigned long c = final? faces.size() : 0; - if(node1 != NULL) + if(node1 != nullptr) c += node1->countFacelists(); - if(node2 != NULL) + if(node2 != nullptr) c += node2->countFacelists(); - if(node3 != NULL) + if(node3 != nullptr) c += node3->countFacelists(); - if(node4 != NULL) + if(node4 != nullptr) c += node4->countFacelists(); return(c); } @@ -607,13 +607,13 @@ printf("Stopping (empty) on box (%.2f -> %.2f, %.2f -> %.2f) at depth %d with %d depth++; - if(node1 != NULL) + if(node1 != nullptr) node1->divideYourself(depth); - if(node2 != NULL) + if(node2 != nullptr) node2->divideYourself(depth); - if(node3 != NULL) + if(node3 != nullptr) node3->divideYourself(depth); - if(node4 != NULL) + if(node4 != nullptr) node4->divideYourself(depth); @@ -854,7 +854,7 @@ void QTNode::doSplit() { node2 = new QTNode(builder, minx, midx, midy, maxy); node3 = new QTNode(builder, minx, midx, miny, midy); node4 = new QTNode(builder, midx, maxx, miny, midy); - if(node1 == NULL || node2 == NULL || node3 == NULL || node4 == NULL) { + if(node1 == nullptr || node2 == nullptr || node3 == nullptr || node4 == nullptr) { printf("Error: unable to allocate new QTNode, giving up.\n"); return; } @@ -876,19 +876,19 @@ void QTNode::doSplit() { //clean up empty sets. if(node1->faces.size() == 0) { delete node1; - node1 = NULL; + node1 = nullptr; } if(node2->faces.size() == 0) { delete node2; - node2 = NULL; + node2 = nullptr; } if(node3->faces.size() == 0) { delete node3; - node3 = NULL; + node3 = nullptr; } if(node4->faces.size() == 0) { delete node4; - node4 = NULL; + node4 = nullptr; } } @@ -1178,8 +1178,8 @@ void QTBuilder::AddPlaceable(FileLoader *fileloader, char *ZoneFileName, bool Li for(int i = 0; i < fileloader->model_data.plac_count; ++i) { if(fileloader->model_data.placeable[i]->model==-1) continue; - // The model pointer should only really be NULL for the zone model, as we process that separately. - if(fileloader->model_data.models[fileloader->model_data.placeable[i]->model] == NULL) continue; + // The model pointer should only really be nullptr for the zone model, as we process that separately. + if(fileloader->model_data.models[fileloader->model_data.placeable[i]->model] == nullptr) continue; if(ListPlaceable) printf("Placeable Object %4d @ (%9.2f, %9.2f, %9.2f uses model %4d %s\n",i, fileloader->model_data.placeable[i]->y, diff --git a/utils/azone2/dat.cpp b/utils/azone2/dat.cpp index 4d1dc8459..0dad16ffa 100644 --- a/utils/azone2/dat.cpp +++ b/utils/azone2/dat.cpp @@ -125,9 +125,9 @@ int AddModelName(Content_3D *C3D, string ModelName) DATLoader::DATLoader() { - this->buffer = NULL; + this->buffer = nullptr; this->buf_len = -1; - this->archive = NULL; + this->archive = nullptr; this->status = 0; } diff --git a/utils/azone2/global.hpp b/utils/azone2/global.hpp index 59ffbc9c6..968ac4825 100644 --- a/utils/azone2/global.hpp +++ b/utils/azone2/global.hpp @@ -9,8 +9,8 @@ #include #endif -#ifndef NULL -#define NULL 0 +#ifndef nullptr +#define nullptr 0 #endif typedef unsigned long uint32; diff --git a/utils/azone2/listobj.cpp b/utils/azone2/listobj.cpp index 40d603230..687355e69 100644 --- a/utils/azone2/listobj.cpp +++ b/utils/azone2/listobj.cpp @@ -70,12 +70,12 @@ bool ProcessZoneFile(const char *shortname) { archive = new PFSLoader(); fff = fopen(bufs, "rb"); - if(fff != NULL) + if(fff != nullptr) FileType = S3D; else { sprintf(bufs, "%s.eqg", shortname); fff = fopen(bufs, "rb"); - if(fff != NULL) + if(fff != nullptr) FileType = EQG; } @@ -94,7 +94,7 @@ bool ProcessZoneFile(const char *shortname) { switch(FileType) { case S3D: fileloader = new WLDLoader(); - if(fileloader->Open(NULL, (char *) shortname, archive) == 0) { + if(fileloader->Open(nullptr, (char *) shortname, archive) == 0) { printf("Error reading WLD from %s\n", bufs); return(false); } @@ -102,10 +102,10 @@ bool ProcessZoneFile(const char *shortname) { case EQG: fileloader = new ZonLoader(); - if(fileloader->Open(NULL, (char *) shortname, archive) == 0) { + if(fileloader->Open(nullptr, (char *) shortname, archive) == 0) { delete fileloader; fileloader = new Zonv4Loader(); - if(fileloader->Open(NULL, (char *) shortname, archive) == 0) { + if(fileloader->Open(nullptr, (char *) shortname, archive) == 0) { printf("Error reading ZON/TER from %s\n", bufs); return(false); } @@ -131,7 +131,7 @@ void ListPlaceable(FileLoader *fileloader, char *ZoneFileName) { for(int i = 0; i < fileloader->model_data.plac_count; ++i) { if(fileloader->model_data.placeable[i]->model==-1) continue; - if(fileloader->model_data.models[fileloader->model_data.placeable[i]->model] == NULL) continue; + if(fileloader->model_data.models[fileloader->model_data.placeable[i]->model] == nullptr) continue; printf("Placeable Object %4d @ (%9.2f, %9.2f, %9.2f uses model %4d %s\n",i, fileloader->model_data.placeable[i]->y, fileloader->model_data.placeable[i]->x, diff --git a/utils/azone2/pfs.cpp b/utils/azone2/pfs.cpp index 8575f8440..c58816d5e 100644 --- a/utils/azone2/pfs.cpp +++ b/utils/azone2/pfs.cpp @@ -67,7 +67,7 @@ inline void Lower(char *str) { PFSLoader::PFSLoader() { // Set the status of the loader that nothing is loaded. - this->buffer = NULL; + this->buffer = nullptr; this->buf_len = -1; this->status = 0; } @@ -195,7 +195,7 @@ int PFSLoader::Close() else return 0; - this->buffer = NULL; + this->buffer = nullptr; this->buf_len = -1; this->status = 0; @@ -214,7 +214,7 @@ const char *PFSLoader::FindExtension(const char *ext) { if(!strcmp(this->filenames[i]+(flen-elen), ext)) return(this->filenames[i]); } - return(NULL); + return(nullptr); } int PFSLoader::GetFile(char *name, uchar **buf, int *len) { diff --git a/utils/azone2/ter.cpp b/utils/azone2/ter.cpp index dc6c1c0f5..c2e021e4f 100644 --- a/utils/azone2/ter.cpp +++ b/utils/azone2/ter.cpp @@ -10,9 +10,9 @@ //#define DEBUGTER TERLoader::TERLoader() { - this->buffer = NULL; + this->buffer = nullptr; this->buf_len = -1; - this->archive = NULL; + this->archive = nullptr; this->status = 0; } @@ -84,8 +84,8 @@ int TERLoader::Open(char *base_path, char *zone_name, Archive *archive) { return 0; for(i = 0; i < thdr->mat_count; ++i) { - mlist[i].name = NULL; - mlist[i].basetex = NULL; + mlist[i].name = nullptr; + mlist[i].basetex = nullptr; } StartOfNameList = buffer; diff --git a/utils/azone2/wld.cpp b/utils/azone2/wld.cpp index 143af6474..0fddac191 100644 --- a/utils/azone2/wld.cpp +++ b/utils/azone2/wld.cpp @@ -25,7 +25,7 @@ FRAG_CONSTRUCTOR(Data03) { tex->filenames = new char *[count]; tex->frame_count = count; tex->current_frame = 0; - tex->archive = NULL; + tex->archive = nullptr; tex->flags = 0; for(i = 0; i < count; ++i) { @@ -64,7 +64,7 @@ FRAG_CONSTRUCTOR(Data04) { tex = new Texture; tex->frame_count = count; tex->current_frame = 0; - tex->archive = NULL; + tex->archive = nullptr; tex->filenames = new char *[count]; tex->flags = 0; @@ -272,7 +272,7 @@ FRAG_CONSTRUCTOR(Data30) { tex->current_frame = 0; tex->filenames = new char *[1]; tex->filenames[0] = "collide.dds"; - tex->archive = NULL; + tex->archive = nullptr; tex->flags = 1; this->frag = (void *) tex; return; @@ -478,19 +478,19 @@ int WLDLoader::Open(char *base_path, char *zone_name, Archive *archive) { #ifdef DEBUGWLD printf("Zone: %s\n", zone_name); #endif - this->model_data.zone_model = NULL; + this->model_data.zone_model = nullptr; this->model_data.plac_count = 0; this->model_data.placeable = 0; - this->obj_loader = this->plac_loader = NULL; + this->obj_loader = this->plac_loader = nullptr; this->clear_plac = 0; filename = new char[strlen(zone_name) + 5]; sprintf(filename, "%s.wld", zone_name); - if(!GetFile(&buffer, &buf_len, NULL, filename, archive)) { + if(!GetFile(&buffer, &buf_len, nullptr, filename, archive)) { delete[] filename; return 0; } @@ -635,7 +635,7 @@ int WLDLoader::Open(char *base_path, char *zone_name, Archive *archive) { sprintf(filename, "%s_obj", zone_name); this->obj_loader = new WLDLoader(); - this->obj_loader->Open(NULL, filename, obj_archive); + this->obj_loader->Open(nullptr, filename, obj_archive); delete[] filename; @@ -643,7 +643,7 @@ int WLDLoader::Open(char *base_path, char *zone_name, Archive *archive) { this->model_data.models = this->obj_loader->model_data.models; this->plac_loader = new WLDLoader(); - this->plac_loader->Open(NULL, "objects", archive); + this->plac_loader->Open(nullptr, "objects", archive); if(this->model_data.plac_count) { delete this->model_data.placeable[0]; diff --git a/utils/azone2/zon.cpp b/utils/azone2/zon.cpp index 0f7d43bd3..82e5812b4 100644 --- a/utils/azone2/zon.cpp +++ b/utils/azone2/zon.cpp @@ -12,9 +12,9 @@ //#define DEBUGPLAC ZonLoader::ZonLoader() { - this->buffer = NULL; + this->buffer = nullptr; this->buf_len = -1; - this->archive = NULL; + this->archive = nullptr; this->status = 0; } @@ -112,7 +112,7 @@ int ZonLoader::Open(char *base_path, char *zone_name, Archive *archive) { #ifdef DEBUGEQG printf("Found .TER file %s\n", (char *)buffer); #endif - this->terloader.Open(NULL, (char *) buffer, archive); + this->terloader.Open(nullptr, (char *) buffer, archive); buffer = StartOfModelNames; this->model_data.zone_model = terloader.model_data.zone_model; @@ -267,11 +267,11 @@ int ZonLoader::Open(char *base_path, char *zone_name, Archive *archive) { // if(!(strcmp(model_names[j]+strlen(model_names[j])-3, "ter"))) { // printf("Skipping .TER file at model number %d\n", j); - this->model_data.models[j] = NULL; + this->model_data.models[j] = nullptr; continue; } // printf("Attempting to open MOD file %s\n", model_names[j]); fflush(stdout); - if(model_loaders[j].Open(NULL, model_names[j], archive)) { + if(model_loaders[j].Open(nullptr, model_names[j], archive)) { this->model_data.models[j] = new Model; this->model_data.models[j]->vert_count = model_loaders[j].model_data.zone_model->vert_count; @@ -305,7 +305,7 @@ int ZonLoader::Open(char *base_path, char *zone_name, Archive *archive) { for(k = 0; k < j; ++k) { if(!this->model_data.models[k]) { #ifdef DEBUGEQG - printf("NULL this->model_data.models[k])\n"); + printf("nullptr this->model_data.models[k])\n"); #endif continue; } @@ -324,7 +324,7 @@ int ZonLoader::Open(char *base_path, char *zone_name, Archive *archive) { } } } - else this->model_data.models[j] = NULL; + else this->model_data.models[j] = nullptr; } // printf("Tex count is %i %X\n", tex_count, tex_count); @@ -336,7 +336,7 @@ int ZonLoader::Open(char *base_path, char *zone_name, Archive *archive) { for(i = 0; i < this->model_data.model_count; ++i) { if(!this->model_data.models[i]) { #ifdef DEBUGEQG - printf("NULL this->model_data.models[i])\n"); + printf("nullptr this->model_data.models[i])\n"); #endif continue; } @@ -364,7 +364,7 @@ int ZonLoader::Open(char *base_path, char *zone_name, Archive *archive) { for(i = 0; i < this->model_data.model_count; ++i) { if(!this->model_data.models[i]) { #ifdef DEBUGEQG - printf(">NULL this->model_data.models[i])\n"); + printf(">nullptr this->model_data.models[i])\n"); #endif continue; } diff --git a/utils/azone2/zonv4.cpp b/utils/azone2/zonv4.cpp index 71a6d258f..40abc53d3 100644 --- a/utils/azone2/zonv4.cpp +++ b/utils/azone2/zonv4.cpp @@ -13,9 +13,9 @@ string GetToken(uchar *&Buffer, int &Position); Zonv4Loader::Zonv4Loader() { - this->buffer = NULL; + this->buffer = nullptr; this->buf_len = -1; - this->archive = NULL; + this->archive = nullptr; this->status = 0; } @@ -94,7 +94,7 @@ int Zonv4Loader::Open(char *base_path, char *zone_name, Archive *archive) } } - this->datloader.Open(NULL, ZonName, archive); + this->datloader.Open(nullptr, ZonName, archive); this->model_data.zone_model = datloader.model_data.zone_model; @@ -118,7 +118,7 @@ int Zonv4Loader::Open(char *base_path, char *zone_name, Archive *archive) ++str; } - if(model_loaders[i].Open(NULL, tmp, archive)) + if(model_loaders[i].Open(nullptr, tmp, archive)) { this->model_data.models[i] = new Model; this->model_data.models[i]->vert_count = model_loaders[i].model_data.zone_model->vert_count; diff --git a/world/AdventureManager.cpp b/world/AdventureManager.cpp index b415b83f8..d6e03ee0e 100644 --- a/world/AdventureManager.cpp +++ b/world/AdventureManager.cpp @@ -553,7 +553,7 @@ bool AdventureManager::IsInExcludedZoneInList(list excluded_zon Adventure **AdventureManager::GetFinishedAdventures(const char *player, int &count) { - Adventure **ret = NULL; + Adventure **ret = nullptr; count = 0; list::iterator iter = adventure_list.begin(); @@ -598,7 +598,7 @@ Adventure *AdventureManager::GetActiveAdventure(const char *player) } iter++; } - return NULL; + return nullptr; } AdventureTemplate *AdventureManager::GetAdventureTemplate(int theme, int id) @@ -606,7 +606,7 @@ AdventureTemplate *AdventureManager::GetAdventureTemplate(int theme, int id) map >::iterator iter = adventure_entries.find(theme); if(iter == adventure_entries.end()) { - return NULL; + return nullptr; } list::iterator l_iter = (*iter).second.begin(); @@ -618,7 +618,7 @@ AdventureTemplate *AdventureManager::GetAdventureTemplate(int theme, int id) } l_iter++; } - return NULL; + return nullptr; } AdventureTemplate *AdventureManager::GetAdventureTemplate(int id) @@ -626,7 +626,7 @@ AdventureTemplate *AdventureManager::GetAdventureTemplate(int id) map::iterator iter = adventure_templates.find(id); if(iter == adventure_templates.end()) { - return NULL; + return nullptr; } return iter->second; @@ -710,7 +710,7 @@ bool AdventureManager::LoadAdventureEntries() { int id = atoi(row[0]); int template_id = atoi(row[1]); - AdventureTemplate* tid = NULL; + AdventureTemplate* tid = nullptr; map::iterator t_iter = adventure_templates.find(template_id); if(t_iter == adventure_templates.end()) @@ -842,7 +842,7 @@ void AdventureManager::LeaveAdventure(const char *name) void AdventureManager::IncrementCount(uint16 instance_id) { list::iterator iter = adventure_list.begin(); - Adventure *current = NULL; + Adventure *current = nullptr; while(iter != adventure_list.end()) { if((*iter)->GetInstanceID() == instance_id) @@ -882,7 +882,7 @@ void AdventureManager::IncrementCount(uint16 instance_id) void AdventureManager::IncrementAssassinationCount(uint16 instance_id) { list::iterator iter = adventure_list.begin(); - Adventure *current = NULL; + Adventure *current = nullptr; while(iter != adventure_list.end()) { if((*iter)->GetInstanceID() == instance_id) @@ -903,7 +903,7 @@ void AdventureManager::IncrementAssassinationCount(uint16 instance_id) void AdventureManager::GetZoneData(uint16 instance_id) { list::iterator iter = adventure_list.begin(); - Adventure *current = NULL; + Adventure *current = nullptr; while(iter != adventure_list.end()) { if((*iter)->GetInstanceID() == instance_id) @@ -2183,7 +2183,7 @@ void AdventureManager::Load() //disabled for now return; - char *data = NULL; + char *data = nullptr; FILE *f = fopen("adventure_state.dat", "r"); if(f) { diff --git a/world/EQLConfig.cpp b/world/EQLConfig.cpp index 7375bd65e..fe88008d6 100644 --- a/world/EQLConfig.cpp +++ b/world/EQLConfig.cpp @@ -88,7 +88,7 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) { namebuf, dynamic_count), errbuf)) { LogFile->write(EQEMuLog::Error, "Error in CreateLauncher query: %s", errbuf); safe_delete_array(query); - return NULL; + return nullptr; } safe_delete_array(query); @@ -107,7 +107,7 @@ void EQLConfig::GetZones(std::vector &result) { vector EQLConfig::ListZones() { LauncherLink *ll = launcher_list.Get(m_name.c_str()); vector res; - if(ll == NULL) { + if(ll == nullptr) { //if the launcher isnt connected, use the list from the database. map::iterator cur, end; cur = m_zones.begin(); @@ -154,26 +154,26 @@ void EQLConfig::DeleteLauncher() { bool EQLConfig::IsConnected() const { LauncherLink *ll = launcher_list.Get(m_name.c_str()); - return(ll != NULL); + return(ll != nullptr); } void EQLConfig::RestartZone(Const_char *zone_ref) { LauncherLink *ll = launcher_list.Get(m_name.c_str()); - if(ll == NULL) + if(ll == nullptr) return; ll->RestartZone(zone_ref); } void EQLConfig::StopZone(Const_char *zone_ref) { LauncherLink *ll = launcher_list.Get(m_name.c_str()); - if(ll == NULL) + if(ll == nullptr) return; ll->StopZone(zone_ref); } void EQLConfig::StartZone(Const_char *zone_ref) { LauncherLink *ll = launcher_list.Get(m_name.c_str()); - if(ll == NULL) + if(ll == nullptr) return; ll->StartZone(zone_ref); } @@ -211,7 +211,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) { //if the launcher is connected, update it. LauncherLink *ll = launcher_list.Get(m_name.c_str()); - if(ll != NULL) { + if(ll != nullptr) { ll->BootZone(short_name, port); } @@ -259,7 +259,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { //if the launcher is connected, update it. LauncherLink *ll = launcher_list.Get(m_name.c_str()); - if(ll != NULL) { + if(ll != nullptr) { ll->RestartZone(short_name); } @@ -301,7 +301,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { //if the launcher is connected, update it. LauncherLink *ll = launcher_list.Get(m_name.c_str()); - if(ll != NULL) { + if(ll != nullptr) { ll->StopZone(short_name); } @@ -330,7 +330,7 @@ bool EQLConfig::SetDynamicCount(int count) { //if the launcher is connected, update it. LauncherLink *ll = launcher_list.Get(m_name.c_str()); - if(ll != NULL) { + if(ll != nullptr) { ll->BootDynamics(count); } @@ -345,7 +345,7 @@ map EQLConfig::GetZoneDetails(Const_char *zone_ref) { map res; LauncherLink *ll = launcher_list.Get(m_name.c_str()); - if(ll == NULL) { + if(ll == nullptr) { res["name"] = zone_ref; res["up"] = "0"; res["starts"] = "0"; diff --git a/world/EQW.cpp b/world/EQW.cpp index c97fcd652..4f7eef3fc 100644 --- a/world/EQW.cpp +++ b/world/EQW.cpp @@ -138,7 +138,7 @@ map EQW::GetZoneDetails(Const_char *zone_ref) { map res; ZoneServer *zs = zoneserver_list.FindByID(atoi(zone_ref)); - if(zs == NULL) { + if(zs == nullptr) { res["error"] = "Invalid zone."; return(res); } @@ -156,7 +156,7 @@ map EQW::GetZoneDetails(Const_char *zone_ref) { res["launcher"] = ""; if(zs->GetZoneID() != 0) { LauncherLink *ll = launcher_list.FindByZone(zs->GetLaunchName()); - if(ll != NULL) + if(ll != nullptr) res["launcher"] = ll->GetName(); } @@ -187,7 +187,7 @@ map EQW::GetPlayerDetails(Const_char *char_name) { map res; ClientListEntry *cle = client_list.FindCharacter(char_name); - if(cle == NULL) { + if(cle == nullptr) { res["error"] = "1"; return(res); } @@ -270,17 +270,17 @@ void EQW::CreateLauncher(Const_char *launcher_name, int dynamic_count) { void EQW::LSReconnect() { #ifdef _WINDOWS - _beginthread(AutoInitLoginServer, 0, NULL); + _beginthread(AutoInitLoginServer, 0, nullptr); #else pthread_t thread; - pthread_create(&thread, NULL, &AutoInitLoginServer, NULL); + pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr); #endif RunLoops = true; _log(WORLD__CONSOLE,"Login Server Reconnect manually restarted by Web Tool"); } /*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) { - return(NULL); + return(nullptr); }*/ /* @@ -288,7 +288,7 @@ map EQW::GetLaunchersDetails(Const_char *launcher_name) { map res; LauncherLink *ll = launcher_list.Get(launcher_name); - if(ll == NULL) { + if(ll == nullptr) { res["name"] = launcher_name; res["ip"] = "Not Connected"; res["id"] = "0"; @@ -309,7 +309,7 @@ map EQW::GetLaunchersDetails(Const_char *launcher_name) { vector EQW::ListLauncherZones(Const_char *launcher_name) { vector list; LauncherLink *ll = launcher_list.Get(launcher_name); - if(ll != NULL) { + if(ll != nullptr) { ll->GetZoneList(list); } return(list); @@ -318,7 +318,7 @@ vector EQW::ListLauncherZones(Const_char *launcher_name) { map EQW::GetLauncherZoneDetails(Const_char *launcher_name, Const_char *zone_ref) { map res; LauncherLink *ll = launcher_list.Get(launcher_name); - if(ll != NULL) { + if(ll != nullptr) { ll->GetZoneDetails(zone_ref, res); } else { res["error"] = "Launcher Not Found"; diff --git a/world/EQWHTTPHandler.cpp b/world/EQWHTTPHandler.cpp index 4212981d6..7e46ddd81 100644 --- a/world/EQWHTTPHandler.cpp +++ b/world/EQWHTTPHandler.cpp @@ -29,7 +29,7 @@ using namespace std; Mime EQWHTTPHandler::s_mime; #ifdef EMBPERL -EQWParser *EQWHTTPHandler::s_parser = NULL; +EQWParser *EQWHTTPHandler::s_parser = nullptr; #endif const int EQWHTTPHandler::READ_BUFFER_LEN = 1024; //for page IO, was a static const member, but VC6 got mad. @@ -45,7 +45,7 @@ EQWHTTPHandler::~EQWHTTPHandler() { #ifdef EMBPERL EQWParser *EQWHTTPHandler::GetParser() { - if(s_parser == NULL) { + if(s_parser == nullptr) { EQW::Singleton()->ClearOutput(); s_parser = new EQWParser(); const string &res = EQW::Singleton()->GetOutput(); @@ -158,7 +158,7 @@ void EQWHTTPHandler::SendPage(const std::string &file) { path += file; FILE *f = fopen(path.c_str(), "rb"); - if(f == NULL) { + if(f == nullptr) { SendResponse("404", "Not Found"); SendString("Not found."); printf("%s not found.\n", file.c_str()); @@ -203,7 +203,7 @@ void EQWHTTPHandler::SendPage(const std::string &file) { ProcessAndSend(to_process); //clear out the form, just in case (since it gets destroyed next) - GetParser()->SetHTTPRequest("testing", NULL); + GetParser()->SetHTTPRequest("testing", nullptr); } #endif } @@ -315,7 +315,7 @@ bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { #ifdef _WINDOWS _beginthread(ThreadProc, 0, this); #else - pthread_create(&m_thread, NULL, ThreadProc, this); + pthread_create(&m_thread, nullptr, ThreadProc, this); #endif*/ return(true); @@ -333,7 +333,7 @@ void EQWHTTPServer::Run() { ThreadReturnType EQWHTTPServer::ThreadProc(void *data) { ((EQWHTTPServer *) data)->Run(); - THREAD_RETURN(NULL); + THREAD_RETURN(nullptr); }*/ diff --git a/world/EQWParser.cpp b/world/EQWParser.cpp index b6bc63ac3..2ad5e1d4b 100644 --- a/world/EQWParser.cpp +++ b/world/EQWParser.cpp @@ -76,12 +76,12 @@ EQWParser::EQWParser() { void EQWParser::DoInit() { const char *argv_eqemu[] = { "", "-w", "-W", - "-e", "0;", NULL }; + "-e", "0;", nullptr }; int argc = 5; char **argv = (char **)argv_eqemu; - char **env = { NULL }; + char **env = { nullptr }; PL_perl_destruct_level = 1; @@ -151,7 +151,7 @@ void EQWParser::DoInit() { //make sure the EQW pointer is set up in this package EQW *curc = EQW::Singleton(); SV *l = get_sv("world::EQW", true); - if(curc != NULL) { + if(curc != nullptr) { sv_setref_pv(l, "EQW", curc); } else { //clear out the value, mainly to get rid of blessedness @@ -162,7 +162,7 @@ void EQWParser::DoInit() { EQDB::SetMySQL(database.getMySQL()); EQDB *curc_db = EQDB::Singleton(); SV *l_db = get_sv("world::EQDB", true); - if(curc_db != NULL) { + if(curc_db != nullptr) { sv_setref_pv(l_db, "EQDB", curc_db); } else { //clear out the value, mainly to get rid of blessedness @@ -272,7 +272,7 @@ void EQWParser::EQW_eval(const char *pkg, const char *code) { snprintf(namebuf, 64, "EQW"); // snprintf(namebuf, 64, "%s::EQW", pkg); SV *l = get_sv(namebuf, true); - if(curc != NULL) { + if(curc != nullptr) { sv_setref_pv(l, "EQW", curc); } else { //clear out the value, mainly to get rid of blessedness @@ -283,7 +283,7 @@ void EQWParser::EQW_eval(const char *pkg, const char *code) { snprintf(namebuf, 64, "EQDB"); // snprintf(namebuf, 64, "%s::EQW", pkg); SV *l_db = get_sv(namebuf, true); - if(curc_db != NULL) { + if(curc_db != nullptr) { sv_setref_pv(l_db, "EQDB", curc_db); } else { //clear out the value, mainly to get rid of blessedness @@ -305,7 +305,7 @@ void EQWParser::SetHTTPRequest(const char *pkg, HTTPRequest *it) { snprintf(namebuf, 64, "request"); // snprintf(namebuf, 64, "%s::EQW", pkg); SV *l = get_sv(namebuf, true); - if(it != NULL) { + if(it != nullptr) { sv_setref_pv(l, "HTTPRequest", it); } else { //clear out the value, mainly to get rid of blessedness diff --git a/world/LauncherLink.cpp b/world/LauncherLink.cpp index f89d1bbb7..186124929 100644 --- a/world/LauncherLink.cpp +++ b/world/LauncherLink.cpp @@ -127,7 +127,7 @@ bool LauncherLink::Process() { m_name = it->name; EQLConfig *config = launcher_list.GetConfig(m_name.c_str()); - if(config == NULL) { + if(config == nullptr) { _log(WORLD__LAUNCH, "Unknown launcher '%s' connected. Disconnecting.", it->name); Disconnect(); break; diff --git a/world/LauncherList.cpp b/world/LauncherList.cpp index 79f513946..28d286fc6 100644 --- a/world/LauncherList.cpp +++ b/world/LauncherList.cpp @@ -108,7 +108,7 @@ LauncherLink *LauncherList::Get(const char *name) { map::iterator res; res = m_launchers.find(name); if(res == m_launchers.end()) - return(NULL); + return(nullptr); return(res->second); /* string goal(name); @@ -119,7 +119,7 @@ LauncherLink *LauncherList::Get(const char *name) { if(goal == (*cur)->GetName()) return(*cur); } - return(NULL);*/ + return(nullptr);*/ } LauncherLink *LauncherList::FindByZone(const char *short_name) { @@ -130,7 +130,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) { if(cur->second->ContainsZone(short_name)) return(cur->second); } - return(NULL); + return(nullptr); } void LauncherList::Add(EmuTCPConnection *conn) { @@ -170,7 +170,7 @@ EQLConfig *LauncherList::GetConfig(const char *name) { map::iterator res; res = m_configs.find(name); if(res == m_configs.end()) { - return(NULL); + return(nullptr); } return(res->second); } diff --git a/world/WorldConfig.cpp b/world/WorldConfig.cpp index 571084328..13433e387 100644 --- a/world/WorldConfig.cpp +++ b/world/WorldConfig.cpp @@ -18,7 +18,7 @@ #include "../common/debug.h" #include "WorldConfig.h" -WorldConfig *WorldConfig::_world_config = NULL; +WorldConfig *WorldConfig::_world_config = nullptr; string WorldConfig::GetByName(const string &var_name) const { diff --git a/world/WorldConfig.h b/world/WorldConfig.h index 6b97ccb18..750f1a22d 100644 --- a/world/WorldConfig.h +++ b/world/WorldConfig.h @@ -40,14 +40,14 @@ public: // Produce a const singleton static const WorldConfig *get() { - if (_world_config == NULL) + if (_world_config == nullptr) LoadConfig(); return(_world_config); } // Load the config static bool LoadConfig() { - if (_world_config != NULL) + if (_world_config != nullptr) delete _world_config; _world_config=new WorldConfig; _config=_world_config; diff --git a/world/client.cpp b/world/client.cpp index 5f47d36eb..f082a22e7 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1073,7 +1073,7 @@ void Client::EnterWorld(bool TryBootup) { if (zoneID == 0) return; - ZoneServer* zs = NULL; + ZoneServer* zs = nullptr; if(instanceID > 0) { if(database.VerifyInstanceAlive(instanceID, GetCharID())) @@ -1085,7 +1085,7 @@ void Client::EnterWorld(bool TryBootup) { else { instanceID = 0; - zs = NULL; + zs = nullptr; database.MoveCharacterToBind(GetCharID()); ZoneUnavail(); return; @@ -1094,7 +1094,7 @@ void Client::EnterWorld(bool TryBootup) { else { instanceID = 0; - zs = NULL; + zs = nullptr; database.MoveCharacterToBind(GetCharID()); ZoneUnavail(); return; @@ -1159,7 +1159,7 @@ void Client::EnterWorld(bool TryBootup) { void Client::Clearance(int8 response) { - ZoneServer* zs = NULL; + ZoneServer* zs = nullptr; if(instanceID > 0) { zs = zoneserver_list.FindByInstanceID(instanceID); @@ -1184,21 +1184,21 @@ void Client::Clearance(int8 response) EQApplicationPacket* outapp; - if (zs->GetCAddress() == NULL) { + if (zs->GetCAddress() == nullptr) { clog(WORLD__CLIENT_ERR, "Unable to do zs->GetCAddress() in Client::Clearance!!"); ZoneUnavail(); return; } if (zoneID == 0) { - clog(WORLD__CLIENT_ERR, "zoneID is NULL in Client::Clearance!!"); + clog(WORLD__CLIENT_ERR, "zoneID is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } const char* zonename = database.GetZoneName(zoneID); if (zonename == 0) { - clog(WORLD__CLIENT_ERR, "zonename is NULL in Client::Clearance!!"); + clog(WORLD__CLIENT_ERR, "zonename is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } @@ -1252,7 +1252,7 @@ void Client::ZoneUnavail() { } bool Client::GenPassKey(char* key) { - char* passKey=NULL; + char* passKey=nullptr; *passKey += ((char)('A'+((int)MakeRandomInt(0, 25)))); *passKey += ((char)('A'+((int)MakeRandomInt(0, 25)))); memcpy(key, passKey, strlen(passKey)); @@ -1273,7 +1273,7 @@ void Client::SendGuildList() { //ask the guild manager to build us a nice guild list packet outapp->pBuffer = guild_mgr.MakeGuildList("", outapp->size); - if(outapp->pBuffer == NULL) { + if(outapp->pBuffer == nullptr) { clog(GUILDS__ERROR, "Unable to make guild list!"); return; } @@ -1353,7 +1353,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) PlayerProfile_Struct pp; ExtendedProfile_Struct ext; Inventory inv; - time_t bday = time(NULL); + time_t bday = time(nullptr); char startzone[50]={0}; uint32 i; struct in_addr in; diff --git a/world/clientlist.cpp b/world/clientlist.cpp index 0728745e7..986f763e7 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -769,14 +769,14 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon // FriendsString is a comma delimited list of names. - char *Seperator = NULL; + char *Seperator = nullptr; Seperator = strchr(FriendsPointer, ','); if(!Seperator) Seperator = strchr(FriendsPointer, '\0'); uint32 TotalLength=0; - while(Seperator != NULL) { + while(Seperator != nullptr) { if((Seperator - FriendsPointer) > 64) return; @@ -1216,15 +1216,15 @@ bool ClientList::SendPacket(const char* to, ServerPacket* pack) { } else { ClientListEntry* cle = FindCharacter(to); - if (cle != NULL) { - if (cle->Server() != NULL) { + if (cle != nullptr) { + if (cle->Server() != nullptr) { cle->Server()->SendPacket(pack); return true; } return false; } else { ZoneServer* zs = zoneserver_list.FindByName(to); - if (zs != NULL) { + if (zs != nullptr) { zs->SendPacket(pack); return true; } diff --git a/world/console.cpp b/world/console.cpp index 15d580660..d6b1a2414 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -781,10 +781,10 @@ void Console::ProcessCommand(const char* command) { } else if (strcasecmp(sep.arg[0], "LSReconnect") == 0 && admin >= 100) { #ifdef _WINDOWS - _beginthread(AutoInitLoginServer, 0, NULL); + _beginthread(AutoInitLoginServer, 0, nullptr); #else pthread_t thread; - pthread_create(&thread, NULL, &AutoInitLoginServer, NULL); + pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr); #endif RunLoops = true; SendMessage(1, " Login Server Reconnect manually restarted by Console"); diff --git a/world/lfplist.cpp b/world/lfplist.cpp index da1c43a1c..b21378ffa 100644 --- a/world/lfplist.cpp +++ b/world/lfplist.cpp @@ -265,13 +265,13 @@ void GroupLFPList::SendLFPMatches(ServerLFPMatchesRequest_Struct* smrs) { } ClientListEntry* CLE = client_list.FindCharacter(smrs->FromName); - if (CLE != NULL) { - if (CLE->Server() != NULL) + if (CLE != nullptr) { + if (CLE->Server() != nullptr) CLE->Server()->SendPacket(Pack); } else { ZoneServer* zs = zoneserver_list.FindByName(smrs->FromName); - if (zs != NULL) + if (zs != nullptr) zs->SendPacket(Pack); } safe_delete(Pack); diff --git a/world/net.cpp b/world/net.cpp index 0ad0febe4..4be92a893 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -111,7 +111,7 @@ UCSConnection UCSLink; QueryServConnection QSLink; LauncherList launcher_list; AdventureManager adventure_manager; -DBAsync *dbasync = NULL; +DBAsync *dbasync = nullptr; volatile bool RunLoops = true; uint32 numclients = 0; uint32 numzones = 0; @@ -468,10 +468,10 @@ int main(int argc, char** argv) { ReconnectCounter = 0; if (loginserverlist.AllConnected() == false) { #ifdef _WINDOWS - _beginthread(AutoInitLoginServer, 0, NULL); + _beginthread(AutoInitLoginServer, 0, nullptr); #else pthread_t thread; - pthread_create(&thread, NULL, &AutoInitLoginServer, NULL); + pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr); #endif } } diff --git a/world/perl_EQLConfig.cpp b/world/perl_EQLConfig.cpp index 63e4dba11..5d014447c 100644 --- a/world/perl_EQLConfig.cpp +++ b/world/perl_EQLConfig.cpp @@ -58,8 +58,8 @@ XS(XS_EQLConfig_GetName) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetName(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -84,8 +84,8 @@ XS(XS_EQLConfig_GetStaticCount) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetStaticCount(); XSprePUSH; PUSHi((IV)RETVAL); @@ -109,8 +109,8 @@ XS(XS_EQLConfig_IsConnected) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsConnected(); ST(0) = boolSV(RETVAL); @@ -134,8 +134,8 @@ XS(XS_EQLConfig_DeleteLauncher) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->DeleteLauncher(); } @@ -158,8 +158,8 @@ XS(XS_EQLConfig_RestartZone) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RestartZone(zone_ref); } @@ -182,8 +182,8 @@ XS(XS_EQLConfig_StopZone) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StopZone(zone_ref); } @@ -206,8 +206,8 @@ XS(XS_EQLConfig_StartZone) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StartZone(zone_ref); } @@ -232,8 +232,8 @@ XS(XS_EQLConfig_BootStaticZone) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->BootStaticZone(short_name, port); ST(0) = boolSV(RETVAL); @@ -260,8 +260,8 @@ XS(XS_EQLConfig_ChangeStaticZone) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->ChangeStaticZone(short_name, port); ST(0) = boolSV(RETVAL); @@ -287,8 +287,8 @@ XS(XS_EQLConfig_DeleteStaticZone) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DeleteStaticZone(short_name); ST(0) = boolSV(RETVAL); @@ -314,8 +314,8 @@ XS(XS_EQLConfig_SetDynamicCount) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetDynamicCount(count); ST(0) = boolSV(RETVAL); @@ -341,8 +341,8 @@ XS(XS_EQLConfig_GetDynamicCount) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDynamicCount(); XSprePUSH; PUSHi((IV)RETVAL); @@ -366,8 +366,8 @@ XS(XS_EQLConfig_ListZones) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->ListZones(); ST(0) = sv_newmortal(); @@ -407,8 +407,8 @@ XS(XS_EQLConfig_GetZoneDetails) } else Perl_croak(aTHX_ "THIS is not of type EQLConfig"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetZoneDetails(zone_ref); ST(0) = sv_newmortal(); @@ -425,7 +425,7 @@ XS(XS_EQLConfig_GetZoneDetails) for(; cur != end; cur++) { /* get the element from the hash, creating if needed (will be needed) */ SV**ele = hv_fetch(hv, cur->first.c_str(), cur->first.length(), TRUE); - if(ele == NULL) { + if(ele == nullptr) { Perl_croak(aTHX_ "Unable to create a hash element for RETVAL"); break; } diff --git a/world/perl_EQW.cpp b/world/perl_EQW.cpp index 6f748d720..fd23abc1d 100644 --- a/world/perl_EQW.cpp +++ b/world/perl_EQW.cpp @@ -59,8 +59,8 @@ XS(XS_EQW_GetConfig) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetConfig(var_name); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -83,8 +83,8 @@ XS(XS_EQW_LockWorld) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->LockWorld(); } @@ -106,8 +106,8 @@ XS(XS_EQW_UnlockWorld) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UnlockWorld(); } @@ -130,8 +130,8 @@ XS(XS_EQW_LSConnected) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->LSConnected(); ST(0) = boolSV(RETVAL); @@ -155,8 +155,8 @@ XS(XS_EQW_LSReconnect) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->LSReconnect(); } @@ -180,8 +180,8 @@ XS(XS_EQW_CountZones) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CountZones(); XSprePUSH; PUSHi((IV)RETVAL); @@ -205,8 +205,8 @@ XS(XS_EQW_ListBootedZones) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->ListBootedZones(); ST(0) = sv_newmortal(); @@ -246,8 +246,8 @@ XS(XS_EQW_GetZoneDetails) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetZoneDetails(zone_ref); ST(0) = sv_newmortal(); @@ -264,7 +264,7 @@ XS(XS_EQW_GetZoneDetails) for(; cur != end; cur++) { /* get the element from the hash, creating if needed (will be needed) */ SV**ele = hv_fetch(hv, cur->first.c_str(), cur->first.length(), TRUE); - if(ele == NULL) { + if(ele == nullptr) { Perl_croak(aTHX_ "Unable to create a hash element for RETVAL"); break; } @@ -310,8 +310,8 @@ XS(XS_EQW_CountPlayers) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CountPlayers(); XSprePUSH; PUSHi((IV)RETVAL); @@ -336,8 +336,8 @@ XS(XS_EQW_ListPlayers) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) zone_name = ""; @@ -383,8 +383,8 @@ XS(XS_EQW_GetPlayerDetails) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPlayerDetails(player_ref); ST(0) = sv_newmortal(); @@ -401,7 +401,7 @@ XS(XS_EQW_GetPlayerDetails) for(; cur != end; cur++) { /* get the element from the hash, creating if needed (will be needed) */ SV**ele = hv_fetch(hv, cur->first.c_str(), cur->first.length(), TRUE); - if(ele == NULL) { + if(ele == nullptr) { Perl_croak(aTHX_ "Unable to create a hash element for RETVAL"); break; } @@ -448,8 +448,8 @@ XS(XS_EQW_CountLaunchers) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CountLaunchers(active_only); XSprePUSH; PUSHi((IV)RETVAL); @@ -473,8 +473,8 @@ XS(XS_EQW_ListLaunchers) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->ListLaunchers(); ST(0) = sv_newmortal(); @@ -514,8 +514,8 @@ XS(XS_EQW_GetLauncher) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLauncher(launcher_name); ST(0) = sv_newmortal(); @@ -541,8 +541,8 @@ XS(XS_EQW_CreateLauncher) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->CreateLauncher(launcher_name, dynamic_count); } @@ -568,8 +568,8 @@ XS(XS_EQW_CreateGuild) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CreateGuild(name, leader_char_id); XSprePUSH; PUSHu((UV)RETVAL); @@ -594,8 +594,8 @@ XS(XS_EQW_DeleteGuild) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DeleteGuild(guild_id); ST(0) = boolSV(RETVAL); @@ -622,8 +622,8 @@ XS(XS_EQW_RenameGuild) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RenameGuild(guild_id, name); ST(0) = boolSV(RETVAL); @@ -651,8 +651,8 @@ XS(XS_EQW_SetGuildMOTD) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetGuildMOTD(guild_id, motd, setter); ST(0) = boolSV(RETVAL); @@ -679,8 +679,8 @@ XS(XS_EQW_SetGuildLeader) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetGuildLeader(guild_id, leader_char_id); ST(0) = boolSV(RETVAL); @@ -708,8 +708,8 @@ XS(XS_EQW_SetGuild) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetGuild(charid, guild_id, rank); ST(0) = boolSV(RETVAL); @@ -736,8 +736,8 @@ XS(XS_EQW_SetGuildRank) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetGuildRank(charid, rank); ST(0) = boolSV(RETVAL); @@ -764,8 +764,8 @@ XS(XS_EQW_SetBankerFlag) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetBankerFlag(charid, is_banker); ST(0) = boolSV(RETVAL); @@ -792,8 +792,8 @@ XS(XS_EQW_SetTributeFlag) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetTributeFlag(charid, enabled); ST(0) = boolSV(RETVAL); @@ -820,8 +820,8 @@ XS(XS_EQW_SetPublicNote) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetPublicNote(charid, note); ST(0) = boolSV(RETVAL); @@ -847,8 +847,8 @@ XS(XS_EQW_CountBugs) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CountBugs(); XSprePUSH; PUSHi((IV)RETVAL); @@ -874,8 +874,8 @@ XS(XS_EQW_ListBugs) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->ListBugs(id); ST(0) = sv_newmortal(); @@ -915,8 +915,8 @@ XS(XS_EQW_GetBugDetails) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBugDetails(bug_ref); ST(0) = sv_newmortal(); @@ -933,7 +933,7 @@ XS(XS_EQW_GetBugDetails) for(; cur != end; cur++) { /* get the element from the hash, creating if needed (will be needed) */ SV**ele = hv_fetch(hv, cur->first.c_str(), cur->first.length(), TRUE); - if(ele == NULL) { + if(ele == nullptr) { Perl_croak(aTHX_ "Unable to create a hash element for RETVAL"); break; } @@ -961,8 +961,8 @@ XS(XS_EQW_ResolveBug) } else Perl_croak(aTHX_ "THIS is not of type EQW"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ResolveBug(id); } diff --git a/world/perl_HTTPRequest.cpp b/world/perl_HTTPRequest.cpp index dec1a824b..139948be6 100644 --- a/world/perl_HTTPRequest.cpp +++ b/world/perl_HTTPRequest.cpp @@ -60,8 +60,8 @@ XS(XS_HTTPRequest_get) } else Perl_croak(aTHX_ "THIS is not of type HTTPRequest"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) default_value = ""; @@ -94,8 +94,8 @@ XS(XS_HTTPRequest_getInt) } else Perl_croak(aTHX_ "THIS is not of type HTTPRequest"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) default_value = 0; @@ -128,8 +128,8 @@ XS(XS_HTTPRequest_getFloat) } else Perl_croak(aTHX_ "THIS is not of type HTTPRequest"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) default_value = 0.0; @@ -162,8 +162,8 @@ XS(XS_HTTPRequest_getEscaped) } else Perl_croak(aTHX_ "THIS is not of type HTTPRequest"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) default_value = ""; @@ -193,8 +193,8 @@ XS(XS_HTTPRequest_get_all) } else Perl_croak(aTHX_ "THIS is not of type HTTPRequest"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->get_all(); ST(0) = sv_newmortal(); @@ -211,7 +211,7 @@ XS(XS_HTTPRequest_get_all) for(; cur != end; cur++) { /* get the element from the hash, creating if needed (will be needed) */ SV**ele = hv_fetch(hv, cur->first.c_str(), cur->first.length(), TRUE); - if(ele == NULL) { + if(ele == nullptr) { Perl_croak(aTHX_ "Unable to create a hash element for RETVAL"); break; } @@ -256,8 +256,8 @@ XS(XS_HTTPRequest_redirect) } else Perl_croak(aTHX_ "THIS is not of type HTTPRequest"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->redirect(URL); } @@ -280,8 +280,8 @@ XS(XS_HTTPRequest_SetResponseCode) } else Perl_croak(aTHX_ "THIS is not of type HTTPRequest"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetResponseCode(code); } @@ -305,8 +305,8 @@ XS(XS_HTTPRequest_header) } else Perl_croak(aTHX_ "THIS is not of type HTTPRequest"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->header(name, value); } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 08e585ca9..7f98746e2 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -95,7 +95,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct* cs->tutorial[char_num] = 1; if(RuleB(World, EnableReturnHomeButton)) { - int now = time(NULL); + int now = time(nullptr); if((now - pp->lastlogin) >= RuleI(World, MinOfflineTimeToReturnHome)) cs->gohome[char_num] = 1; } diff --git a/world/zonelist.cpp b/world/zonelist.cpp index c19a55c4d..e710cb912 100644 --- a/world/zonelist.cpp +++ b/world/zonelist.cpp @@ -656,7 +656,7 @@ uint32 ZSList::TriggerBootup(uint32 iZoneID, uint32 iInstanceID) { /*Old Random boot zones use this if your server is distributed across computers. LinkedListIterator iterator(list); - srand(time(NULL)); + srand(time(nullptr)); uint32 x = 0; iterator.Reset(); while(iterator.MoreElements()) { diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 2ccbfd61e..9be2c410d 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -95,7 +95,7 @@ bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { if (zn) { strn0cpy(zone_name, zn, sizeof(zone_name)); - if( database.GetZoneLongName( (char*)zone_name, &longname, NULL, NULL, NULL, NULL, NULL, NULL ) ) + if( database.GetZoneLongName( (char*)zone_name, &longname, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr ) ) { strn0cpy(long_name, longname, sizeof(long_name)); safe_delete_array( longname ); @@ -665,7 +665,7 @@ bool ZoneServer::Process() { if(pack->size != sizeof(ZoneToZone_Struct)) break; ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer; - ClientListEntry* client = NULL; + ClientListEntry* client = nullptr; if(WorldConfig::get()->UpdateStats) client = client_list.FindCharacter(ztz->name); @@ -688,7 +688,7 @@ bool ZoneServer::Process() { break; } - ZoneServer *ingress_server = NULL; + ZoneServer *ingress_server = nullptr; if(ztz->requested_instance_id > 0) { ingress_server = zoneserver_list.FindByInstanceID(ztz->requested_instance_id); @@ -731,7 +731,7 @@ bool ZoneServer::Process() { else // this is response from the ingress server, route it back to the egress server { zlog(WORLD__ZONE,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); - ZoneServer *egress_server = NULL; + ZoneServer *egress_server = nullptr; if(ztz->current_instance_id > 0) { egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id); diff --git a/zone/AA.cpp b/zone/AA.cpp index 05ffbb862..cb1c90f92 100644 --- a/zone/AA.cpp +++ b/zone/AA.cpp @@ -104,7 +104,7 @@ int Client::GetAATimerID(aaID activate) aa2 = zone->FindAA(a); - if(aa2 != NULL) + if(aa2 != nullptr) break; } } @@ -148,7 +148,7 @@ void Client::ActivateAA(aaID activate){ int AATimerID = GetAATimerID(activate); - SendAA_Struct* aa2 = NULL; + SendAA_Struct* aa2 = nullptr; aaID aaid = activate; uint8 activate_val = GetAA(activate); //this wasn't taking into acct multi tiered act talents before... @@ -163,7 +163,7 @@ void Client::ActivateAA(aaID activate){ break; aa2 = zone->FindAA(a); - if(aa2 != NULL) + if(aa2 != nullptr) break; } } @@ -237,7 +237,7 @@ void Client::ActivateAA(aaID activate){ break; case aaTargetCurrent: case aaTargetCurrentGroup: - if(GetTarget() == NULL) { + if(GetTarget() == nullptr) { Message_StringID(MT_DefaultText, AA_NO_TARGET); //You must first select a target for this ability! p_timers.Clear(&database, AATimerID + pTimerAAStart); return; @@ -245,7 +245,7 @@ void Client::ActivateAA(aaID activate){ target_id = GetTarget()->GetID(); break; case aaTargetPet: - if(GetPet() == NULL) { + if(GetPet() == nullptr) { Message(0, "A pet is required for this skill."); return; } @@ -428,7 +428,7 @@ void Client::HandleAAAction(aaID activate) { } case aaActionActOfValor: - if(GetTarget() != NULL) { + if(GetTarget() != nullptr) { int curhp = GetTarget()->GetHP(); target = aaTargetCurrent; GetTarget()->HealDamage(curhp, this); @@ -514,7 +514,7 @@ void Client::HandleAAAction(aaID activate) { break; case aaTargetCurrent: case aaTargetCurrentGroup: - if(GetTarget() == NULL) { + if(GetTarget() == nullptr) { Message_StringID(MT_DefaultText, AA_NO_TARGET); //You must first select a target for this ability! p_timers.Clear(&database, timer_id + pTimerAAEffectStart); return; @@ -522,7 +522,7 @@ void Client::HandleAAAction(aaID activate) { target_id = GetTarget()->GetID(); break; case aaTargetPet: - if(GetPet() == NULL) { + if(GetPet() == nullptr) { Message(0, "A pet is required for this skill."); return; } @@ -578,17 +578,17 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u 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) { //log write LogFile->write(EQEMuLog::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } - if(name_override != NULL) { + if(name_override != nullptr) { //we have to make a custom NPC type for this name change made_npc = new NPCType; memcpy(made_npc, npc_type, sizeof(NPCType)); @@ -617,14 +617,14 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u //this is a little messy, but the only way to do it right //it would be possible to optimize out this copy for the last pet, but oh well - 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); @@ -645,13 +645,13 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u npca->GetSwarmInfo()->owner_id = GetID(); //give the pets somebody to "love" - if(targ != NULL){ + if(targ != nullptr){ npca->AddToHateList(targ, 1000, 1000); npca->GetSwarmInfo()->target = targ->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, true, true); @@ -659,7 +659,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u } //the target of these swarm pets will take offense to being cast on... - if(targ != NULL) + if(targ != nullptr) targ->AddToHateList(this, 1, 0); } @@ -671,17 +671,17 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid pet.npc_id = typesid; - NPCType *made_npc = NULL; + NPCType *made_npc = nullptr; const NPCType *npc_type = database.GetNPCType(typesid); - if(npc_type == NULL) { + if(npc_type == nullptr) { //log write LogFile->write(EQEMuLog::Error, "Unknown npc type for swarm pet type id: %d", typesid); Message(0,"Unable to find pet!"); return; } - if(name_override != NULL) { + if(name_override != nullptr) { //we have to make a custom NPC type for this name change made_npc = new NPCType; memcpy(made_npc, npc_type, sizeof(NPCType)); @@ -710,14 +710,14 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid //this is a little messy, but the only way to do it right //it would be possible to optimize out this copy for the last pet, but oh well - 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); @@ -735,13 +735,13 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid npca->GetSwarmInfo()->owner_id = GetID(); //give the pets somebody to "love" - if(targ != NULL){ + if(targ != nullptr){ npca->AddToHateList(targ, 1000, 1000); npca->GetSwarmInfo()->target = targ->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, true, true); @@ -751,8 +751,8 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration) { - Corpse *CorpseToUse = NULL; - CorpseToUse = entity_list.GetClosestCorpse(this, NULL); + Corpse *CorpseToUse = nullptr; + CorpseToUse = entity_list.GetClosestCorpse(this, nullptr); if(!CorpseToUse) return; @@ -911,7 +911,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration) npca->GetSwarmInfo()->owner_id = GetID(); //give the pet somebody to "love" - if(target != NULL){ + if(target != nullptr){ npca->AddToHateList(target, 100000); npca->GetSwarmInfo()->target = target->GetID(); } @@ -929,13 +929,13 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration) } //we allocated a new NPC type object, give the NPC ownership of that memory - if(make_npc != NULL) + if(make_npc != nullptr) npca->GiveNPCTypeData(make_npc); entity_list.AddNPC(npca, true, true); //the target of these swarm pets will take offense to being cast on... - if(target != NULL) + if(target != nullptr) target->AddToHateList(this, 1, 0); } @@ -1008,11 +1008,11 @@ void Client::BuyAA(AA_Action* action) break; mlog(AA__MESSAGE, "Could not find AA %d, trying potential parent %d", action->ability, a); aa2 = zone->FindAA(a); - if(aa2 != NULL) + if(aa2 != nullptr) break; } } - if(aa2 == NULL) + if(aa2 == nullptr) return; //invalid ability... if(aa2->special_category == 1 || aa2->special_category == 2) @@ -1104,7 +1104,7 @@ void Client::SendAATimers() { continue; //not an AA timer //send timer uaaout->begin = cur->GetStartTime(); - uaaout->end = static_cast(time(NULL)); + uaaout->end = static_cast(time(nullptr)); uaaout->ability = cur->GetType() - pTimerAAStart; // uuaaout->ability is really a shared timer number QueuePacket(outapp); } @@ -1130,7 +1130,7 @@ void Client::SendAATable() { void Client::SendPreviousAA(uint32 id, int seq){ uint32 value=0; - SendAA_Struct* saa2 = NULL; + SendAA_Struct* saa2 = nullptr; if(id==0) saa2 = zone->GetAABySequence(seq); else @@ -1171,9 +1171,9 @@ void Client::SendPreviousAA(uint32 id, int seq){ void Client::SendAA(uint32 id, int seq) { uint32 value=0; - SendAA_Struct* saa2 = NULL; - SendAA_Struct* qaa = NULL; - SendAA_Struct* saa_pp = NULL; + SendAA_Struct* saa2 = nullptr; + SendAA_Struct* qaa = nullptr; + SendAA_Struct* saa_pp = nullptr; bool IsBaseLevel = true; bool aa_stack = false; @@ -1318,7 +1318,7 @@ void Client::SendAA(uint32 id, int seq) { saa->next_id=saa->sof_next_id; //Prevent removal of previous AA from window if next AA belongs to a higher client version. - SendAA_Struct* saa_next = NULL; + SendAA_Struct* saa_next = nullptr; saa_next = zone->FindAA(saa->sof_next_id); if (saa_next && (((GetClientVersionBit() == 4) && (saa_next->clientver > 4)) @@ -1442,7 +1442,7 @@ void Zone::LoadAAs() { totalAAs = database.CountAAs(); if(totalAAs == 0) { LogFile->write(EQEMuLog::Error, "Failed to load AAs!"); - aas = NULL; + aas = nullptr; return; } aas = new SendAA_Struct *[totalAAs]; @@ -1472,7 +1472,7 @@ bool ZoneDatabase::LoadAAEffects2() { MYSQL_ROW row; if (RunQuery(query, MakeAnyLenString(&query, "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC"), errbuf, &result)) { int count = 0; - while((row = mysql_fetch_row(result))!= NULL) { + while((row = mysql_fetch_row(result))!= nullptr) { int aaid = atoi(row[0]); int slot = atoi(row[1]); int effectid = atoi(row[2]); @@ -1621,7 +1621,7 @@ void Client::InspectBuffs(Client* Inspector, int Rank) if (spells[buffs[i].spellid].buffdurationformula == DF_Permanent) Inspector->Message(0, "%s (Permanent)", spells[buffs[i].spellid].name); else { - char *TempString = NULL; + char *TempString = nullptr; MakeAnyLenString(&TempString, "%.1f", static_cast(buffs[i].ticsremaining) / 10.0f); Inspector->Message_StringID(0, BUFF_MINUTES_REMAINING, spells[buffs[i].spellid].name, TempString); safe_delete_array(TempString); @@ -1733,7 +1733,7 @@ void ZoneDatabase::FillAAEffects(SendAA_Struct* aa_struct){ MYSQL_ROW row; if (RunQuery(query, MakeAnyLenString(&query, "SELECT effectid, base1, base2, slot from aa_effects where aaid=%i order by slot asc", aa_struct->id), errbuf, &result)) { int ndx=0; - while((row = mysql_fetch_row(result))!=NULL) { + while((row = mysql_fetch_row(result))!=nullptr) { aa_struct->abilities[ndx].skill_id=atoi(row[0]); aa_struct->abilities[ndx].base1=atoi(row[1]); aa_struct->abilities[ndx].base2=atoi(row[2]); @@ -1754,7 +1754,7 @@ uint32 ZoneDatabase::CountAAs(){ MYSQL_ROW row; int count=0; if (RunQuery(query, MakeAnyLenString(&query, "SELECT count(title_sid) from altadv_vars"), errbuf, &result)) { - if((row = mysql_fetch_row(result))!=NULL) + if((row = mysql_fetch_row(result))!=nullptr) count = atoi(row[0]); mysql_free_result(result); } else { @@ -1771,7 +1771,7 @@ uint32 ZoneDatabase::CountAAEffects(){ MYSQL_ROW row; int count=0; if (RunQuery(query, MakeAnyLenString(&query, "SELECT count(id) from aa_effects"), errbuf, &result)) { - if((row = mysql_fetch_row(result))!=NULL){ + if((row = mysql_fetch_row(result))!=nullptr){ count = atoi(row[0]); } mysql_free_result(result); @@ -1798,7 +1798,7 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ MYSQL_ROW row; if (RunQuery(query, MakeAnyLenString(&query, "SELECT skill_id from altadv_vars order by skill_id"), errbuf, &result)) { int skill=0,ndx=0; - while((row = mysql_fetch_row(result))!=NULL) { + while((row = mysql_fetch_row(result))!=nullptr) { skill=atoi(row[0]); load[ndx] = GetAASkillVars(skill); load[ndx]->seq = ndx+1; @@ -1815,7 +1815,7 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ if (RunQuery(query, MakeAnyLenString(&query, "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id"), errbuf, &result)) { AALevelCost_Struct aalcs; - while((row = mysql_fetch_row(result))!=NULL) + while((row = mysql_fetch_row(result))!=nullptr) { aalcs.Level = atoi(row[1]); aalcs.Cost = atoi(row[2]); @@ -1833,7 +1833,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) { char errbuf[MYSQL_ERRMSG_SIZE]; char *query = 0; - SendAA_Struct* sendaa = NULL; + SendAA_Struct* sendaa = nullptr; uchar* buffer; if (RunQuery(query, MakeAnyLenString(&query, "SET @row = 0"), errbuf)) { //initialize "row" variable in database for next query safe_delete_array(query); @@ -1965,7 +1965,7 @@ AA_SwarmPetInfo::AA_SwarmPetInfo() { target = 0; owner_id = 0; - duration = NULL; + duration = nullptr; } AA_SwarmPetInfo::~AA_SwarmPetInfo() diff --git a/zone/Map.cpp b/zone/Map.cpp index 55d39dfca..3e16a667c 100644 --- a/zone/Map.cpp +++ b/zone/Map.cpp @@ -69,13 +69,13 @@ Map* Map::LoadMapfile(const char* in_zonename, const char *directory) { //are not all lower anymore, copy since strlwr edits the str. strn0cpy(zBuf, in_zonename, 64); - if(directory == NULL) + if(directory == nullptr) directory = MAP_DIR; snprintf(cWork, 250, "%s/%s.map", directory, strlwr(zBuf)); if ((fp = fopen( cWork, "rb" ))) { ret = new Map(); - if(ret != NULL) { + if(ret != nullptr) { ret->loadMap(fp); printf("Map %s loaded.\n", cWork); } else { @@ -100,9 +100,9 @@ Map::Map() { m_Faces = 0; m_Nodes = 0; m_FaceLists = 0; - mFinalFaces = NULL; - mNodes = NULL; - mFaceLists = NULL; + mFinalFaces = nullptr; + mNodes = nullptr; + mFaceLists = nullptr; } bool Map::loadMap(FILE *fp) { @@ -261,19 +261,19 @@ printf(" Kids: %u, %u, %u, %u\n", _node->nodes[0], _node->nodes[1], _node->nodes printf(" Contained In Box: (%.2f -> %.2f, %.2f -> %.2f)\n", _node->minx, _node->maxx, _node->miny, _node->maxy); /*printf(" Node found has children.\n"); -if(_node->node1 != NULL) { +if(_node->node1 != nullptr) { printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n", _node->node1->minx, _node->node1->maxx, _node->node1->miny, _node->node1->maxy); } -if(_node->node2 != NULL) { +if(_node->node2 != nullptr) { printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n", _node->node2->minx, _node->node2->maxx, _node->node2->miny, _node->node2->maxy); } -if(_node->node3 != NULL) { +if(_node->node3 != nullptr) { printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n", _node->node3->minx, _node->node3->maxx, _node->node3->miny, _node->node3->maxy); } -if(_node->node4 != NULL) { +if(_node->node4 != nullptr) { printf("\tNode: (%.2f -> %.2f, %.2f -> %.2f)\n", _node->node4->minx, _node->node4->maxx, _node->node4->miny, _node->node4->maxy); }*/ @@ -328,11 +328,11 @@ printf(" No node found.\n"); // maybe precalc edges. int* Map::SeekFace( NodeRef node_r, float x, float y ) { if( node_r == NODE_NONE || node_r >= m_Nodes) { - return(NULL); + return(nullptr); } const PNODE _node = &mNodes[node_r]; if(!(_node->flags & nodeFinal)) { - return(NULL); //not a final node... could find the proper node... + return(nullptr); //not a final node... could find the proper node... } @@ -483,7 +483,7 @@ bool Map::LineIntersectsNode( NodeRef node_r, VERTEX p1, VERTEX p2, VERTEX *resu continue; //watch for invalid lists, they seem to happen cur = &mFinalFaces[ *cfl ]; if(LineIntersectsFace(cur,p1, p2, result)) { - if(on != NULL) + if(on != nullptr) *on = cur; return(true); } @@ -516,7 +516,7 @@ float Map::FindBestZ( NodeRef node_r, VERTEX p1, VERTEX *result, FACE **on) cons } VERTEX tmp_result; //dummy placeholder if they do not ask for a result. - if(result == NULL) + if(result == nullptr) result = &tmp_result; VERTEX p2(p1); @@ -554,7 +554,7 @@ printf("Start finding best Z...\n"); printf("Found a z: %.2f\n", result->z); #endif if (result->z > best_z) { - if(on != NULL) + if(on != nullptr) *on = cur; best_z = result->z; } @@ -576,7 +576,7 @@ printf("Best Z found: %.2f\n", best_z); bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result) const { - if( cface == NULL ) { + if( cface == nullptr ) { return(false); //cant intersect a face we dont have... i guess } @@ -617,7 +617,7 @@ bool Map::LineIntersectsFace( PFACE cface, VERTEX p1, VERTEX p2, VERTEX *result) // FACE *thisface = &mFinalFaces[ _node->pfaces[ i ] ]; VERTEX *p = &intersect; - if(result != NULL) + if(result != nullptr) p = result; // Calculate the parameters for the plane diff --git a/zone/MobAI.cpp b/zone/MobAI.cpp index 348704511..5aaf7e04d 100644 --- a/zone/MobAI.cpp +++ b/zone/MobAI.cpp @@ -222,7 +222,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) { case SpellType_Mez: { if(MakeRandomInt(0, 99) < 20) { - Mob * mezTar = NULL; + Mob * mezTar = nullptr; mezTar = entity_list.GetTargetForMez(this); if(mezTar && mezTar->CanBuffStack(AIspells[i].spellid, GetLevel(), true) >= 0) @@ -424,7 +424,7 @@ void Mob::AI_Init() { AIwalking_timer = 0; AImovement_timer = 0; AItarget_check_timer = 0; - AIfeignremember_timer = NULL; + AIfeignremember_timer = nullptr; AIscanarea_timer = 0; minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin); maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax); @@ -944,7 +944,7 @@ void Client::AI_Process() bool got_one = false; while(RememberedCharID != feign_memory_list.end()) { Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID); - if(remember_client == NULL) { + if(remember_client == nullptr) { //they are gone now... tmp = RememberedCharID; RememberedCharID++; @@ -966,7 +966,7 @@ void Client::AI_Process() if(IsPet()) { Mob* owner = GetOwner(); - if(owner == NULL) + if(owner == nullptr) return; float dist = DistNoRoot(*owner); @@ -1264,7 +1264,7 @@ void Mob::AI_Process() { AIwalking_timer->Start(100); pLastFightingDelayMoving = Timer::GetCurrentTime(); return; - } else if(tar != NULL) { + } else if(tar != nullptr) { SetTarget(tar); return; } @@ -1326,7 +1326,7 @@ void Mob::AI_Process() { bool got_one = false; while(RememberedCharID != feign_memory_list.end()) { Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID); - if(remember_client == NULL) { + if(remember_client == nullptr) { //they are gone now... tmp = RememberedCharID; RememberedCharID++; @@ -1378,7 +1378,7 @@ void Mob::AI_Process() { { Mob* owner = GetOwner(); - if(owner == NULL) + if(owner == nullptr) break; //if(owner->IsClient()) @@ -1579,7 +1579,7 @@ void NPC::AI_DoMovement() { //kick off event_waypoint depart char temp[16]; sprintf(temp, "%d", cur_wp); - parse->EventNPC(EVENT_WAYPOINT_DEPART, CastToNPC(), NULL, temp, 0); + parse->EventNPC(EVENT_WAYPOINT_DEPART, CastToNPC(), nullptr, temp, 0); //setup our next waypoint, if we are still on our normal grid //remember that the quest event above could have done anything it wanted with our grid @@ -1609,7 +1609,7 @@ void NPC::AI_DoMovement() { //kick off event_waypoint arrive char temp[16]; sprintf(temp, "%d", cur_wp); - parse->EventNPC(EVENT_WAYPOINT_ARRIVE, CastToNPC(), NULL, temp, 0); + parse->EventNPC(EVENT_WAYPOINT_ARRIVE, CastToNPC(), nullptr, temp, 0); // wipe feign memory since we reached our first waypoint if(cur_wp == 1) @@ -1684,7 +1684,7 @@ void NPC::AI_DoMovement() { ClearFeignMemory(); moved=false; SetMoving(false); - if (GetTarget() == NULL || DistNoRoot(*GetTarget()) >= 5*5 ) + if (GetTarget() == nullptr || DistNoRoot(*GetTarget()) >= 5*5 ) { SetHeading(guard_heading); } else { @@ -1766,7 +1766,7 @@ void Mob::AI_Event_NoLongerEngaged() { if(entity_list.GetNPCByID(this->GetID())) { uint16 emoteid = CastToNPC()->GetEmoteID(); - parse->EventNPC(EVENT_COMBAT, CastToNPC(), NULL, "0", 0); + parse->EventNPC(EVENT_COMBAT, CastToNPC(), nullptr, "0", 0); if(emoteid != 0) CastToNPC()->DoNPCEmote(LEAVECOMBAT,emoteid); CastToNPC()->SetCombatEvent(false); @@ -1873,7 +1873,7 @@ void Mob::StartEnrage() if (SpecAttackTimers[SPECATK_ENRAGE]) { safe_delete(SpecAttackTimers[SPECATK_ENRAGE]); - SpecAttackTimers[SPECATK_ENRAGE] = NULL; + SpecAttackTimers[SPECATK_ENRAGE] = nullptr; } if (!SpecAttackTimers[SPECATK_ENRAGE]) @@ -2156,7 +2156,7 @@ void NPC::CheckSignal() { char buf[32]; snprintf(buf, 31, "%d", signal_id); buf[31] = '\0'; - parse->EventNPC(EVENT_SIGNAL, this, NULL, buf, 0); + parse->EventNPC(EVENT_SIGNAL, this, nullptr, buf, 0); } } diff --git a/zone/Object.cpp b/zone/Object.cpp index d396e368c..77b01b7cd 100644 --- a/zone/Object.cpp +++ b/zone/Object.cpp @@ -43,15 +43,15 @@ Object::Object(uint32 id, uint32 type, uint32 icon, const Object_Struct& object, : respawn_timer(0), decay_timer(300000) { - user = NULL; - last_user = NULL; + user = nullptr; + last_user = nullptr; // Initialize members m_id = id; m_type = type; m_icon = icon; m_inuse = false; - m_inst = NULL; + m_inst = nullptr; m_ground_spawn=false; // Copy object data memcpy(&m_data, &object, sizeof(Object_Struct)); @@ -72,14 +72,14 @@ Object::Object(const ItemInst* inst, char* name,float max_x,float min_x,float ma : respawn_timer(respawntimer), decay_timer(300000) { - user = NULL; - last_user = NULL; + user = nullptr; + last_user = nullptr; m_max_x=max_x; m_max_y=max_y; m_min_x=min_x; m_min_y=min_y; m_id = 0; - m_inst = (inst) ? inst->Clone() : NULL; + m_inst = (inst) ? inst->Clone() : nullptr; m_type = OT_DROPPEDITEM; m_icon = 0; m_inuse = false; @@ -105,12 +105,12 @@ Object::Object(const ItemInst* inst, char* name,float max_x,float min_x,float ma Object::Object(Client* client, const ItemInst* inst) : respawn_timer(0), decay_timer(300000) { - user = NULL; - last_user = NULL; + user = nullptr; + last_user = nullptr; // Initialize members m_id = 0; - m_inst = (inst) ? inst->Clone() : NULL; + m_inst = (inst) ? inst->Clone() : nullptr; m_type = OT_DROPPEDITEM; m_icon = 0; m_inuse = false; @@ -159,12 +159,12 @@ Object::Object(Client* client, const ItemInst* inst) Object::Object(const ItemInst *inst, float x, float y, float z, float heading, uint32 decay_time) : respawn_timer(0), decay_timer(decay_time) { - user = NULL; - last_user = NULL; + user = nullptr; + last_user = nullptr; // Initialize members m_id = 0; - m_inst = (inst) ? inst->Clone() : NULL; + m_inst = (inst) ? inst->Clone() : nullptr; m_type = OT_DROPPEDITEM; m_icon = 0; m_inuse = false; @@ -215,14 +215,14 @@ Object::Object(const ItemInst *inst, float x, float y, float z, float heading, u Object::Object(const char *model, float x, float y, float z, float heading, uint8 type, uint32 decay_time) : respawn_timer(0), decay_timer(decay_time) { - user = NULL; - last_user = NULL; - ItemInst* inst = NULL; + user = nullptr; + last_user = nullptr; + ItemInst* inst = nullptr; inst = new ItemInst(ItemUseWorldContainer); // Initialize members m_id = 0; - m_inst = (inst) ? inst->Clone() : NULL; + m_inst = (inst) ? inst->Clone() : nullptr; m_type = type; m_icon = 0; m_inuse = false; @@ -254,8 +254,8 @@ Object::Object(const char *model, float x, float y, float z, float heading, uint Object::~Object() { safe_delete(m_inst); - if(user != NULL) { - user->SetTradeskillObject(NULL); + if(user != nullptr) { + user->SetTradeskillObject(nullptr); } } @@ -341,27 +341,27 @@ void Object::PutItem(uint8 index, const ItemInst* inst) void Object::Close() { m_inuse = false; - if(user != NULL) + if(user != nullptr) { last_user = user; // put any remaining items from the world container back into the player's inventory to avoid item loss // if they close the container without removing all items ItemInst* container = this->m_inst; - if(container != NULL) + if(container != nullptr) { for (uint8 i = 0; i < MAX_ITEMS_PER_BAG; i++) { ItemInst* inst = container->PopItem(i); - if(inst != NULL) + if(inst != nullptr) { user->MoveItemToInventory(inst, true); } } } - user->SetTradeskillObject(NULL); + user->SetTradeskillObject(nullptr); } - user = NULL; + user = nullptr; } // Remove item from container @@ -378,7 +378,7 @@ void Object::DeleteItem(uint8 index) // Pop item out of container ItemInst* Object::PopItem(uint8 index) { - ItemInst* inst = NULL; + ItemInst* inst = nullptr; if (m_inst && m_inst->IsType(ItemClassContainer)) { inst = m_inst->PopItem(index); @@ -415,7 +415,7 @@ bool Object::Process(){ EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClickObject, sizeof(ClickObject_Struct)); ClickObject_Struct* click_object = (ClickObject_Struct*)outapp->pBuffer; click_object->drop_id = GetID(); - entity_list.QueueClients(NULL, outapp, false); + entity_list.QueueClients(nullptr, outapp, false); safe_delete(outapp); // Remove object @@ -440,7 +440,7 @@ void Object::RandomSpawn(bool send_packet) { if(send_packet) { EQApplicationPacket app; CreateSpawnPacket(&app); - entity_list.QueueClients(NULL, &app, true); + entity_list.QueueClients(nullptr, &app, true); } } @@ -478,14 +478,14 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) safe_delete(m_inst); // No longer using a tradeskill object - sender->SetTradeskillObject(NULL); - user = NULL; + sender->SetTradeskillObject(nullptr); + user = nullptr; } // Send click to all clients (removes entity on client) EQApplicationPacket* outapp = new EQApplicationPacket(OP_ClickObject, sizeof(ClickObject_Struct)); memcpy(outapp->pBuffer, click_object, sizeof(ClickObject_Struct)); - entity_list.QueueClients(NULL, outapp, false); + entity_list.QueueClients(nullptr, outapp, false); safe_delete(outapp); // Remove object @@ -499,7 +499,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) //TODO: there is prolly a better way to do this. //if this is not the main user, send them a close and a message - if(user == NULL || user == sender) + if(user == nullptr || user == sender) coa->open = 0x01; else { coa->open = 0x00; @@ -523,7 +523,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) safe_delete(outapp); //if the object allready had a user, we are done - if(user != NULL) + if(user != nullptr) return(false); // Starting to use this object @@ -583,7 +583,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob item_id, charges, object_name, type, icon); // Save new record for object - if (!RunQuery(query, len_query, errbuf, NULL, NULL, &database_id)) { + if (!RunQuery(query, len_query, errbuf, nullptr, nullptr, &database_id)) { LogFile->write(EQEMuLog::Error, "Unable to insert object: %s", errbuf); } else { @@ -926,14 +926,14 @@ void Object::SetEntityVariable(const char *id, const char *m_var) const char* Object::GetEntityVariable(const char *id) { if(!id) - return NULL; + return nullptr; std::map::iterator iter = o_EntityVariables.find(id); if(iter != o_EntityVariables.end()) { return iter->second.c_str(); } - return NULL; + return nullptr; } bool Object::EntityVariableExists(const char * id) diff --git a/zone/PlayerCorpse.cpp b/zone/PlayerCorpse.cpp index 9140a5914..6e4fb74f3 100644 --- a/zone/PlayerCorpse.cpp +++ b/zone/PlayerCorpse.cpp @@ -872,7 +872,7 @@ void Corpse::AllowMobLoot(Mob *them, uint8 slot) { if(slot >= MAX_LOOTERS) return; - if(them == NULL || !them->IsClient()) + if(them == nullptr || !them->IsClient()) return; looters[slot] = them->CastToClient()->CharacterID(); @@ -1110,7 +1110,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) } const Item_Struct* item = 0; ItemInst *inst = 0; - ServerLootItem_Struct* item_data = NULL, *bag_item_data[10]; + ServerLootItem_Struct* item_data = nullptr, *bag_item_data[10]; memset(bag_item_data, 0, sizeof(bag_item_data)); if(GetPKItem()>1) @@ -1267,11 +1267,11 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) client->Message_StringID(MT_LootMessages, LOOTED_MESSAGE, link); if(!IsPlayerCorpse()) { Group *g = client->GetGroup(); - if(g != NULL) { + if(g != nullptr) { g->GroupMessage_StringID(client, MT_LootMessages, OTHER_LOOTED_MESSAGE, client->GetName(), link); } else { Raid *r = client->GetRaid(); - if(r != NULL) { + if(r != nullptr) { r->RaidMessage_StringID(client, MT_LootMessages, OTHER_LOOTED_MESSAGE, client->GetName(), link); } } diff --git a/zone/QuestParserCollection.cpp b/zone/QuestParserCollection.cpp index e2a09075a..e61ef57cf 100644 --- a/zone/QuestParserCollection.cpp +++ b/zone/QuestParserCollection.cpp @@ -275,7 +275,7 @@ QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid) { filename += "/"; filename += itoa(npcid); std::string tmp; - FILE *f = NULL; + FILE *f = nullptr; std::list::iterator iter = _load_precedence.begin(); while(iter != _load_precedence.end()) { @@ -295,7 +295,7 @@ QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid) { //second look for /quests/zone/npcname.ext (precedence) const NPCType *npc_type = database.GetNPCType(npcid); if(!npc_type) { - return NULL; + return nullptr; } std::string npc_name = npc_type->name; int sz = static_cast(npc_name.length()); @@ -405,13 +405,13 @@ QuestInterface *QuestParserCollection::GetQIByNPCQuest(uint32 npcid) { iter++; } - return NULL; + return nullptr; } QuestInterface *QuestParserCollection::GetQIByPlayerQuest() { if(!zone) - return NULL; + return nullptr; //first look for /quests/zone/player_v[instance_version].ext (precedence) std::string filename = "quests/"; @@ -420,7 +420,7 @@ QuestInterface *QuestParserCollection::GetQIByPlayerQuest() { filename += "player_v"; filename += itoa(zone->GetInstanceVersion()); std::string tmp; - FILE *f = NULL; + FILE *f = nullptr; std::list::iterator iter = _load_precedence.begin(); while(iter != _load_precedence.end()) { @@ -478,7 +478,7 @@ QuestInterface *QuestParserCollection::GetQIByPlayerQuest() { iter++; } - return NULL; + return nullptr; } QuestInterface *QuestParserCollection::GetQIByGlobalNPCQuest(){ @@ -488,7 +488,7 @@ QuestInterface *QuestParserCollection::GetQIByGlobalNPCQuest(){ filename += "/"; filename += "global_npc"; std::string tmp; - FILE *f = NULL; + FILE *f = nullptr; std::list::iterator iter = _load_precedence.begin(); while(iter != _load_precedence.end()) { @@ -505,7 +505,7 @@ QuestInterface *QuestParserCollection::GetQIByGlobalNPCQuest(){ iter++; } - return NULL; + return nullptr; } QuestInterface *QuestParserCollection::GetQIByGlobalPlayerQuest() { @@ -515,7 +515,7 @@ QuestInterface *QuestParserCollection::GetQIByGlobalPlayerQuest() { filename += "/"; filename += "global_player"; std::string tmp; - FILE *f = NULL; + FILE *f = nullptr; std::list::iterator iter = _load_precedence.begin(); while(iter != _load_precedence.end()) { @@ -532,7 +532,7 @@ QuestInterface *QuestParserCollection::GetQIByGlobalPlayerQuest() { iter++; } - return NULL; + return nullptr; } QuestInterface *QuestParserCollection::GetQIBySpellQuest(uint32 spell_id) { @@ -540,7 +540,7 @@ QuestInterface *QuestParserCollection::GetQIBySpellQuest(uint32 spell_id) { std::string filename = "quests/spells/"; filename += itoa(spell_id); std::string tmp; - FILE *f = NULL; + FILE *f = nullptr; std::list::iterator iter = _load_precedence.begin(); while(iter != _load_precedence.end()) { @@ -557,7 +557,7 @@ QuestInterface *QuestParserCollection::GetQIBySpellQuest(uint32 spell_id) { iter++; } - return NULL; + return nullptr; } QuestInterface *QuestParserCollection::GetQIByItemQuest(std::string item_script) { @@ -565,7 +565,7 @@ QuestInterface *QuestParserCollection::GetQIByItemQuest(std::string item_script) std::string filename = "quests/items/"; filename += item_script; std::string tmp; - FILE *f = NULL; + FILE *f = nullptr; std::list::iterator iter = _load_precedence.begin(); while(iter != _load_precedence.end()) { @@ -582,5 +582,5 @@ QuestInterface *QuestParserCollection::GetQIByItemQuest(std::string item_script) iter++; } - return NULL; -} \ No newline at end of file + return nullptr; +} diff --git a/zone/ZoneConfig.cpp b/zone/ZoneConfig.cpp index 13681c0cc..d5b182899 100644 --- a/zone/ZoneConfig.cpp +++ b/zone/ZoneConfig.cpp @@ -18,5 +18,5 @@ #include "../common/debug.h" #include "ZoneConfig.h" -ZoneConfig *ZoneConfig::_zone_config = NULL; +ZoneConfig *ZoneConfig::_zone_config = nullptr; diff --git a/zone/ZoneConfig.h b/zone/ZoneConfig.h index 91d50c841..76e116514 100644 --- a/zone/ZoneConfig.h +++ b/zone/ZoneConfig.h @@ -37,14 +37,14 @@ class ZoneConfig : public EQEmuConfig { // Produce a const singleton static const ZoneConfig *get() { - if (_zone_config == NULL) + if (_zone_config == nullptr) LoadConfig(); return(_zone_config); } // Load the config static bool LoadConfig() { - if (_zone_config != NULL) + if (_zone_config != nullptr) delete _zone_config; _zone_config=new ZoneConfig; _config=_zone_config; diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 8fb102b92..524ae8d85 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -63,7 +63,7 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo bool engaged = from_who->IsEngaged(); if(engaged) { Mob *top = from_who->GetHateTop(); - towho->Message(0, ".. I am currently fighting with %s", top == NULL?"(NULL)":top->GetName()); + towho->Message(0, ".. I am currently fighting with %s", top == nullptr?"(nullptr)":top->GetName()); } bool check_npcs = from_who->WillAggroNPCs(); @@ -72,7 +72,7 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo int my_primary = from_who->GetPrimaryFaction(); Mob *own = from_who->GetOwner(); - if(own != NULL) + if(own != nullptr) my_primary = own->GetPrimaryFaction(); if(my_primary == 0) { @@ -173,10 +173,10 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { int my_primary = GetPrimaryFaction(); int mob_primary = mob->GetPrimaryFaction(); Mob *own = GetOwner(); - if(own != NULL) + if(own != nullptr) my_primary = own->GetPrimaryFaction(); own = mob->GetOwner(); - if(mob_primary > 0 && own != NULL) + if(mob_primary > 0 && own != nullptr) mob_primary = own->GetPrimaryFaction(); if(mob_primary == 0) { @@ -220,7 +220,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { if(!( fv == FACTION_SCOWLS || - (mob->GetPrimaryFaction() != GetPrimaryFaction() && mob->GetPrimaryFaction() == -4 && GetOwner() == NULL) + (mob->GetPrimaryFaction() != GetPrimaryFaction() && mob->GetPrimaryFaction() == -4 && GetOwner() == nullptr) || fv == FACTION_THREATENLY )) { @@ -335,7 +335,7 @@ bool Mob::CheckWillAggro(Mob *mob) { ( fv == FACTION_SCOWLS || - (mob->GetPrimaryFaction() != GetPrimaryFaction() && mob->GetPrimaryFaction() == -4 && GetOwner() == NULL) + (mob->GetPrimaryFaction() != GetPrimaryFaction() && mob->GetPrimaryFaction() == -4 && GetOwner() == nullptr) || ( fv == FACTION_THREATENLY @@ -368,7 +368,7 @@ bool Mob::CheckWillAggro(Mob *mob) { Mob* EntityList::AICheckCloseAggro(Mob* sender, float iAggroRange, float iAssistRange) { if (!sender || !sender->IsNPC()) - return(NULL); + return(nullptr); _ZP(EntityList_AICheckCloseAggro); #ifdef REVERSE_AGGRO @@ -389,7 +389,7 @@ Mob* EntityList::AICheckCloseAggro(Mob* sender, float iAggroRange, float iAssist iterator.Advance(); } //LogFile->write(EQEMuLog::Debug, "Check aggro for %s no target.", sender->GetName()); - return(NULL); + return(nullptr); } int EntityList::GetHatedCount(Mob *attacker, Mob *exclude) { @@ -1026,7 +1026,7 @@ bool Mob::CheckLosFN(Mob* other) { } bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) { - if(zone->zonemap == NULL) { + if(zone->zonemap == nullptr) { //not sure what the best return is on error //should make this a database variable, but im lazy today #ifdef LOS_DEFAULT_CAN_SEE @@ -1405,20 +1405,20 @@ int32 Mob::CheckHealAggroAmount(uint16 spellid, uint32 heal_possible) { } void Mob::AddFeignMemory(Client* attacker) { - if(feign_memory_list.empty() && AIfeignremember_timer != NULL) + if(feign_memory_list.empty() && AIfeignremember_timer != nullptr) AIfeignremember_timer->Start(AIfeignremember_delay); feign_memory_list.insert(attacker->CharacterID()); } void Mob::RemoveFromFeignMemory(Client* attacker) { feign_memory_list.erase(attacker->CharacterID()); - if(feign_memory_list.empty() && AIfeignremember_timer != NULL) + if(feign_memory_list.empty() && AIfeignremember_timer != nullptr) AIfeignremember_timer->Disable(); if(feign_memory_list.empty()) { minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin); maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax); - if(AIfeignremember_timer != NULL) + if(AIfeignremember_timer != nullptr) AIfeignremember_timer->Disable(); } } @@ -1428,7 +1428,7 @@ void Mob::ClearFeignMemory() { while (RememberedCharID != feign_memory_list.end()) { Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID); - if(remember_client != NULL) //Still in zone + if(remember_client != nullptr) //Still in zone remember_client->RemoveXTarget(this, false); ++RememberedCharID; } @@ -1436,7 +1436,7 @@ void Mob::ClearFeignMemory() { feign_memory_list.clear(); minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin); maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax); - if(AIfeignremember_timer != NULL) + if(AIfeignremember_timer != nullptr) AIfeignremember_timer->Disable(); } diff --git a/zone/attack.cpp b/zone/attack.cpp index 1bbb6efa8..d51f915b2 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1081,7 +1081,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b _ZP(Client_Attack); if (!other) { - SetTarget(NULL); + SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); return false; } @@ -1089,12 +1089,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(!GetTarget()) SetTarget(other); - mlog(COMBAT__ATTACKS, "Attacking %s with hand %d %s", other?other->GetName():"(NULL)", Hand, bRiposte?"(this is a riposte)":""); + mlog(COMBAT__ATTACKS, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); //SetAttackTimer(); if ( (IsCasting() && GetClass() != BARD && !IsFromSpell) - || other == NULL + || other == nullptr || ((IsClient() && CastToClient()->dead) || (other->IsClient() && other->CastToClient()->dead)) || (GetHP() < 0) || (!IsAttackAllowed(other)) @@ -1122,7 +1122,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b OffHandAtk(false); } - if(weapon != NULL) { + if(weapon != nullptr) { if (!weapon->IsWeapon()) { mlog(COMBAT__ATTACKS, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); @@ -1192,7 +1192,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b // Damage bonuses apply only to hits from the main hand (Hand == 13) by characters level 28 and above // who belong to a melee class. If we're here, then all of these conditions apply. - ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) NULL ); + ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); min_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus; @@ -1203,7 +1203,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if (Hand==14) { if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){ - ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) NULL ); + ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); min_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus; @@ -1454,7 +1454,7 @@ void Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ parse->EventPlayer(EVENT_DEATH, this, "", 0); - if (killerMob != NULL) + if (killerMob != nullptr) { if (killerMob->IsNPC()) { parse->EventNPC(EVENT_SLAY, killerMob->CastToNPC(), this, "", 0); @@ -1570,7 +1570,7 @@ void Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ char tmp[20]; database.GetVariable("ServerType", tmp, 9); - if(atoi(tmp)==1 && killerMob != NULL && killerMob->IsClient()){ + if(atoi(tmp)==1 && killerMob != nullptr && killerMob->IsClient()){ char tmp2[10] = {0}; database.GetVariable("PvPreward", tmp, 9); int reward = atoi(tmp); @@ -1592,7 +1592,7 @@ void Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ { for(int i=0;i<6;i++) { - if(group->members[i] != NULL) + if(group->members[i] != nullptr) { new_corpse->AllowMobLoot(group->members[i],i); } @@ -1621,7 +1621,7 @@ void Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ #if 0 // solar: commenting this out for now TODO reimplement becomenpc stuff if (IsBecomeNPC() == true) { - if (killerMob != NULL && killerMob->IsClient()) { + if (killerMob != nullptr && killerMob->IsClient()) { if (killerMob->CastToClient()->isgrouped && entity_list.GetGroupByMob(killerMob) != 0) entity_list.GetGroupByMob(killerMob->CastToClient())->SplitExp((uint32)(level*level*75*3.5f), this); @@ -1641,7 +1641,7 @@ void Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ Group* group = entity_list.GetGroupByClient(killerMob->CastToClient()); if(group != 0) { for(int i=0; i < MAX_GROUP_MEMBERS; i++) { // Doesnt work right, needs work - if(group->members[i] != NULL) { + if(group->members[i] != nullptr) { corpse->AllowMobLoot(group->members[i],i); } } @@ -1700,7 +1700,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool int damage = 0; if (!other) { - SetTarget(NULL); + SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); return false; } @@ -1737,7 +1737,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } //figure out what weapon they are using, if any - const Item_Struct* weapon = NULL; + const Item_Struct* weapon = nullptr; if (Hand == 13 && equipment[SLOT_PRIMARY] > 0) weapon = database.GetItem(equipment[SLOT_PRIMARY]); else if (equipment[SLOT_SECONDARY]) @@ -1949,7 +1949,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool TryWeaponProc(weapon, other, Hand); //no weapon } - TriggerDefensiveProcs(NULL, other, Hand, damage); + TriggerDefensiveProcs(nullptr, other, Hand, damage); // now check ripostes if (damage == -3) { // riposting @@ -2054,7 +2054,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski Mob *give_exp = hate_list.GetDamageTop(this); - if(give_exp == NULL) + if(give_exp == nullptr) give_exp = killer; if(give_exp && give_exp->HasOwner()) { @@ -2069,14 +2069,14 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski #ifdef BOTS if(!RuleB(Bots, BotGroupXP) && !ownerInGroup) { - give_exp = NULL; + give_exp = nullptr; } #endif //BOTS } int PlayerCount = 0; // QueryServ Player Counting - Client *give_exp_client = NULL; + Client *give_exp_client = nullptr; if(give_exp && give_exp->IsClient()) give_exp_client = give_exp->CastToClient(); @@ -2095,7 +2095,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski } /* Send the EVENT_KILLED_MERIT event for all raid members */ for (int i = 0; i < MAX_RAID_MEMBERS; i++) { - if (kr->members[i].member != NULL) { // If Group Member is Client + if (kr->members[i].member != nullptr) { // If Group Member is Client parse->EventNPC(EVENT_KILLED_MERIT, this, kr->members[i].member, "killed", 0); if(RuleB(TaskSystem, EnableTaskSystem)) kr->members[i].member->UpdateTasksOnKill(GetNPCTypeID()); @@ -2112,7 +2112,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski QS->s1.ZoneID = this->GetZoneID(); QS->s1.Type = 2; // Raid Fight for (int i = 0; i < MAX_RAID_MEMBERS; i++) { - if (kr->members[i].member != NULL) { // If Group Member is Client + if (kr->members[i].member != nullptr) { // If Group Member is Client Client *c = kr->members[i].member; QS->Chars[PlayerCount].char_id = c->CharacterID(); PlayerCount++; @@ -2124,7 +2124,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski // End QueryServ Logging } - else if (give_exp_client->IsGrouped() && kg != NULL) + else if (give_exp_client->IsGrouped() && kg != nullptr) { if(!IsLdonTreasure) { kg->SplitExp((EXP_FORMULA), this); @@ -2134,7 +2134,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski /* Send the EVENT_KILLED_MERIT event and update kill tasks * for all group members */ for (int i = 0; i < MAX_GROUP_MEMBERS; i++) { - if (kg->members[i] != NULL && kg->members[i]->IsClient()) { // If Group Member is Client + if (kg->members[i] != nullptr && kg->members[i]->IsClient()) { // If Group Member is Client Client *c = kg->members[i]->CastToClient(); parse->EventNPC(EVENT_KILLED_MERIT, this, c, "killed", 0); if(RuleB(TaskSystem, EnableTaskSystem)) @@ -2153,7 +2153,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski QS->s1.ZoneID = this->GetZoneID(); QS->s1.Type = 1; // Group Fight for (int i = 0; i < MAX_GROUP_MEMBERS; i++) { - if (kg->members[i] != NULL && kg->members[i]->IsClient()) { // If Group Member is Client + if (kg->members[i] != nullptr && kg->members[i]->IsClient()) { // If Group Member is Client Client *c = kg->members[i]->CastToClient(); QS->Chars[PlayerCount].char_id = c->CharacterID(); PlayerCount++; @@ -2234,7 +2234,7 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski Group* group = entity_list.GetGroupByClient(killer->CastToClient()); if(group != 0) { for(int i=0;i<6;i++) { // Doesnt work right, needs work - if(group->members[i] != NULL) { + if(group->members[i] != nullptr) { corpse->AllowMobLoot(group->members[i],i); } } @@ -2327,13 +2327,13 @@ void NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski this->WipeHateList(); p_depop = true; if(killerMob && killerMob->GetTarget() == this) //we can kill things without having them targeted - killerMob->SetTarget(NULL); //via AE effects and such.. + killerMob->SetTarget(nullptr); //via AE effects and such.. entity_list.UpdateFindableNPCState(this, true); } void Mob::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, bool bFrenzy, bool iBuffTic) { - assert(other != NULL); + assert(other != nullptr); if (other == this) return; @@ -2577,12 +2577,12 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) // Assert: This function should not be called unless the player is a melee class, as casters do not receive a damage bonus. - if( Weapon == NULL || Weapon->ItemType == ItemType1HS || Weapon->ItemType == ItemType1HB || Weapon->ItemType == ItemTypeHand2Hand || Weapon->ItemType == ItemTypePierce ) + if( Weapon == nullptr || Weapon->ItemType == ItemType1HS || Weapon->ItemType == ItemType1HB || Weapon->ItemType == ItemTypeHand2Hand || Weapon->ItemType == ItemTypePierce ) { // The weapon in the player's main (primary) hand is a one-handed weapon, or there is no item equipped at all. // // According to player posts on Allakhazam, 1H damage bonuses apply to bare fists (nothing equipped in the mainhand, - // as indicated by Weapon == NULL). + // as indicated by Weapon == nullptr). // // The following formula returns the correct damage bonus for all 1H weapons: @@ -3256,7 +3256,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons damage = -5; } - if( spell_id != SPELL_UNKNOWN || attacker == NULL ) + if( spell_id != SPELL_UNKNOWN || attacker == nullptr ) avoidable = false; // only apply DS if physical damage (no spell damage) @@ -3485,7 +3485,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons EQApplicationPacket* outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct)); CombatDamage_Struct* a = (CombatDamage_Struct*)outapp->pBuffer; a->target = GetID(); - if (attacker == NULL) + if (attacker == nullptr) a->source = 0; else if (attacker->IsClient() && attacker->CastToClient()->GMHideMe()) a->source = 0; @@ -3619,7 +3619,7 @@ void Mob::HealDamage(uint32 amount, Mob* caster) { else acthealed = amount; - char *TempString = NULL; + char *TempString = nullptr; MakeAnyLenString(&TempString, "%d", acthealed); @@ -3738,7 +3738,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 w void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand, int damage) { if (!on) { - SetTarget(NULL); + SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); return; } @@ -3753,7 +3753,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand, int dam return; float ProcChance, ProcBonus; - if(weapon!=NULL) + if(weapon!=nullptr) on->GetDefensiveProcChances(ProcBonus, ProcChance, weapon->GetItem()->Delay, hand); else on->GetDefensiveProcChances(ProcBonus, ProcChance); @@ -3791,18 +3791,18 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand, int dam void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { _ZP(Mob_TryWeaponProcA); if(!on) { - SetTarget(NULL); + SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); return; } if(!weapon_g) { - TryWeaponProc((const Item_Struct*) NULL, on, hand); + TryWeaponProc((const Item_Struct*) nullptr, on, hand); return; } if(!weapon_g->IsType(ItemClassCommon)) { - TryWeaponProc((const Item_Struct*) NULL, on, hand); + TryWeaponProc((const Item_Struct*) nullptr, on, hand); return; } @@ -3834,7 +3834,7 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { if (MakeRandomFloat(0, 1) < ProcChance) { if(aug->Proc.Level > ourlevel) { Mob * own = GetOwner(); - if(own != NULL) { + if(own != nullptr) { own->Message_StringID(13,PROC_PETTOOLOW); } else { Message_StringID(13,PROC_TOOLOW); @@ -3852,7 +3852,7 @@ void Mob::TryWeaponProc(const Item_Struct* weapon, Mob *on, uint16 hand) { uint16 skillinuse = 28; int ourlevel = GetLevel(); float ProcChance, ProcBonus; - if(weapon!=NULL) + if(weapon!=nullptr) GetProcChances(ProcBonus, ProcChance, weapon->Delay, hand); else GetProcChances(ProcBonus, ProcChance); @@ -3861,7 +3861,7 @@ void Mob::TryWeaponProc(const Item_Struct* weapon, Mob *on, uint16 hand) { ProcChance /= 2; //give weapon a chance to proc first. - if(weapon != NULL) { + if(weapon != nullptr) { skillinuse = GetSkillByItemType(weapon->ItemType); if (weapon->Proc.Type == ET_CombatProc) { float WPC = ProcChance*(100.0f+(float)weapon->ProcRate)/100.0f; @@ -3869,7 +3869,7 @@ void Mob::TryWeaponProc(const Item_Struct* weapon, Mob *on, uint16 hand) { if(weapon->Proc.Level > ourlevel) { mlog(COMBAT__PROCS, "Tried to proc (%s), but our level (%d) is lower than required (%d)", weapon->Name, ourlevel, weapon->Proc.Level); Mob * own = GetOwner(); - if(own != NULL) { + if(own != nullptr) { own->Message_StringID(13,PROC_PETTOOLOW); } else { Message_StringID(13,PROC_TOOLOW); @@ -3890,7 +3890,7 @@ void Mob::TryWeaponProc(const Item_Struct* weapon, Mob *on, uint16 hand) { } bool bRangedAttack = false; - if (weapon != NULL) { + if (weapon != nullptr) { if (weapon->ItemType == ItemTypeBow || weapon->ItemType == ItemTypeThrowing || weapon->ItemType == ItemTypeThrowingv2) { bRangedAttack = true; } @@ -3961,7 +3961,7 @@ void Mob::TryPetCriticalHit(Mob *defender, uint16 skill, int32 &damage) //Each rank adds an additional 1% chance for any melee hit (primary, secondary, kick, bash, etc) to critical, //dealing up to 63% more damage. http://www.magecompendium.com/aa-short-library.html - Mob *owner = NULL; + Mob *owner = nullptr; float critChance = 0.0f; critChance += RuleI(Combat, MeleeBaseCritChance); uint16 critMod = 163; @@ -4270,7 +4270,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, float chance) { if (!on) { - SetTarget(NULL); + SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); return; } diff --git a/zone/basic_functions.h b/zone/basic_functions.h index 8185b612e..83400fde8 100644 --- a/zone/basic_functions.h +++ b/zone/basic_functions.h @@ -16,7 +16,7 @@ char com_list[512]; pch = strtok(temp,ty); for (int i=0; i < pos; i++) { if (pos == i) break; - pch = strtok(NULL,ty); + pch = strtok(nullptr,ty); } return pch; }*/ diff --git a/zone/beacon.cpp b/zone/beacon.cpp index 00e0bb960..5ed82f8a8 100644 --- a/zone/beacon.cpp +++ b/zone/beacon.cpp @@ -44,7 +44,7 @@ extern Zone* zone; Beacon::Beacon(Mob *at_mob, int lifetime) :Mob ( - NULL, NULL, 0, 0, 0, INVISIBLE_MAN, 0, BT_NoTarget, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + nullptr, nullptr, 0, 0, 0, INVISIBLE_MAN, 0, BT_NoTarget, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), remove_timer(lifetime), diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index cb2502c35..a50e15c56 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -1193,7 +1193,7 @@ void Mob::CalcSpellBonuses(StatBonuses* newbon) void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* newbon, uint16 casterId, bool item_bonus, uint32 ticsremaining, int buffslot) { int i, effect_value; - Mob *caster = NULL; + Mob *caster = nullptr; if(!IsValidSpell(spell_id)) return; diff --git a/zone/bot.cpp b/zone/bot.cpp index c80981883..f6bdd6667 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1288,7 +1288,7 @@ void Bot::GenerateArmorClass() uint16 Bot::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(SLOT_PRIMARY); if(!equiped) @@ -3115,7 +3115,7 @@ bool Bot::Process() return true; //Handle assists... - /*if(assist_timer.Check() && !Charmed() && GetTarget() != NULL) { + /*if(assist_timer.Check() && !Charmed() && GetTarget() != nullptr) { entity_list.AIYellForHelp(this, GetTarget()); }*/ @@ -3307,7 +3307,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillType skil if(GetLevel() >= 28 && IsWarriorClass() ) { - int ucDamageBonus = GetWeaponDamageBonus((const Item_Struct*) NULL ); + int ucDamageBonus = GetWeaponDamageBonus((const Item_Struct*) nullptr ); min_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus; @@ -3425,14 +3425,14 @@ bool Bot::CanDoSpecialAttack(Mob *other) { //Make sure everything is valid before doing any attacks. if (!other) { - SetTarget(NULL); + SetTarget(nullptr); return false; } if(!GetTarget()) SetTarget(other); - if ((other == NULL || ((GetAppearance() == eaDead) || (other->IsClient() && other->CastToClient()->IsDead())) + if ((other == nullptr || ((GetAppearance() == eaDead) || (other->IsClient() && other->CastToClient()->IsDead())) || HasDied() || (!IsAttackAllowed(other)))) { return false; } @@ -4811,7 +4811,7 @@ bool Bot::GroupHasBot(Group* group) { if(group) { for(int Counter = 0; Counter < MAX_GROUP_MEMBERS; Counter++) { - if (group->members[Counter] == NULL) { + if (group->members[Counter] == nullptr) { continue; } @@ -5408,7 +5408,7 @@ ItemInst* Bot::GetBotItem(uint32 slotID) { return item; } - return NULL; + return nullptr; } // Adds the specified item it bot to the NPC equipment array and to the bot inventory collection. @@ -6027,7 +6027,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli if(!failedLoreCheck && mWeaponItem && inst->IsEquipable(GetBaseRace(), GetClass()) && (GetLevel() >= mWeaponItem->ReqLevel)) { BotCanWear = true; botCanWear[i] = BotCanWear; - ItemInst* swap_item = NULL; + ItemInst* swap_item = nullptr; const char* equipped[22] = {"Charm", "Left Ear", "Head", "Face", "Right Ear", "Neck", "Shoulders", "Arms", "Back", "Left Wrist", "Right Wrist", "Range", "Hands", "Primary Hand", "Secondary Hand", @@ -6201,7 +6201,7 @@ void Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillType attack_ Save(); Mob *give_exp = hate_list.GetDamageTop(this); - Client *give_exp_client = NULL; + Client *give_exp_client = nullptr; if(give_exp && give_exp->IsClient()) give_exp_client = give_exp->CastToClient(); @@ -6220,7 +6220,7 @@ void Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillType attack_ // br->SplitExp((EXP_FORMULA), this); // if(br->GetBotMainTarget() == this) - // br->SetBotMainTarget(NULL); + // br->SetBotMainTarget(nullptr); // /* Send the EVENT_KILLED_MERIT event for all raid members */ // if(br->BotRaidGroups[0]) { @@ -6272,7 +6272,7 @@ void Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillType attack_ strcpy(g->membername[j-1], g->members[j]->GetCleanName()); g->membername[j][0] = '\0'; memset(g->membername[j], 0, 64); - g->members[j] = NULL; + g->members[j] = nullptr; } } @@ -6295,10 +6295,10 @@ void Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillType attack_ BotRaids* br = entity_list.GetBotRaidByMob(this); if(br) { if(this == br->botmaintank) { - br->botmaintank = NULL; + br->botmaintank = nullptr; } if(this == br->botsecondtank) { - br->botsecondtank = NULL; + br->botsecondtank = nullptr; } } if(g->GroupCount() == 0) { @@ -6392,7 +6392,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b _ZP(Bot_Attack); if (!other) { - SetTarget(NULL); + SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); return false; } @@ -6400,10 +6400,10 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(!GetTarget() || GetTarget() != other) SetTarget(other); - mlog(COMBAT__ATTACKS, "Attacking %s with hand %d %s", other?other->GetCleanName():"(NULL)", Hand, FromRiposte?"(this is a riposte)":""); + mlog(COMBAT__ATTACKS, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || - other == NULL || + other == nullptr || (GetHP() < 0) || (GetAppearance() == eaDead) || (!IsAttackAllowed(other))) @@ -6432,7 +6432,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b FaceTarget(GetTarget()); - ItemInst* weapon = NULL; + ItemInst* weapon = nullptr; if(Hand == SLOT_PRIMARY) { weapon = GetBotItem(SLOT_PRIMARY); OffHandAtk(false); @@ -6442,7 +6442,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b OffHandAtk(true); } - if(weapon != NULL) { + if(weapon != nullptr) { if (!weapon->IsWeapon()) { mlog(COMBAT__ATTACKS, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); @@ -6510,7 +6510,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b // Damage bonuses apply only to hits from the main hand (Hand == 13) by characters level 28 and above // who belong to a melee class. If we're here, then all of these conditions apply. - ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) NULL ); + ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); min_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus; @@ -6521,7 +6521,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if (Hand==SLOT_SECONDARY) { if (aabonuses.SecondaryDmgInc || itembonuses.SecondaryDmgInc || spellbonuses.SecondaryDmgInc){ - ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) NULL ); + ucDamageBonus = GetWeaponDamageBonus( weapon ? weapon->GetItem() : (const Item_Struct*) nullptr ); min_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus; @@ -7135,7 +7135,7 @@ int16 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { //item focus for(int x=0; x<=21; x++) { - TempItem = NULL; + TempItem = nullptr; ItemInst* ins = GetBotItem(x); if (!ins) continue; @@ -7169,7 +7169,7 @@ int16 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { for(int y = 0; y < MAX_AUGMENT_SLOTS; ++y) { - ItemInst *aug = NULL; + ItemInst *aug = nullptr; aug = ins->GetAugment(y); if(aug) { @@ -8470,7 +8470,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) { bool bCanFrontalBS = false; const ItemInst* inst = GetBotItem(SLOT_PRIMARY); - const Item_Struct* botpiercer = NULL; + const Item_Struct* botpiercer = nullptr; if(inst) botpiercer = inst->GetItem(); if(!botpiercer || (botpiercer->ItemType != ItemTypePierce)) { @@ -9136,7 +9136,7 @@ void Bot::EquipBot(std::string* errorMessage) { // BotRaids* br = entity_list.GetBotRaidByMob(client); // if(br) { // br->RemoveRaidBots(); -// br = NULL; +// br = nullptr; // } // } // @@ -9339,8 +9339,8 @@ void Bot::SetAttackTimer() { //an invalid weapon equipped: attack_timer.SetAtTrigger(4000, true); - Timer* TimerToUse = NULL; - const Item_Struct* PrimaryWeapon = NULL; + Timer* TimerToUse = nullptr; + const Item_Struct* PrimaryWeapon = nullptr; for (int i=SLOT_RANGE; i<=SLOT_SECONDARY; i++) { @@ -9354,7 +9354,7 @@ void Bot::SetAttackTimer() { else //invalid slot (hands will always hit this) continue; - const Item_Struct* ItemToUse = NULL; + const Item_Struct* ItemToUse = nullptr; ItemInst* ci = GetBotItem(i); if(ci) ItemToUse = ci->GetItem(); @@ -9362,7 +9362,7 @@ void Bot::SetAttackTimer() { //special offhand stuff if(i == SLOT_SECONDARY) { //if we have a 2H weapon in our main hand, no dual - if(PrimaryWeapon != NULL) { + if(PrimaryWeapon != nullptr) { if( PrimaryWeapon->ItemClass == ItemClassCommon && (PrimaryWeapon->ItemType == ItemType2HS || PrimaryWeapon->ItemType == ItemType2HB @@ -9380,18 +9380,18 @@ void Bot::SetAttackTimer() { } //see if we have a valid weapon - if(ItemToUse != NULL) { + if(ItemToUse != nullptr) { //check type and damage/delay if(ItemToUse->ItemClass != ItemClassCommon || ItemToUse->Damage == 0 || ItemToUse->Delay == 0) { //no weapon - ItemToUse = NULL; + ItemToUse = nullptr; } // Check to see if skill is valid else if((ItemToUse->ItemType > ItemTypeThrowing) && (ItemToUse->ItemType != ItemTypeHand2Hand) && (ItemToUse->ItemType != ItemType2HPierce)) { //no weapon - ItemToUse = NULL; + ItemToUse = nullptr; } } @@ -9400,7 +9400,7 @@ void Bot::SetAttackTimer() { DelayMod = -99; //if we have no weapon.. - if (ItemToUse == NULL) { + if (ItemToUse == nullptr) { //above checks ensure ranged weapons do not fall into here // Work out if we're a monk if ((GetClass() == MONK) || (GetClass() == BEASTLORD)) { @@ -11624,7 +11624,7 @@ Bot* Bot::GetFirstBotInGroup(Group* group) { if(group) { for(int Counter = 0; Counter < MAX_GROUP_MEMBERS; Counter++) { - if (group->members[Counter] == NULL) { + if (group->members[Counter] == nullptr) { continue; } @@ -11984,7 +11984,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { // pull if(!strcasecmp(sep->arg[1], "pull")) { Mob *target = c->GetTarget(); - if(target == NULL || target == c || target->IsBot() || (target->IsPet() && target->GetOwner()->IsBot())) + if(target == nullptr || target == c || target->IsBot() || (target->IsPet() && target->GetOwner()->IsBot())) { c->Message(15, "You must select a monster"); return; @@ -12019,7 +12019,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { // added Bot follow distance - SetFollowDistance if(!strcasecmp(sep->arg[1], "setfollowdistance")) { - if((c->GetTarget() == NULL) || (c->GetTarget() == c) || (!c->GetTarget()->IsBot()) || (c->GetTarget()->CastToBot()->GetBotOwner() != c)) { + if((c->GetTarget() == nullptr) || (c->GetTarget() == c) || (!c->GetTarget()->IsBot()) || (c->GetTarget()->CastToBot()->GetBotOwner() != c)) { c->Message(15, "You must target a bot you own!"); } else { @@ -12201,7 +12201,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(!strcasecmp(sep->arg[1], "delete") ) { - if((c->GetTarget() == NULL) || !c->GetTarget()->IsBot()) + if((c->GetTarget() == nullptr) || !c->GetTarget()->IsBot()) { c->Message(15, "You must target a bot!"); return; @@ -12421,7 +12421,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(!strcasecmp(sep->arg[1], "archery")) { - if((c->GetTarget() == NULL) || (c->GetTarget() == c) || !c->GetTarget()->IsBot()) { + if((c->GetTarget() == nullptr) || (c->GetTarget() == c) || !c->GetTarget()->IsBot()) { c->Message(15, "You must target a bot!"); return; } @@ -12444,7 +12444,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(!strcasecmp(sep->arg[1], "picklock")) { - if((c->GetTarget() == NULL) || (c->GetTarget() == c) || !c->GetTarget()->IsBot() || (c->GetTarget()->GetClass() != ROGUE)) { + if((c->GetTarget() == nullptr) || (c->GetTarget() == c) || !c->GetTarget()->IsBot() || (c->GetTarget()->GetClass() != ROGUE)) { c->Message(15, "You must target a rogue bot!"); } else { @@ -12455,7 +12455,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(!strcasecmp(sep->arg[1], "summon")) { - if((c->GetTarget() == NULL) || (c->GetTarget() == c) || !c->GetTarget()->IsBot() || c->GetTarget()->IsPet()) + if((c->GetTarget() == nullptr) || (c->GetTarget() == c) || !c->GetTarget()->IsBot() || c->GetTarget()->IsPet()) { c->Message(15, "You must target a bot!"); } @@ -12484,7 +12484,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(!strcasecmp(sep->arg[1], "inventory") && !strcasecmp(sep->arg[2], "list")) { - if(c->GetTarget() != NULL) { + if(c->GetTarget() != nullptr) { if(c->GetTarget()->IsBot() && c->GetTarget()->CastToBot()->GetBotOwnerCharacterID() == c->CharacterID()) { Mob* b = c->GetTarget(); int x = c->GetTarget()->CastToBot()->GetBotItemsCount(&TempErrorMessage); @@ -12497,8 +12497,8 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { const char* equipped[22] = {"Charm", "Left Ear", "Head", "Face", "Right Ear", "Neck", "Shoulders", "Arms", "Back", "Left Wrist", "Right Wrist", "Range", "Hands", "Primary Hand", "Secondary Hand", "Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo" }; - const ItemInst* item1 = NULL; - const Item_Struct* item2 = NULL; + const ItemInst* item1 = nullptr; + const Item_Struct* item2 = nullptr; bool is2Hweapon = false; for(int i=0; i<22; ++i) { @@ -12510,7 +12510,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(item1) item2 = item1->GetItem(); else - item2 = NULL; + item2 = nullptr; if(!TempErrorMessage.empty()) { c->Message(13, "Database Error: %s", TempErrorMessage.c_str()); @@ -12610,7 +12610,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(!strcasecmp(sep->arg[1], "inventory") && !strcasecmp(sep->arg[2], "remove")) { - if((c->GetTarget() == NULL) || (sep->arg[3] == '\0') || !c->GetTarget()->IsBot()) + if((c->GetTarget() == nullptr) || (sep->arg[3] == '\0') || !c->GetTarget()->IsBot()) { c->Message(15, "Usage: #bot inventory remove [slotid] (You must have a bot targetted) "); return; @@ -12629,7 +12629,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { "Left Wrist", "Right Wrist", "Range", "Hands", "Primary Hand", "Secondary Hand", "Left Finger", "Right Finger", "Chest", "Legs", "Feet", "Waist", "Ammo" }; - const Item_Struct* itm = NULL; + const Item_Struct* itm = nullptr; const ItemInst* itminst = c->GetTarget()->CastToBot()->GetBotItem(slotId); if(itminst) itm = itminst->GetItem(); @@ -12744,7 +12744,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(!strcasecmp(sep->arg[1], "update")) { // Congdar: add IsEngaged check for exploit to keep bots alive by repeatedly using #bot update. - if((c->GetTarget() != NULL) && c->GetTarget()->IsBot()) { + if((c->GetTarget() != nullptr) && c->GetTarget()->IsBot()) { if(c->GetLevel() <= c->GetTarget()->GetLevel()) { c->Message(15, "This bot has already been updated."); return; @@ -12787,7 +12787,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { //Bind if(!strcasecmp(sep->arg[1], "bindme")) { - Mob *binder = NULL; + Mob *binder = nullptr; bool hasbinder = false; if(c->IsGrouped()) { @@ -12815,7 +12815,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { // Rune if(!strcasecmp(sep->arg[1], "runeme")) { - Mob *runeer = NULL; + Mob *runeer = nullptr; bool hasruneer = false; if(c->IsGrouped()) { @@ -13065,7 +13065,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(!strcasecmp(sep->arg[1], "ai") && !strcasecmp(sep->arg[2], "mez")) { Mob *target = c->GetTarget(); - if(target == NULL || target == c || target->IsBot() || (target->IsPet() && target->GetOwner()->IsBot())) + if(target == nullptr || target == c || target->IsBot() || (target->IsPet() && target->GetOwner()->IsBot())) { c->Message(15, "You must select a monster"); return; @@ -13147,7 +13147,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(!strcasecmp(sep->arg[1], "resurrectme")) { Mob *target = c->GetTarget(); - if(target == NULL || !target->IsCorpse()) + if(target == nullptr || !target->IsCorpse()) { c->Message(15, "You must select a corpse"); return; @@ -13261,7 +13261,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { //Summon Corpse if(!strcasecmp(sep->arg[1], "corpse") && !strcasecmp(sep->arg[2], "summon")) { - if(c->GetTarget() == NULL) { + if(c->GetTarget() == nullptr) { c->Message(15, "You must select player with his corpse in the zone."); return; } @@ -13315,7 +13315,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { { Mob *target = c->GetTarget(); - if(target == NULL || target->IsClient() || target->IsBot() || target->IsPet() && target->GetOwner()->IsBot()) + if(target == nullptr || target->IsClient() || target->IsBot() || target->IsPet() && target->GetOwner()->IsBot()) c->Message(15, "You must select a monster"); else { if(c->IsGrouped()) { @@ -13367,7 +13367,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(!strcasecmp(sep->arg[1], "charm")) { Mob *target = c->GetTarget(); - if(target == NULL || target->IsClient() || target->IsBot() || (target->IsPet() && target->GetOwner()->IsBot())) + if(target == nullptr || target->IsClient() || target->IsBot() || (target->IsPet() && target->GetOwner()->IsBot())) { c->Message(15, "You must select a monster"); return; @@ -13447,7 +13447,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { // Remove Bot's Pet if(!strcasecmp(sep->arg[1], "pet") && !strcasecmp(sep->arg[2], "remove")) { - if(c->GetTarget() != NULL) { + if(c->GetTarget() != nullptr) { if (c->IsGrouped() && c->GetTarget()->IsBot() && (c->GetTarget()->CastToBot()->GetBotOwner() == c) && ((c->GetTarget()->GetClass() == NECROMANCER) || (c->GetTarget()->GetClass() == ENCHANTER) || (c->GetTarget()->GetClass() == DRUID))) { if(c->GetTarget()->CastToBot()->IsBotCharmer()) { @@ -13480,7 +13480,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(!strcasecmp(sep->arg[1], "Dire") && !strcasecmp(sep->arg[2], "Charm")) { Mob *target = c->GetTarget(); - if(target == NULL || target->IsClient() || target->IsBot() || (target->IsPet() && target->GetOwner()->IsBot())) + if(target == nullptr || target->IsClient() || target->IsBot() || (target->IsPet() && target->GetOwner()->IsBot())) { c->Message(15, "You must select a monster"); return; @@ -13560,7 +13560,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { // Evacuate if(!strcasecmp(sep->arg[1], "evac")) { - Mob *evac = NULL; + Mob *evac = nullptr; bool hasevac = false; if(c->IsGrouped()) { @@ -13728,7 +13728,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { Group *g = c->GetGroup(); Mob *target = c->GetTarget(); - if(target == NULL || (!target->IsClient() && (c->GetTarget()->CastToBot()->GetBotOwner() != c))) + if(target == nullptr || (!target->IsClient() && (c->GetTarget()->CastToBot()->GetBotOwner() != c))) c->Message(15, "You must select a player or bot you own"); else if(g) { @@ -14658,7 +14658,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { BotGroupOrderGuard(c->GetGroup(), c); } else if(!strcasecmp(sep->arg[2], "attack")) { - if(c->IsGrouped() && (c->GetTarget() != NULL) && c->IsAttackAllowed(c->GetTarget())) { + if(c->IsGrouped() && (c->GetTarget() != nullptr) && c->IsAttackAllowed(c->GetTarget())) { BotGroupOrderAttack(c->GetGroup(), c->GetTarget(), c); } else @@ -15339,7 +15339,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { Bot* targetedBot; - if(c->GetTarget() != NULL) { + if(c->GetTarget() != nullptr) { if (c->GetTarget()->IsBot() && (c->GetTarget()->CastToBot()->GetBotOwner() == c)) targetedBot = c->GetTarget()->CastToBot(); else @@ -15378,7 +15378,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(!strcasecmp(sep->arg[1], "stance")) { if(sep->argnum == 3){ - Bot* tempBot = NULL; + Bot* tempBot = nullptr; std::string botName = std::string(sep->arg[2]); if(!botName.empty()) @@ -15627,7 +15627,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { } if(leaderBot) { - Mob* target = NULL; + Mob* target = nullptr; uint32 timer; bool fastHeals = false; @@ -15836,7 +15836,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(!targetName.empty()) target = entity_list.GetMob(targetName.c_str()); else { - if(c->GetTarget() != NULL) { + if(c->GetTarget() != nullptr) { target = c->GetTarget(); } } @@ -16543,7 +16543,7 @@ void EntityList::AddBot(Bot *newBot, bool SendSpawnPacket, bool dontqueue) { safe_delete(ns); } - parse->EventNPC(EVENT_SPAWN, newBot, NULL, "", 0); + parse->EventNPC(EVENT_SPAWN, newBot, nullptr, "", 0); } bot_list.push_back(newBot); @@ -17376,9 +17376,9 @@ void Bot::ClearHealRotationTargets() { } Mob* Bot::GetHealRotationTarget( ) { - Mob* tank = NULL; - Mob* first = NULL; - Mob* target = NULL; + Mob* tank = nullptr; + Mob* first = nullptr; + Mob* target = nullptr; int removeIndex = 0; int count = 0; @@ -17432,7 +17432,7 @@ Mob* Bot::GetHealRotationTarget( ) { } Mob* Bot::GetHealRotationTarget( uint8 index ) { - Mob* target = NULL; + Mob* target = nullptr; if(_healRotationTargets[index] > 0) { //get target at specified index @@ -17445,7 +17445,7 @@ Mob* Bot::GetHealRotationTarget( uint8 index ) { list Bot::GetBotsInHealRotation(Bot* rotationLeader) { list Result; - if(rotationLeader != NULL) { + if(rotationLeader != nullptr) { Result.push_back(rotationLeader); Bot* rotationMember = rotationLeader->GetNextHealRotationMember(); diff --git a/zone/bot.h b/zone/bot.h index d5bd5d113..2d86cd8db 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -193,7 +193,7 @@ public: virtual int32 CheckAggroAmount(uint16 spellid); virtual void CalcBonuses(); void CalcItemBonuses(); - virtual void MakePet(uint16 spell_id, const char* pettype, const char *petname = NULL); + virtual void MakePet(uint16 spell_id, const char* pettype, const char *petname = nullptr); virtual FACTION_VALUE GetReverseFactionCon(Mob* iOther); inline virtual bool IsPet() { return false; } virtual bool IsNPC() const { return false; } @@ -315,7 +315,7 @@ public: virtual float GetAOERange(uint16 spell_id); virtual bool SpellEffect(Mob* caster, uint16 spell_id, float partial = 100); virtual void DoBuffTic(uint16 spell_id, uint32 ticsremaining, uint8 caster_level, Mob* caster = 0); - virtual bool CastSpell(uint16 spell_id, uint16 target_id, uint16 slot = 10, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0, uint32 item_slot = 0xFFFFFFFF, int16 *resist_adjust = NULL); + virtual bool CastSpell(uint16 spell_id, uint16 target_id, uint16 slot = 10, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0, uint32 item_slot = 0xFFFFFFFF, int16 *resist_adjust = nullptr); virtual bool SpellOnTarget(uint16 spell_id, Mob* spelltar); virtual bool IsImmuneToSpell(uint16 spell_id, Mob *caster); virtual bool DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction); diff --git a/zone/client.cpp b/zone/client.cpp index b468f922e..04f15841c 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -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); } } } diff --git a/zone/client.h b/zone/client.h index 2d7aa2ac7..edbd7b445 100644 --- a/zone/client.h +++ b/zone/client.h @@ -238,7 +238,7 @@ public: void TradeRequestFailed(const EQApplicationPacket* app); void BuyTraderItem(TraderBuy_Struct* tbs,Client* trader,const EQApplicationPacket* app); void TraderUpdate(uint16 slot_id,uint32 trader_id); - void FinishTrade(Mob* with, ServerPacket* qspack = NULL, bool finalizer = false); + void FinishTrade(Mob* with, ServerPacket* qspack = nullptr, bool finalizer = false); void SendZonePoints(); void SendBuyerResults(char *SearchQuery, uint32 SearchID); @@ -256,7 +256,7 @@ public: void SendPacketQueue(bool Block = true); void QueuePacket(const EQApplicationPacket* app, bool ack_req = true, CLIENT_CONN_STATUS = CLIENT_CONNECTINGALL, eqFilterType filter=FilterNone); void FastQueuePacket(EQApplicationPacket** app, bool ack_req = true, CLIENT_CONN_STATUS = CLIENT_CONNECTINGALL); - void ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_skill, const char* orig_message, const char* targetname=NULL); + void ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_skill, const char* orig_message, const char* targetname=nullptr); void ChannelMessageSend(const char* from, const char* to, uint8 chan_num, uint8 language, const char* message, ...); void ChannelMessageSend(const char* from, const char* to, uint8 chan_num, uint8 language, uint8 lang_skill, const char* message, ...); void Message(uint32 type, const char* message, ...); @@ -355,7 +355,7 @@ public: inline uint8 GetLanguageSkill(uint16 n) const { return m_pp.languages[n]; } - void SendPickPocketResponse(Mob *from, uint32 amt, int type, const Item_Struct* item = NULL); + void SendPickPocketResponse(Mob *from, uint32 amt, int type, const Item_Struct* item = nullptr); inline const char* GetLastName() const { return lastname; } @@ -879,7 +879,7 @@ public: inline bool SaveTaskState() { return (taskmanager ? taskmanager->SaveClientState(this, taskstate) : false); } - inline bool IsTaskStateLoaded() { return taskstate != NULL; } + inline bool IsTaskStateLoaded() { return taskstate != nullptr; } inline bool IsTaskActive(int TaskID) { return (taskstate ? taskstate->IsTaskActive(TaskID) : false); } @@ -990,19 +990,19 @@ public: void AdventureFinish(bool win, int theme, int points); void SetAdventureData(char *data) { adv_data = data; } void ClearAdventureData() { safe_delete(adv_data); } - bool HasAdventureData() { return adv_data != NULL; } + bool HasAdventureData() { return adv_data != nullptr; } void ClearCurrentAdventure(); void PendingAdventureRequest() { adventure_request_timer = new Timer(8000); } - bool GetPendingAdventureRequest() const { return (adventure_request_timer != NULL); } + bool GetPendingAdventureRequest() const { return (adventure_request_timer != nullptr); } void ClearPendingAdventureRequest() { safe_delete(adventure_request_timer); } void PendingAdventureCreate() { adventure_create_timer = new Timer(8000); } - bool GetPendingAdventureCreate() const { return (adventure_create_timer != NULL); } + bool GetPendingAdventureCreate() const { return (adventure_create_timer != nullptr); } void ClearPendingAdventureCreate() { safe_delete(adventure_create_timer); } void PendingAdventureLeave() { adventure_leave_timer = new Timer(8000); } - bool GetPendingAdventureLeave() const { return (adventure_leave_timer != NULL); } + bool GetPendingAdventureLeave() const { return (adventure_leave_timer != nullptr); } void ClearPendingAdventureLeave() { safe_delete(adventure_leave_timer); } void PendingAdventureDoorClick() { adventure_door_timer = new Timer(8000); } - bool GetPendingAdventureDoorClick() const { return (adventure_door_timer != NULL); } + bool GetPendingAdventureDoorClick() const { return (adventure_door_timer != nullptr); } void ClearPendingAdventureDoorClick() { safe_delete(adventure_door_timer); } void ClearPendingAdventureData(); @@ -1090,7 +1090,7 @@ public: bool IsXTarget(const Mob *m) const; bool IsClientXTarget(const Client *c) const; void UpdateClientXTarget(Client *c); - void UpdateXTargetType(XTargetType Type, Mob *m, const char *Name = NULL); + void UpdateXTargetType(XTargetType Type, Mob *m, const char *Name = nullptr); void AddAutoXTarget(Mob *m); void RemoveXTarget(Mob *m, bool OnlyAutoSlots); void SendXTargetPacket(uint32 Slot, Mob *m); diff --git a/zone/client_logs.cpp b/zone/client_logs.cpp index 3e25176fa..ac1dcdf83 100644 --- a/zone/client_logs.cpp +++ b/zone/client_logs.cpp @@ -30,7 +30,7 @@ char ClientLogs::_buffer[MAX_CLIENT_LOG_MESSAGE_LENGTH+1]; void ClientLogs::subscribe(EQEMuLog::LogIDs id, Client *c) { if(id >= EQEMuLog::MaxLogID) return; - if(c == NULL) + if(c == nullptr) return; //make sure they arnt allready subscribed. @@ -52,7 +52,7 @@ void ClientLogs::subscribe(EQEMuLog::LogIDs id, Client *c) { void ClientLogs::unsubscribe(EQEMuLog::LogIDs id, Client *c) { if(id >= EQEMuLog::MaxLogID) return; - if(c == NULL) + if(c == nullptr) return; vector::iterator cur,end; @@ -67,7 +67,7 @@ void ClientLogs::unsubscribe(EQEMuLog::LogIDs id, Client *c) { } void ClientLogs::subscribeAll(Client *c) { - if(c == NULL) + if(c == nullptr) return; int r; for(r = EQEMuLog::Status; r < EQEMuLog::MaxLogID; r++) { @@ -76,7 +76,7 @@ void ClientLogs::subscribeAll(Client *c) { } void ClientLogs::unsubscribeAll(Client *c) { - if(c == NULL) + if(c == nullptr) return; int r; for(r = EQEMuLog::Status; r < EQEMuLog::MaxLogID; r++) { diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index f9242bc85..09f10a4c7 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -1120,7 +1120,7 @@ int32 Client::CalcManaRegen() this->medding = true; regen = (((GetSkill(MEDITATE) / 10) + (clevel - (clevel / 4))) / 4) + 4; regen += spellbonuses.ManaRegen + itembonuses.ManaRegen; - CheckIncreaseSkill(MEDITATE, NULL, -5); + CheckIncreaseSkill(MEDITATE, nullptr, -5); } else regen = 2 + spellbonuses.ManaRegen + itembonuses.ManaRegen; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index c27ee0a73..731f10f47 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -451,7 +451,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) case CLIENT_CONNECTED: { ClientPacketProc p; p = ConnectedOpcodes[opcode]; - if(p == NULL) { + if(p == nullptr) { char buffer[64]; app->build_header_dump(buffer); mlog(CLIENT__NET_ERR, "Unhandled incoming opcode: %s", buffer); @@ -933,7 +933,7 @@ void Client::CheatDetected(CheatTypes CheatType, float x, float y, float z) && ((this->Admin() < RuleI(Zone, MQWarpExemptStatus) || (RuleI(Zone, MQWarpExemptStatus)) == -1))) { - char *hString = NULL; + char *hString = nullptr; MakeAnyLenString(&hString, "/MQWarp(SS) with location %.2f, %.2f, %.2f, the target was shadow step exempt but we still found this suspicious.", GetX(), GetY(), GetZ()); database.SetMQDetectionFlag(this->account_name,this->name, hString, zone->GetShortName()); safe_delete_array(hString); @@ -944,7 +944,7 @@ void Client::CheatDetected(CheatTypes CheatType, float x, float y, float z) && ((this->Admin() < RuleI(Zone, MQWarpExemptStatus) || (RuleI(Zone, MQWarpExemptStatus)) == -1))) { - char *hString = NULL; + char *hString = nullptr; MakeAnyLenString(&hString, "/MQWarp(KB) with location %.2f, %.2f, %.2f, the target was Knock Back exempt but we still found this suspicious.", GetX(), GetY(), GetZ()); database.SetMQDetectionFlag(this->account_name,this->name, hString, zone->GetShortName()); safe_delete_array(hString); @@ -958,7 +958,7 @@ void Client::CheatDetected(CheatTypes CheatType, float x, float y, float z) { if(RuleB(Zone, MarkMQWarpLT)) { - char *hString = NULL; + char *hString = nullptr; MakeAnyLenString(&hString, "/MQWarp(LT) with location %.2f, %.2f, %.2f, running fast but not fast enough to get killed, possibly: small warp, speed hack, excessive lag, marked as suspicious.", GetX(), GetY(), GetZ()); database.SetMQDetectionFlag(this->account_name,this->name, hString, zone->GetShortName()); safe_delete_array(hString); @@ -1003,7 +1003,7 @@ void Client::CheatDetected(CheatTypes CheatType, float x, float y, float z) } break; default: - char *hString = NULL; + char *hString = nullptr; MakeAnyLenString(&hString, "Unhandled HackerDetection flag with location %.2f, %.2f, %.2f.", GetX(), GetY(), GetZ()); database.SetMQDetectionFlag(this->account_name,this->name, hString, zone->GetShortName()); safe_delete_array(hString); @@ -1240,7 +1240,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) if(IsTracking() && ((x_pos!=ppu->x_pos) || (y_pos!=ppu->y_pos))){ if(MakeRandomFloat(0, 100) < 70)//should be good - CheckIncreaseSkill(TRACKING, NULL, -20); + CheckIncreaseSkill(TRACKING, nullptr, -20); } // Break Hide if moving without sneaking and set rewind timer if moved @@ -1278,7 +1278,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) #ifdef PACKET_UPDATE_MANAGER entity_list.QueueManaged(this,outapp,true,false); #else - entity_list.QueueCloseClients(this,outapp,true,300,NULL,false); + entity_list.QueueCloseClients(this,outapp,true,300,nullptr,false); #endif safe_delete(outapp); } @@ -1287,7 +1287,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) { if(zone->watermap->InLiquid(x_pos, y_pos, z_pos)) { - CheckIncreaseSkill(SWIMMING, NULL, -17); + CheckIncreaseSkill(SWIMMING, nullptr, -17); } } @@ -1316,7 +1316,7 @@ void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app) 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; } else if (app->pBuffer[0] == 1) { @@ -1348,7 +1348,7 @@ void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app) 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; } } @@ -1435,9 +1435,9 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) } else { - SetTarget(NULL); + SetTarget(nullptr); SetHoTT(0); - UpdateXTargetType(TargetsTarget, NULL); + UpdateXTargetType(TargetsTarget, nullptr); Group *g = GetGroup(); @@ -1455,9 +1455,9 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) } else { - SetTarget(NULL); + SetTarget(nullptr); SetHoTT(0); - UpdateXTargetType(TargetsTarget, NULL); + UpdateXTargetType(TargetsTarget, nullptr); return; } @@ -1470,7 +1470,7 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) else { SetHoTT(0); - UpdateXTargetType(TargetsTarget, NULL); + UpdateXTargetType(TargetsTarget, nullptr); } Group *g = GetGroup(); @@ -1498,7 +1498,7 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) outapp->pBuffer[4] = 0x0d; if(GetTarget()) { - SetTarget(NULL); + SetTarget(nullptr); } QueuePacket(outapp); safe_delete(outapp); @@ -1519,7 +1519,7 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) outapp->pBuffer[4] = 0x0d; if(GetTarget()) { - SetTarget(NULL); + SetTarget(nullptr); } QueuePacket(outapp); safe_delete(outapp); @@ -1543,12 +1543,12 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) else if(GetTarget()->GetBodyType() == BT_NoTarget2 || GetTarget()->GetBodyType() == BT_Special || GetTarget()->GetBodyType() == BT_NoTarget) { - char *hacker_str = NULL; + char *hacker_str = nullptr; MakeAnyLenString(&hacker_str, "%s attempting to target something untargetable, %s bodytype: %i\n", GetName(), GetTarget()->GetName(), (int)GetTarget()->GetBodyType()); database.SetMQDetectionFlag(AccountName(), GetName(), hacker_str, zone->GetShortName()); safe_delete_array(hacker_str); - SetTarget((Mob*)NULL); + SetTarget((Mob*)nullptr); return; } else if(IsPortExempted()) @@ -1568,28 +1568,28 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) { if(DistNoRoot(*GetTarget()) > (zone->newzone_data.maxclip*zone->newzone_data.maxclip)) { - char *hacker_str = NULL; + char *hacker_str = nullptr; MakeAnyLenString(&hacker_str, "%s attempting to target something beyond the clip plane of %.2f units," " from (%.2f, %.2f, %.2f) to %s (%.2f, %.2f, %.2f)", GetName(), (zone->newzone_data.maxclip*zone->newzone_data.maxclip), GetX(), GetY(), GetZ(), GetTarget()->GetName(), GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ()); database.SetMQDetectionFlag(AccountName(), GetName(), hacker_str, zone->GetShortName()); safe_delete_array(hacker_str); - SetTarget(NULL); + SetTarget(nullptr); return; } } } else if(DistNoRoot(*GetTarget()) > (zone->newzone_data.maxclip*zone->newzone_data.maxclip)) { - char *hacker_str = NULL; + char *hacker_str = nullptr; MakeAnyLenString(&hacker_str, "%s attempting to target something beyond the clip plane of %.2f units," " from (%.2f, %.2f, %.2f) to %s (%.2f, %.2f, %.2f)", GetName(), (zone->newzone_data.maxclip*zone->newzone_data.maxclip), GetX(), GetY(), GetZ(), GetTarget()->GetName(), GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ()); database.SetMQDetectionFlag(AccountName(), GetName(), hacker_str, zone->GetShortName()); safe_delete_array(hacker_str); - SetTarget(NULL); + SetTarget(nullptr); return; } @@ -1744,8 +1744,8 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) AdventureRequest_Struct* ars = (AdventureRequest_Struct*)app->pBuffer; uint8 group_members = 0; - Raid *r = NULL; - Group *g = NULL; + Raid *r = nullptr; + Group *g = nullptr; if(IsRaidGrouped()) { @@ -1796,7 +1796,7 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) break; } - const char *c_name = NULL; + const char *c_name = nullptr; c_name = r->GetClientNameByIndex(x); if(c_name) { @@ -1815,7 +1815,7 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) break; } - const char *c_name = NULL; + const char *c_name = nullptr; c_name = g->GetClientNameByIndex(x); if(c_name) { @@ -1937,7 +1937,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) } ItemInst *myitem = GetInv().GetItem(pcs->slot); - if(myitem == NULL) { + if(myitem == nullptr) { LogFile->write(EQEMuLog::Error, "Consuming from empty slot %d", pcs->slot); return; } @@ -2179,7 +2179,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) //DeleteItemInInventory(slot_id, 1, false); //entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); //Should add intoxication level to the PP at some point - //CheckIncreaseSkill(ALCOHOL_TOLERANCE, NULL, 25); + //CheckIncreaseSkill(ALCOHOL_TOLERANCE, nullptr, 25); } if (m_pp.hunger_level > 6000) @@ -2336,7 +2336,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) merchantid = tmp->CastToNPC()->MerchantType; - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; bool found = false; std::list merlist = zone->merchanttable[merchantid]; std::list::const_iterator itr; @@ -2683,7 +2683,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app) } QueuePacket(outapp); safe_delete(outapp); - CheckIncreaseSkill(BEGGING, NULL, -10); + CheckIncreaseSkill(BEGGING, nullptr, -10); } void Client::Handle_OP_TestBuff(const EQApplicationPacket *app) @@ -2712,7 +2712,7 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) Surname_Struct* surname = (Surname_Struct*) app->pBuffer; - char *c = NULL; + char *c = nullptr; bool first = true; for(c = surname->lastname; *c; c++) { @@ -2950,7 +2950,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) { if(GetClientVersion() < EQClientSoF) { - char *hack_str = NULL; + char *hack_str = nullptr; MakeAnyLenString(&hack_str, "Player sent OP_SpawnAppearance with AT_Invis: %i", sa->parameter); database.SetMQDetectionFlag(this->account_name, this->name, hack_str, zone->GetShortName()); safe_delete_array(hack_str); @@ -3049,7 +3049,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) { if(!HasSkill(SNEAK)) { - char *hack_str = NULL; + char *hack_str = nullptr; MakeAnyLenString(&hack_str, "Player sent OP_SpawnAppearance with AT_Sneak: %i", sa->parameter); database.SetMQDetectionFlag(this->account_name, this->name, hack_str, zone->GetShortName()); safe_delete_array(hack_str); @@ -3061,7 +3061,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) } else if (sa->type == AT_Size) { - char *hack_str = NULL; + char *hack_str = nullptr; MakeAnyLenString(&hack_str, "Player sent OP_SpawnAppearance with AT_Size: %i", sa->parameter); database.SetMQDetectionFlag(this->account_name, this->name, hack_str, zone->GetShortName()); safe_delete_array(hack_str); @@ -3280,7 +3280,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) { if(mi->from_slot != mi->to_slot && (mi->from_slot < 30 || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot)) { - char *detect = NULL; + char *detect = nullptr; const ItemInst *itm_from = GetInv().GetItem(mi->from_slot); const ItemInst *itm_to = GetInv().GetItem(mi->to_slot); MakeAnyLenString(&detect, "Player issued a move item from %u(item id %u) to %u(item id %u) while casting %u.", @@ -3403,7 +3403,7 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app) SetFeigned(true); } - CheckIncreaseSkill(FEIGN_DEATH, NULL, 5); + CheckIncreaseSkill(FEIGN_DEATH, nullptr, 5); return; } @@ -3433,7 +3433,7 @@ void Client::Handle_OP_Sneak(const EQApplicationPacket *app) safe_delete(outapp); } else { - CheckIncreaseSkill(SNEAK, NULL, 5); + CheckIncreaseSkill(SNEAK, nullptr, 5); } float hidechance = ((GetSkill(SNEAK)/300.0f) + .25) * 100; float random = MakeRandomFloat(0, 99); @@ -3479,7 +3479,7 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app) float hidechance = ((GetSkill(HIDE)/250.0f) + .25) * 100; float random = MakeRandomFloat(0, 100); - CheckIncreaseSkill(HIDE, NULL, 5); + CheckIncreaseSkill(HIDE, nullptr, 5); if (random < hidechance) { EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct)); SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer; @@ -3634,7 +3634,7 @@ void Client::Handle_OP_GMZoneRequest(const EQApplicationPacket *app) if (gmzr->zone_id == 0) zid = zonesummon_id; const char * zname = database.GetZoneName(zid); - if(zname == NULL) + if(zname == nullptr) tarzone[0] = 0; else strcpy(tarzone, zname); @@ -4694,7 +4694,7 @@ void Client::Handle_OP_DeleteItem(const EQApplicationPacket *app) const ItemInst *inst = GetInv().GetItem(alc->from_slot); if (inst && inst->GetItem()->ItemType == ItemTypeAlcohol) { entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), inst->GetItem()->Name); - CheckIncreaseSkill(ALCOHOL_TOLERANCE, NULL, 25); + CheckIncreaseSkill(ALCOHOL_TOLERANCE, nullptr, 25); int16 AlcoholTolerance = GetSkill(ALCOHOL_TOLERANCE); int16 IntoxicationIncrease; @@ -4740,7 +4740,7 @@ void Client::Handle_OP_Taunt(const EQApplicationPacket *app) } p_timers.Start(pTimerTaunt, TauntReuseTime-1); - if(GetTarget() == NULL || !GetTarget()->IsNPC()) + if(GetTarget() == nullptr || !GetTarget()->IsNPC()) return; Taunt(GetTarget()->CastToNPC(), false); @@ -5308,7 +5308,7 @@ void Client::Handle_OP_GMGoto(const EQApplicationPacket *app) } GMSummon_Struct* gmg = (GMSummon_Struct*) app->pBuffer; Mob* gt = entity_list.GetMob(gmg->charname); - if (gt != NULL) { + if (gt != nullptr) { this->MovePC(zone->GetZoneID(), zone->GetInstanceID(), gt->GetX(), gt->GetY(), gt->GetZ(), gt->GetHeading()); } else if (!worldserver.Connected()) @@ -5354,7 +5354,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) outtcs->Approval = Customer->WithCustomer(GetID()); else { _log(TRADING__CLIENT, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" - " returned a NULL pointer"); + " returned a nullptr pointer"); return; } @@ -5563,7 +5563,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) break; } } - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; uint32 prevcharges = 0; if (item_id == 0) { //check to see if its on the temporary table std::list tmp_merlist = zone->tmpmerchanttable[tmp->GetNPCTypeID()]; @@ -5635,7 +5635,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) if(!TakeMoneyFromPP(mpo->price)) { - char *hacker_str = NULL; + char *hacker_str = nullptr; MakeAnyLenString(&hacker_str, "Vendor Cheat: attempted to buy %i of %i: %s that cost %d cp but only has %d pp %d gp %d sp %d cp\n", mpo->quantity, item->ID, item->Name, mpo->price, m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); @@ -5652,7 +5652,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) //make sure we are not completely full... if(freeslotid == SLOT_CURSOR) { - if(m_inv.GetItem(SLOT_CURSOR) != NULL) { + if(m_inv.GetItem(SLOT_CURSOR) != nullptr) { Message(13, "You do not have room for any more items."); safe_delete(outapp); safe_delete(inst); @@ -5921,7 +5921,7 @@ void Client::Handle_OP_CloseContainer(const EQApplicationPacket *app) return; } - SetTradeskillObject(NULL); + SetTradeskillObject(nullptr); ClickObjectAck_Struct* oos = (ClickObjectAck_Struct*)app->pBuffer; Entity* entity = entity_list.GetEntityObject(oos->drop_id); @@ -5976,7 +5976,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) } } - SetTradeskillObject(NULL); + SetTradeskillObject(nullptr); EQApplicationPacket end_trade1(OP_FinishWindow, 0); QueuePacket(&end_trade1); @@ -6069,7 +6069,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) " LEFT JOIN tradeskill_recipe_entries AS tre ON tr.id=tre.recipe_id " " LEFT JOIN (SELECT recipe_id, madecount FROM char_recipe_list WHERE char_id = %u) AS crl ON tr.id=crl.recipe_id " " WHERE tr.id IN (%s) " - " AND tr.must_learn & 0x20 <> 0x20 AND ((tr.must_learn & 0x3 <> 0 AND crl.madecount IS NOT NULL) OR (tr.must_learn & 0x3 = 0)) " + " AND tr.must_learn & 0x20 <> 0x20 AND ((tr.must_learn & 0x3 <> 0 AND crl.madecount IS NOT nullptr) OR (tr.must_learn & 0x3 = 0)) " " GROUP BY tr.id " " HAVING sum(if(tre.item_id %s AND tre.iscontainer > 0,1,0)) > 0 " " LIMIT 100 ", CharacterID(), buf, containers); @@ -6124,7 +6124,7 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) " LEFT JOIN tradeskill_recipe_entries AS tre ON tr.id=tre.recipe_id " " LEFT JOIN (SELECT recipe_id, madecount FROM char_recipe_list WHERE char_id = %u) AS crl ON tr.id=crl.recipe_id " " WHERE %s tr.trivial >= %u AND tr.trivial <= %u " - " AND tr.must_learn & 0x20 <> 0x20 AND((tr.must_learn & 0x3 <> 0 AND crl.madecount IS NOT NULL) OR (tr.must_learn & 0x3 = 0)) " + " AND tr.must_learn & 0x20 <> 0x20 AND((tr.must_learn & 0x3 <> 0 AND crl.madecount IS NOT nullptr) OR (tr.must_learn & 0x3 = 0)) " " GROUP BY tr.id " " HAVING sum(if(tre.item_id %s AND tre.iscontainer > 0,1,0)) > 0 " " LIMIT 200 " @@ -6171,7 +6171,7 @@ void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app) sizeof(NewCombine_Struct), app->size); return; } - /*if (m_tradeskill_object == NULL) { + /*if (m_tradeskill_object == nullptr) { Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use"); return; }*/ @@ -6193,7 +6193,7 @@ void Client::Handle_OP_ItemName(const EQApplicationPacket *app) } ItemNamePacket_Struct *p = (ItemNamePacket_Struct*)app->pBuffer; const Item_Struct *item = 0; - if ((item = database.GetItem(p->item_id))!=NULL) { + if ((item = database.GetItem(p->item_id))!=nullptr) { EQApplicationPacket* outapp=new EQApplicationPacket(OP_ItemName,sizeof(ItemNamePacket_Struct)); p=(ItemNamePacket_Struct*)outapp->pBuffer; memset(p, 0, sizeof(ItemNamePacket_Struct)); @@ -6210,7 +6210,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) sizeof(AugmentItem_Struct), app->size); return; } - /*if (m_tradeskill_object == NULL) { + /*if (m_tradeskill_object == nullptr) { Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use"); return; }*/ @@ -6358,7 +6358,7 @@ void Client::Handle_OP_GroupCancelInvite(const EQApplicationPacket *app) GroupCancel_Struct* gf = (GroupCancel_Struct*) app->pBuffer; Mob* inviter = entity_list.GetClientByName(gf->name1); - if(inviter != NULL) + if(inviter != nullptr) { if(inviter->IsClient()) inviter->CastToClient()->QueuePacket(app); @@ -6398,7 +6398,7 @@ void Client::Handle_OP_GroupFollow2(const EQApplicationPacket *app) GroupGeneric_Struct* gf = (GroupGeneric_Struct*) app->pBuffer; Mob* inviter = entity_list.GetClientByName(gf->name1); - if(inviter != NULL && inviter->IsClient()) { + if(inviter != nullptr && inviter->IsClient()) { isgrouped = true; strn0cpy(gf->name1,inviter->GetName(), 64); strn0cpy(gf->name2,this->GetName(), 64); @@ -6546,7 +6546,7 @@ void Client::Handle_OP_GroupFollow2(const EQApplicationPacket *app) worldserver.SendPacket(pack); safe_delete(pack); } - else if(inviter == NULL) + else if(inviter == nullptr) { ServerPacket* pack = new ServerPacket(ServerOP_GroupFollow, sizeof(ServerGroupFollow_Struct)); ServerGroupFollow_Struct *sgfs = (ServerGroupFollow_Struct *)pack->pBuffer; @@ -6572,7 +6572,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) Raid *raid = entity_list.GetRaidByClient(this); if(raid){ - Mob* memberToDisband = NULL; + Mob* memberToDisband = nullptr; if(!raid->IsGroupLeader(GetName())) memberToDisband = this; @@ -6639,10 +6639,10 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) #endif if((group->IsLeader(this) && (GetTarget() == 0 || GetTarget() == this)) || (group->GroupCount()<3)) { group->DisbandGroup(); - if(GetMerc() != NULL) + if(GetMerc() != nullptr) GetMerc()->Suspend(); } else { - Mob* memberToDisband = NULL; + Mob* memberToDisband = nullptr; memberToDisband = GetTarget(); if(!memberToDisband) @@ -6686,13 +6686,13 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) // ...but other members can only remove themselves group->DelMember(this,false); - if(!IsGrouped() && GetMerc() != NULL) { + if(!IsGrouped() && GetMerc() != nullptr) { if(!IsGrouped()) { Group *g = new Group(this); if(!g) { delete g; - g = NULL; + g = nullptr; return; } @@ -6759,7 +6759,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) if(strstr(gmez->text,"^")==0) entity_list.Message(0, 15, gmez->text); else{ - for(newmessage = strtok((char*)gmez->text,"^");newmessage!=NULL;newmessage=strtok(NULL, "^")) + for(newmessage = strtok((char*)gmez->text,"^");newmessage!=nullptr;newmessage=strtok(nullptr, "^")) entity_list.Message(0, 15, newmessage); } return; @@ -6799,11 +6799,11 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) { EQApplicationPacket* outapp = app->Copy(); InspectResponse_Struct* insr = (InspectResponse_Struct*) outapp->pBuffer; Mob* tmp = entity_list.GetMob(insr->TargetID); - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; for (int16 L = 0; L <= 20; L++) { const ItemInst* inst = GetInv().GetItem(L); - item = inst ? inst->GetItem() : NULL; + item = inst ? inst->GetItem() : nullptr; if(item) { strcpy(insr->itemnames[L], item->Name); @@ -6813,7 +6813,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) { } const ItemInst* inst = GetInv().GetItem(21); - item = inst ? inst->GetItem() : NULL; + item = inst ? inst->GetItem() : nullptr; if(item) { strcpy(insr->itemnames[22], item->Name); @@ -7088,7 +7088,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) if((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) { mypet->Say_StringID(MT_PetResponse, PET_CALMING); mypet->WipeHateList(); - mypet->SetTarget(NULL); + mypet->SetTarget(nullptr); } break; } @@ -7108,7 +7108,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) mypet->BuffFadeByEffect(SE_Charm); break; } else { - SetPet(NULL); + SetPet(nullptr); } mypet->Say_StringID(MT_PetResponse, PET_GETLOST_STRING); @@ -7659,7 +7659,7 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app) Message_StringID(4,MEND_FAIL); } - CheckIncreaseSkill(MEND, NULL, 10); + CheckIncreaseSkill(MEND, nullptr, 10); return; } @@ -8096,7 +8096,7 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app) if( GetSkill(TRACKING)==0 ) SetSkill(TRACKING,1); else - CheckIncreaseSkill(TRACKING, NULL, 15); + CheckIncreaseSkill(TRACKING, nullptr, 15); if(!entity_list.MakeTrackPacket(this)) LogFile->write(EQEMuLog::Error, "Unable to generate OP_Track packet requested by client."); @@ -8155,7 +8155,7 @@ void Client::Handle_OP_Split(const EQApplicationPacket *app) return; } Group *cgroup = GetGroup(); - if(cgroup == NULL) { + if(cgroup == nullptr) { //invalid group, not sure if we should say more... Message(13, "You can not split money if your not in a group."); return; @@ -8199,7 +8199,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) Trap* trap = entity_list.FindNearbyTrap(this,800); - CheckIncreaseSkill(SENSE_TRAPS, NULL); + CheckIncreaseSkill(SENSE_TRAPS, nullptr); if (trap && trap->skill > 0) { int uskill = GetSkill(SENSE_TRAPS); @@ -8285,7 +8285,7 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app) Message(MT_Skills,"You failed to disarm a trap."); } } - CheckIncreaseSkill(DISARM_TRAPS, NULL); + CheckIncreaseSkill(DISARM_TRAPS, nullptr); return; } Message(MT_Skills,"You did not find any traps close enough to disarm."); @@ -8470,7 +8470,7 @@ void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) if(!boat->IsNPC() || (boat->GetRace() != CONTROLLED_BOAT && boat->GetRace() != 502)) { - char *hacked_string = NULL; + char *hacked_string = nullptr; MakeAnyLenString(&hacked_string, "OP_Control Boat was sent against %s which is of race %u", boat->GetName(), boat->GetRace()); database.SetMQDetectionFlag(this->AccountName(), this->GetName(), hacked_string, zone->GetShortName()); safe_delete_array(hacked_string); @@ -8508,7 +8508,7 @@ void Client::Handle_OP_SetRunMode(const EQApplicationPacket *app) void Client::Handle_OP_SafeFallSuccess(const EQApplicationPacket *app) // bit of a misnomer, sent whenever safe fall is used (success of fail) { if(HasSkill(SAFE_FALL)) //this should only get called if the client has safe fall, but just in case... - CheckIncreaseSkill(SAFE_FALL, NULL); //check for skill up + CheckIncreaseSkill(SAFE_FALL, nullptr); //check for skill up } void Client::Handle_OP_Heartbeat(const EQApplicationPacket *app) @@ -8535,7 +8535,7 @@ void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app) Message(13, "Searched for NPC ID: %d\n", t->npc_id); Mob* target = entity_list.GetMob(t->npc_id); - if(target == NULL) { + if(target == nullptr) { //empty length packet == not found. EQApplicationPacket outapp(OP_FindPersonReply, 0); QueuePacket(&outapp); @@ -8567,7 +8567,7 @@ void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app) VERTEX Start(GetX(), GetY(), GetZ() + (GetSize() < 6.0 ? 6 : GetSize()) * HEAD_POSITION); VERTEX End(target->GetX(), target->GetY(), target->GetZ() + (target->GetSize() < 6.0 ? 6 : target->GetSize()) * HEAD_POSITION); - if(!zone->zonemap->LineIntersectsZone(Start, End, 1.0f, NULL, NULL) && zone->pathing->NoHazards(Start, End)) + if(!zone->zonemap->LineIntersectsZone(Start, End, 1.0f, nullptr, nullptr) && zone->pathing->NoHazards(Start, End)) { points.resize(2); points[0].x = Start.x; @@ -8797,7 +8797,7 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) { drakkin_details = m_pp.drakkin_details; //if we zone in with invalid Z, fix it. - if (zone->zonemap != NULL) { + if (zone->zonemap != nullptr) { //for whatever reason, LineIntersectsNode is giving better results than FindBestZ @@ -8811,20 +8811,20 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) { VERTEX hit; VERTEX below_me(me); below_me.z -= 500; - if(!zone->zonemap->LineIntersectsNode(pnode, me, below_me, &hit, NULL) || hit.z < -5000) { + if(!zone->zonemap->LineIntersectsNode(pnode, me, below_me, &hit, nullptr) || hit.z < -5000) { #if EQDEBUG >= 5 LogFile->write(EQEMuLog::Debug, "Player %s started below the zone trying to fix! (%.3f, %.3f, %.3f)", GetName(), me.x, me.y, me.z); #endif //theres nothing below us... try to find something to stand on me.z += 200; //arbitrary # - if(zone->zonemap->LineIntersectsNode(pnode, me, below_me, &hit, NULL)) { + if(zone->zonemap->LineIntersectsNode(pnode, me, below_me, &hit, nullptr)) { //+10 so they dont stick in the ground SendTo(me.x, me.y, hit.z + 10); m_pp.z = hit.z + 10; } else { //one more, desperate try me.z += 2000; - if(zone->zonemap->LineIntersectsNode(pnode, me, below_me, &hit, NULL)) { + if(zone->zonemap->LineIntersectsNode(pnode, me, below_me, &hit, nullptr)) { //+10 so they dont stick in the ground SendTo(me.x, me.y, hit.z + 10); m_pp.z = hit.z + 10; @@ -9018,7 +9018,7 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) { KeyRingLoad(); uint32 groupid = database.GetGroupID(GetName()); - Group* group = NULL; + Group* group = nullptr; if(groupid > 0){ group = entity_list.GetGroupByID(groupid); if(!group) { //nobody from our is here... start a new group @@ -9028,7 +9028,7 @@ bool Client::FinishConnState2(DBAsyncWork* dbaw) { else //error loading group members... { delete group; - group = NULL; + group = nullptr; } } //else, somebody from our group is already here... @@ -9332,7 +9332,7 @@ void Client::CompleteConnect() if (GetHideMe()) Message(13, "[GM] You are currently hidden to all clients"); uint32 raidid = database.GetRaidID(GetName()); - Raid *raid = NULL; + Raid *raid = nullptr; if(raidid > 0){ raid = entity_list.GetRaidByID(raidid); if(!raid){ @@ -9341,7 +9341,7 @@ void Client::CompleteConnect() entity_list.AddRaid(raid, raidid); } else - raid = NULL; + raid = nullptr; } if(raid){ SetRaidGrouped(true); @@ -9523,7 +9523,7 @@ void Client::CompleteConnect() for(x=0;x<8;x++) SendWearChange(x); Mob *pet = GetPet(); - if(pet != NULL) { + if(pet != nullptr) { for(x=0;x<8;x++) pet->SendWearChange(x); } @@ -9611,7 +9611,7 @@ void Client::CompleteConnect() if(IsInAGuild()) { - guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), zone->GetZoneID(), time(NULL)); + guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), zone->GetZoneID(), time(nullptr)); guild_mgr.RequestOnlineGuildMembers(this->CharacterID(), this->GuildID()); } @@ -9748,7 +9748,7 @@ void Client::Handle_OP_RequestTitles(const EQApplicationPacket *app) EQApplicationPacket *outapp = title_manager.MakeTitlesPacket(this); - if(outapp != NULL) + if(outapp != nullptr) FastQueuePacket(&outapp); } @@ -9766,7 +9766,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) if(!banker || distance > USE_NPC_RANGE2) { - char *hacked_string = NULL; + char *hacked_string = nullptr; MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(money) but %s is non-existant or too far away (%u units).", banker ? banker->GetName() : "UNKNOWN NPC", distance); database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName()); @@ -9774,7 +9774,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) return; } - EQApplicationPacket *outapp=new EQApplicationPacket(OP_BankerChange,NULL,sizeof(BankerChange_Struct)); + EQApplicationPacket *outapp=new EQApplicationPacket(OP_BankerChange,nullptr,sizeof(BankerChange_Struct)); BankerChange_Struct *bc=(BankerChange_Struct *)outapp->pBuffer; if(m_pp.platinum < 0) @@ -9932,11 +9932,11 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) } if(g){//add us all uint32 freeGroup = r->GetFreeGroup(); - Client *addClient = NULL; + Client *addClient = nullptr; for(int x = 0; x < 6; x++) { if(g->members[x]){ - Client *c = NULL; + Client *c = nullptr; if(g->members[x]->IsClient()) c = g->members[x]->CastToClient(); else @@ -9985,7 +9985,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) uint32 groupFree = r->GetFreeGroup(); //get a free group if(ig){ //if we already have a group then cycle through adding us... - Client *addClientig = NULL; + Client *addClientig = nullptr; for(int x = 0; x < 6; x++) { if(ig->members[x]){ @@ -9996,7 +9996,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) } } if(ig->IsLeader(ig->members[x])){ - Client *c = NULL; + Client *c = nullptr; if(ig->members[x]->IsClient()) c = ig->members[x]->CastToClient(); else @@ -10010,7 +10010,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) } } else{ - Client *c = NULL; + Client *c = nullptr; if(ig->members[x]->IsClient()) c = ig->members[x]->CastToClient(); else @@ -10034,7 +10034,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) r->AddMember(i,0xFFFFFFFF, true, false, true); } - Client *addClient = NULL; + Client *addClient = nullptr; //now add the existing group for(int x = 0; x < 6; x++) { @@ -10048,7 +10048,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) } if(g->IsLeader(g->members[x])) { - Client *c = NULL; + Client *c = nullptr; if(g->members[x]->IsClient()) c = g->members[x]->CastToClient(); else @@ -10063,7 +10063,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) } else { - Client *c = NULL; + Client *c = nullptr; if(g->members[x]->IsClient()) c = g->members[x]->CastToClient(); else @@ -10087,7 +10087,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) r = new Raid(i); entity_list.AddRaid(r); r->SetRaidDetails(); - Client *addClientig = NULL; + Client *addClientig = nullptr; for(int x = 0; x < 6; x++) { if(ig->members[x]) @@ -10100,7 +10100,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) } if(ig->IsLeader(ig->members[x])) { - Client *c = NULL; + Client *c = nullptr; if(ig->members[x]->IsClient()) c = ig->members[x]->CastToClient(); else @@ -10116,7 +10116,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) } else { - Client *c = NULL; + Client *c = nullptr; if(ig->members[x]->IsClient()) c = ig->members[x]->CastToClient(); else @@ -10441,7 +10441,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) { if(!PendingTranslocate) return; - if((RuleI(Spells, TranslocateTimeLimit) > 0) && (time(NULL) > (TranslocateTime + RuleI(Spells, TranslocateTimeLimit)))) { + if((RuleI(Spells, TranslocateTimeLimit) > 0) && (time(nullptr) > (TranslocateTime + RuleI(Spells, TranslocateTimeLimit)))) { Message(13, "You did not accept the Translocate within the required time limit."); PendingTranslocate = false; return; @@ -10452,7 +10452,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) { int SpellID = PendingTranslocateData.SpellID; if(parse->SpellHasQuestSub(SpellID, "EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE")) { - parse->EventSpell(EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE, NULL, this, SpellID, 0); + parse->EventSpell(EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE, nullptr, this, SpellID, 0); } else { @@ -11071,7 +11071,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) { float SuccessChance = (GetSkill(APPLY_POISON) + GetLevel()) / 400.0f; double ChanceRoll = MakeRandomFloat(0, 1); - CheckIncreaseSkill(APPLY_POISON, NULL, 10); + CheckIncreaseSkill(APPLY_POISON, nullptr, 10); if(ChanceRoll < SuccessChance) { ApplyPoisonSuccessResult = 1; @@ -11086,7 +11086,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) { } } - EQApplicationPacket *outapp = new EQApplicationPacket(OP_ApplyPoison, NULL, sizeof(ApplyPoison_Struct)); + EQApplicationPacket *outapp = new EQApplicationPacket(OP_ApplyPoison, nullptr, sizeof(ApplyPoison_Struct)); ApplyPoison_Struct* ApplyPoisonResult = (ApplyPoison_Struct*)outapp->pBuffer; ApplyPoisonResult->success = ApplyPoisonSuccessResult; ApplyPoisonResult->inventorySlot = ApplyPoisonData->inventorySlot; @@ -11114,7 +11114,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) { } AugmentInfo_Struct* AugInfo = (AugmentInfo_Struct*) app->pBuffer; - char *outstring = NULL; + char *outstring = nullptr; const Item_Struct * item = database.GetItem(AugInfo->itemid); @@ -11450,12 +11450,12 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) char errbuf[MYSQL_ERRMSG_SIZE]; char *query = 0; - MYSQL_RES *result = NULL; + MYSQL_RES *result = nullptr; MYSQL_ROW row = 0; float x(0),y(0),z(0); uint32 zoneid = 0; - uint32 StartCity = (uint32)strtol((const char*)app->pBuffer, NULL, 10); + uint32 StartCity = (uint32)strtol((const char*)app->pBuffer, nullptr, 10); bool ValidCity = false; database.RunQuery ( @@ -12361,7 +12361,7 @@ void Client::Handle_OP_BuffRemoveRequest(const EQApplicationPacket *app) BuffRemoveRequest_Struct *brrs = (BuffRemoveRequest_Struct*)app->pBuffer; - Mob *m = NULL; + Mob *m = nullptr; if(brrs->EntityID == GetID()) m = this; @@ -12575,7 +12575,7 @@ void Client::Handle_OP_AltCurrencyMerchantRequest(const EQApplicationPacket *app ss << alt_cur_id << "|1|" << alt_cur_id; uint32 count = 0; uint32 merchant_id = tar->MerchantType; - const Item_Struct *item = NULL; + const Item_Struct *item = nullptr; std::list merlist = zone->merchanttable[merchant_id]; std::list::const_iterator itr; @@ -12639,7 +12639,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app) return; } - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; uint32 cost = 0; uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id); uint32 merchant_id = tar->MerchantType; @@ -12701,7 +12701,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app) { return; } - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; uint32 cost = 0; uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id); uint32 merchant_id = tar->MerchantType; @@ -12818,7 +12818,7 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app) { return; } - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; uint32 cost = 0; uint32 current_currency = GetAlternateCurrencyValue(alt_cur_id); uint32 merchant_id = tar->MerchantType; @@ -13112,7 +13112,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) if(GetTarget()) UpdateXTargetType(TargetsTarget, GetTarget()->GetTarget()); else - UpdateXTargetType(TargetsTarget, NULL); + UpdateXTargetType(TargetsTarget, nullptr); break; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 6a28722a9..597684aa1 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -233,7 +233,7 @@ bool Client::Process() { song_target = entity_list.GetMob(bardsong_target_id); } - if (song_target == NULL) { + if (song_target == nullptr) { InterruptSpell(SONG_ENDS_ABRUPTLY, 0x121, bardsong); } else { if(!ApplyNextBardPulse(bardsong, song_target, bardsong_slot)) @@ -348,7 +348,7 @@ bool Client::Process() { } Mob *auto_attack_target = GetTarget(); - if (auto_attack && auto_attack_target != NULL && may_use_attacks && attack_timer.Check()) + if (auto_attack && auto_attack_target != nullptr && may_use_attacks && attack_timer.Check()) { //check if change //only check on primary attack.. sorry offhand you gotta wait! @@ -486,7 +486,7 @@ bool Client::Process() { } } - if(auto_attack && may_use_attacks && auto_attack_target != NULL + if(auto_attack && may_use_attacks && auto_attack_target != nullptr && CanThisClassDualWield() && attack_dw_timer.Check()) { // Range check @@ -839,7 +839,7 @@ void Client::BulkSendInventoryItems() { int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); mlog(INVENTORY__ERROR, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, false); - database.SaveInventory(character_id, NULL, slot_id); + database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); } } @@ -976,7 +976,7 @@ void Client::BulkSendInventoryItems() #endif*/ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { - const Item_Struct* handyitem = NULL; + const Item_Struct* handyitem = nullptr; uint32 numItemSlots=80; //The max number of items passed in the transaction. const Item_Struct *item; std::list merlist = zone->merchanttable[merchant_id]; @@ -1075,7 +1075,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { } //this resets the slot zone->tmpmerchanttable[npcid] = tmp_merlist; - if(merch != NULL && handyitem){ + if(merch != nullptr && handyitem){ char handy_id[8]={0}; int greeting=MakeRandomInt(0, 4); int greet_id=0; @@ -1368,7 +1368,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app) NPC *banker = entity_list.GetClosestBanker(this, distance); if(!banker || distance > USE_NPC_RANGE2) { - char *hacked_string = NULL; + char *hacked_string = nullptr; MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(coin move) but %s is non-existant or too far away (%u units).", banker ? banker->GetName() : "UNKNOWN NPC", distance); database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName()); @@ -1400,7 +1400,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app) NPC *banker = entity_list.GetClosestBanker(this, distance); if(!banker || distance > USE_NPC_RANGE2) { - char *hacked_string = NULL; + char *hacked_string = nullptr; MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(shared coin move) but %s is non-existant or too far away (%u units).", banker ? banker->GetName() : "UNKNOWN NPC", distance); database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName()); @@ -1456,7 +1456,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app) NPC *banker = entity_list.GetClosestBanker(this, distance); if(!banker || distance > USE_NPC_RANGE2) { - char *hacked_string = NULL; + char *hacked_string = nullptr; MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(coin move) but %s is non-existant or too far away (%u units).", banker ? banker->GetName() : "UNKNOWN NPC", distance); database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName()); @@ -1500,7 +1500,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app) NPC *banker = entity_list.GetClosestBanker(this, distance); if(!banker || distance > USE_NPC_RANGE2) { - char *hacked_string = NULL; + char *hacked_string = nullptr; MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(shared coin move) but %s is non-existant or too far away (%u units).", banker ? banker->GetName() : "UNKNOWN NPC", distance); database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName()); diff --git a/zone/command.cpp b/zone/command.cpp index 8451d851f..276caf8da 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -25,7 +25,7 @@ 3. In the command_init function you must add a call to command_add for your function. If you want an alias for your command, add a second call to command_add with the descriptin and access args - set to NULL and 0 respectively since they aren't used when adding + set to nullptr and 0 respectively since they aren't used when adding an alias. The function pointers being equal is makes it an alias. The access level you set with command_add is only a default if the command isn't listed in the addon.ini file. @@ -142,7 +142,7 @@ Access Levels: * When adding a command, if it's the first time that function pointer is * used it is a new command. If that function pointer is used for another * command, the command is added as an alias; description and access level - * are not used and can be NULL. + * are not used and can be nullptr. * */ int command_init(void) { @@ -165,7 +165,7 @@ int command_init(void) { command_add("numauths","- TODO: describe this command",200,command_numauths) || command_add("setanim","[animnum] - Set target's appearance to animnum",200,command_setanim) || command_add("connectworldserver","- Make zone attempt to connect to worldserver",200,command_connectworldserver) || - command_add("connectworld",NULL,0,command_connectworldserver) || + command_add("connectworld",nullptr,0,command_connectworldserver) || command_add("serverinfo","- Get OS info about server host",200,command_serverinfo) || command_add("crashtest","- Crash the zoneserver",200,command_crashtest) || command_add("getvariable","[varname] - Get the value of a variable from the database",200,command_getvariable) || @@ -181,7 +181,7 @@ int command_init(void) { command_add("zone","[zonename] [x] [y] [z] - Go to specified zone (coords optional)",50,command_zone) || command_add("zoneinstance","[instanceid] [x] [y] [z] - Go to specified instance zone (coords optional)",50,command_zone_instance) || command_add("peqzone","[zonename] - Go to specified zone, if you have > 75% health",0,command_peqzone) || - command_add("tgczone",NULL,0,command_peqzone) || + command_add("tgczone",nullptr,0,command_peqzone) || command_add("showbuffs","- List buffs active on your target or you if no target",50,command_showbuffs) || command_add("movechar","[charname] [zonename] - Move charname to zonename",50,command_movechar) || command_add("viewpetition","[petition number] - View a petition",20,command_viewpetition) || @@ -193,9 +193,9 @@ int command_init(void) { command_add("timezone","[HH] [MM] - Set timezone. Minutes are optional",90,command_timezone) || command_add("synctod","- Send a time of day update to every client in zone",90,command_synctod) || command_add("invulnerable","[on/off] - Turn player target's or your invulnerable flag on or off",80,command_invul) || - command_add("invul",NULL,0,command_invul) || + command_add("invul",nullptr,0,command_invul) || command_add("hideme","[on/off] - Hide yourself from spawn lists.",80,command_hideme) || - command_add("gmhideme",NULL,0,command_hideme) || + command_add("gmhideme",nullptr,0,command_hideme) || command_add("emote","['name'/'world'/'zone'] [type] [message] - Send an emote message",80,command_emote) || command_add("fov","- Check wether you're behind or in your target's field of view",80,command_fov) || command_add("manastat","- Report your or your target's cur/max mana",80,command_manastat) || @@ -209,7 +209,7 @@ int command_init(void) { command_add("permagender","[gendernum] - Change your or your player target's gender (zone to take effect)",80,command_permagender) || command_add("weather","[0/1/2/3] (Off/Rain/Snow/Manual) - Change the weather",80,command_weather) || command_add("zheader","[zonename] - Load zheader for zonename from the database",80,command_zheader) || - command_add("zhdr",NULL,0,command_zheader) || + command_add("zhdr",nullptr,0,command_zheader) || command_add("zsky","[skytype] - Change zone sky type",80,command_zsky) || command_add("zcolor","[red] [green] [blue] - Change sky color",80,command_zcolor) || command_add("zuwcoords","[z coord] - Set underworld coord",80,command_zuwcoords) || @@ -238,14 +238,14 @@ int command_init(void) { command_add("flymode","[0/1/2] - Set your or your player target's flymode to off/on/levitate",50,command_flymode) || command_add("showskills","- Show the values of your or your player target's skills",50,command_showskills) || command_add("findspell","[searchstring] - Search for a spell",50,command_findspell) || - command_add("spfind",NULL,0,command_findspell) || + command_add("spfind",nullptr,0,command_findspell) || command_add("castspell","[spellid] - Cast a spell",50,command_castspell) || - command_add("cast",NULL,0,command_castspell) || + command_add("cast",nullptr,0,command_castspell) || command_add("setlanguage","[language ID] [value] - Set your target's language skillnum to value",50,command_setlanguage) || command_add("setskill","[skillnum] [value] - Set your target's skill skillnum to value",50,command_setskill) || command_add("setskillall","[value] - Set all of your target's skills to value",50,command_setskillall) || - command_add("setallskill",NULL,0,command_setskillall) || - command_add("setallskills",NULL,0,command_setskillall) || + command_add("setallskill",nullptr,0,command_setskillall) || + command_add("setallskills",nullptr,0,command_setskillall) || command_add("race","[racenum] - Change your or your target's race. Use racenum 0 to return to normal",50,command_race) || command_add("gender","[0/1/2] - Change your or your target's gender to male/female/neuter",50,command_gender) || command_add("makepet","[level] [class] [race] [texture] - Make a pet",50,command_makepet) || @@ -253,7 +253,7 @@ int command_init(void) { command_add("spawn","[name] [race] [level] [material] [hp] [gender] [class] [priweapon] [secweapon] [merchantid] - Spawn an NPC",10,command_spawn) || command_add("texture","[texture] [helmtexture] - Change your or your target's appearance, use 255 to show equipment",10,command_texture) || command_add("npctypespawn","[npctypeid] [factionid] - Spawn an NPC from the db",10,command_npctypespawn) || - command_add("dbspawn",NULL,0,command_npctypespawn) || + command_add("dbspawn",nullptr,0,command_npctypespawn) || command_add("heal","- Completely heal your target",10,command_heal) || command_add("appearance","[type] [value] - Send an appearance packet for you or your target",150,command_appearance) || command_add("charbackup","[list/restore] - Query or restore character backups",150,command_charbackup) || @@ -261,17 +261,17 @@ int command_init(void) { command_add("peekinv","[worn/cursor/inv/bank/trade/trib/all] - Print out contents of your player target's inventory",100,command_peekinv) || command_add("findnpctype","[search criteria] - Search database NPC types",100,command_findnpctype) || command_add("findzone","[search criteria] - Search database zones",100,command_findzone) || - command_add("fz",NULL,100,command_findzone) || + command_add("fz",nullptr,100,command_findzone) || command_add("viewnpctype","[npctype id] - Show info about an npctype",100,command_viewnpctype) || command_add("reloadstatic","- Reload Static Zone Data",150,command_reloadstatic) || command_add("reloadquest"," - Clear quest cache (any argument causes it to also stop all timers)",150,command_reloadqst) || - command_add("reloadqst",NULL,0,command_reloadqst) || - command_add("reloadpl",NULL,0,command_reloadqst) || - command_add("reloadworld",NULL,255,command_reloadworld) || - command_add("reloadlevelmods",NULL,255,command_reloadlevelmods) || - command_add("rq",NULL,0,command_reloadqst) || + command_add("reloadqst",nullptr,0,command_reloadqst) || + command_add("reloadpl",nullptr,0,command_reloadqst) || + command_add("reloadworld",nullptr,255,command_reloadworld) || + command_add("reloadlevelmods",nullptr,255,command_reloadlevelmods) || + command_add("rq",nullptr,0,command_reloadqst) || command_add("reloadzonepoints","- Reload zone points from database",150,command_reloadzps) || - command_add("reloadzps",NULL,0,command_reloadzps) || + command_add("reloadzps",nullptr,0,command_reloadzps) || command_add("zoneshutdown","[shortname] - Shut down a zone server",150,command_zoneshutdown) || command_add("zonebootup","[ZoneServerID] [shortname] - Make a zone server boot a specific zone",150,command_zonebootup) || command_add("kick","[charname] - Disconnect charname",150,command_kick) || @@ -304,17 +304,17 @@ int command_init(void) { command_add("pvp","[on/off] - Set your or your player target's PVP status",100,command_pvp) || command_add("setxp","[value] - Set your or your player target's experience",100,command_setxp) || command_add("setpvppoints","[value] - Set your or your player target's PVP points",100,command_setpvppoints) || - command_add("setexp",NULL,0,command_setxp) || + command_add("setexp",nullptr,0,command_setxp) || command_add("setaaxp","[value] - Set your or your player target's AA experience",100,command_setaaxp) || - command_add("setaaexp",NULL,0,command_setaaxp) || + command_add("setaaexp",nullptr,0,command_setaaxp) || command_add("setaapts","[value] - Set your or your player target's available AA points",100,command_setaapts) || - command_add("setaapoints",NULL,0,command_setaapts) || + command_add("setaapoints",nullptr,0,command_setaapts) || command_add("setcrystals","[value] - Set your or your player target's available radiant or ebon crystals",100,command_setcrystals) || command_add("name","[newname] - Rename your player target",150,command_name) || command_add("tempname","[newname] - Temporarily renames your target. Leave name blank to restore the original name.",100,command_tempname) || command_add("npcspecialattk","[flagchar] [perm] - Set NPC special attack flags. Flags are E(nrage) F(lurry) R(ampage) S(ummon).",80,command_npcspecialattk) || - command_add("npcspecialattack",NULL,0,command_npcspecialattk) || - command_add("npcspecialatk",NULL,0,command_npcspecialattk) || + command_add("npcspecialattack",nullptr,0,command_npcspecialattk) || + command_add("npcspecialatk",nullptr,0,command_npcspecialattk) || command_add("kill","- Kill your target",100,command_kill) || command_add("haste","[percentage] - Set your haste percentage",100,command_haste) || command_add("damage","[amount] - Damage your target",100,command_damage) || @@ -335,14 +335,14 @@ int command_init(void) { command_add("uptime","[zone server id] - Get uptime of worldserver, or zone server if argument provided",10,command_uptime) || command_add("flag","[status] [acctname] - Refresh your admin status, or set an account's admin status if arguments provided",0,command_flag) || command_add("guild","- Guild manipulation commands. Use argument help for more info.",10,command_guild) || - command_add("guilds",NULL,0,command_guild) || + command_add("guilds",nullptr,0,command_guild) || command_add("zonestatus","- Show connected zoneservers, synonymous with /servers",150,command_zonestatus) || command_add("manaburn","- Use AA Wizard class skill manaburn on target",10,command_manaburn) || command_add("viewmessage","[id] - View messages in your tell queue",100,command_viewmessage) || - command_add("viewmessages",NULL,0,command_viewmessage) || + command_add("viewmessages",nullptr,0,command_viewmessage) || command_add("doanim","[animnum] [type] - Send an EmoteAnim for you or your target",50,command_doanim) || command_add("randomfeatures","- Temporarily randomizes the Facial Features of your target",80,command_randomfeatures) || - command_add("rf",NULL,80,command_randomfeatures) || + command_add("rf",nullptr,80,command_randomfeatures) || command_add("face","- Change the face of your target",80,command_face) || command_add("helm","- Change the helm of your target",80,command_helm) || command_add("hair","- Change the hair style of your target",80,command_hair) || @@ -359,15 +359,15 @@ int command_init(void) { command_add("interrupt","[message id] [color] - Interrupt your casting. Arguments are optional.",50,command_interrupt) || command_add("d1","[type] [spell] [damage] - Send an OP_Action packet with the specified values",200,command_d1) || command_add("summonitem","[itemid] [charges] - Summon an item onto your cursor. Charges are optional.",200,command_summonitem) || - command_add("si",NULL,200,command_summonitem) || + command_add("si",nullptr,200,command_summonitem) || command_add("giveitem","[itemid] [charges] - Summon an item onto your target's cursor. Charges are optional.",200,command_giveitem) || - command_add("gi",NULL,200,command_giveitem) || + command_add("gi",nullptr,200,command_giveitem) || command_add("givemoney","[pp] [gp] [sp] [cp] - Gives specified amount of money to the target player.",200,command_givemoney) || command_add("itemsearch","[search criteria] - Search for an item",10,command_itemsearch) || - command_add("search",NULL,10,command_itemsearch) || + command_add("search",nullptr,10,command_itemsearch) || command_add("stun","[duration] - Stuns you or your target for duration",100,command_stun) || - command_add("finditem",NULL,10,command_itemsearch) || - command_add("fi",NULL,10,command_itemsearch) || + command_add("finditem",nullptr,10,command_itemsearch) || + command_add("fi",nullptr,10,command_itemsearch) || #ifdef PACKET_PROFILER command_add("packetprofile","- Dump packet profile for target or self.",250,command_packetprofile) || #endif @@ -385,7 +385,7 @@ int command_init(void) { command_add("oocmute","[1/0] - Mutes OOC chat",200,command_oocmute) || command_add("revoke","[charname] [1/0] - Makes charname unable to talk on OOC",200,command_revoke) || command_add("checklos","- Check for line of sight to your target",50,command_checklos) || - command_add("los",NULL,0,command_checklos) || + command_add("los",nullptr,0,command_checklos) || command_add("setadventurepoints","- Set your or your player target's available adventure points",150,command_set_adventure_points) || command_add("npcsay","[message] - Make your NPC target say a message.",150,command_npcsay) || command_add("npcshout","[message] - Make your NPC target shout a message.",150,command_npcshout) || @@ -523,7 +523,7 @@ void command_deinit(void) */ int command_add(const char *command_string, const char *desc, int access, CmdFuncPtr function) { - if(function == NULL) + if(function == nullptr) return(-1); string cstr(command_string); @@ -541,7 +541,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun if(cur->second->function == function) { int r; for(r = 1; r < CMDALIASES; r++) { - if(cur->second->command[r] == NULL) { + if(cur->second->command[r] == nullptr) { cur->second->command[r] = command_string; break; } @@ -595,7 +595,7 @@ int command_add_perl(const char *command_string, const char *desc, int access) { CommandRecord *c = new CommandRecord; c->desc = desc; c->access = access; - c->function = NULL; + c->function = nullptr; commandlist[cstr] = c; @@ -613,7 +613,7 @@ void command_clear_perl() { for(; cur != end;) { del = cur; cur++; - if(del->second->function == NULL) { + if(del->second->function == nullptr) { safe_delete(del->second); commandlist.erase(del); } @@ -662,7 +662,7 @@ int command_realdispatch(Client *c, const char *message) } #endif - if(cur->function == NULL) { + if(cur->function == nullptr) { #ifdef EMBPERL_COMMANDS //todo reimplement this stuff //dispatch perl command @@ -931,7 +931,7 @@ void command_help(Client *c, const Seperator *sep) if(c->Admin() < cur->second->access) continue; commands_shown++; - c->Message(0, " %c%s %s", COMMAND_CHAR, cur->first.c_str(), cur->second->desc == NULL?"":cur->second->desc); + c->Message(0, " %c%s %s", COMMAND_CHAR, cur->first.c_str(), cur->second->desc == nullptr?"":cur->second->desc); } c->Message(0, "%d command%s listed.", commands_shown, commands_shown!=1?"s":""); @@ -1018,7 +1018,7 @@ void command_wc(Client *c, const Seperator *sep) { c->Message(0, "Usage: #wc [wear slot] [material] [ [hero_forge_model] [elite_material] [unknown06] [unknown18] ]"); } - else if(c->GetTarget() == NULL) { + else if(c->GetTarget() == nullptr) { c->Message(13, "You must have a target to do a wear change."); } else @@ -1155,7 +1155,7 @@ void command_showpetspell(Client *c, const Seperator *sep) strcpy(sName, spells[i].teleport_zone); strupr(sName); char* pdest = strstr(sName, sCriteria); - if ((pdest != NULL) && (count <=20)) + if ((pdest != nullptr) && (count <=20)) { c->Message(0, " %i: %s, %s", i, spells[i].teleport_zone, spells[i].name); count++; @@ -1819,7 +1819,7 @@ void command_emote(Client *c, const Seperator *sep) if(strstr(sep->arg[3],"^")==0) entity_list.Message(0, atoi(sep->arg[2]), sep->argplus[3]); else{ - for(newmessage = strtok((char*)sep->arg[3],"^");newmessage!=NULL;newmessage=strtok(NULL, "^")) + for(newmessage = strtok((char*)sep->arg[3],"^");newmessage!=nullptr;newmessage=strtok(nullptr, "^")) entity_list.Message(0, atoi(sep->arg[2]), newmessage); } } @@ -2143,7 +2143,7 @@ void command_itemtest(Client *c, const Seperator *sep) { char chBuffer[8192] = {0}; //Using this to determine new item layout - FILE* f = NULL; + FILE* f = nullptr; if (!(f = fopen("c:\\EQEMUcvs\\ItemDump.txt", "rb"))) { c->Message(13, "Error: Could not open c:\\EQEMUcvs\\ItemDump.txt"); return; @@ -2569,7 +2569,7 @@ void command_findspell(Client *c, const Seperator *sep) strupr(sName); char* pdest = strstr(sName, sCriteria); - if ((pdest != NULL) && (count <=20)) { + if ((pdest != nullptr) && (count <=20)) { c->Message(0, " %i: %s", i, spells[i].name); count++; } @@ -2678,7 +2678,7 @@ void command_setlanguage(Client *c, const Seperator *sep) void command_setskill(Client *c, const Seperator *sep) { - if (c->GetTarget() == NULL) { + if (c->GetTarget() == nullptr) { c->Message(0, "Error: #setskill: No target."); } else if (!c->GetTarget()->IsClient()) { @@ -2992,7 +2992,7 @@ void command_peekinv(Client *c, const Seperator *sep) bool bAll = (strcasecmp(sep->arg[1], "all") == 0); bool bFound = false; Client* client = c->GetTarget()->CastToClient(); - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; c->Message(0, "Displaying inventory for %s...", client->GetName()); if (bAll || (strcasecmp(sep->arg[1], "worn")==0)) { @@ -3000,7 +3000,7 @@ void command_peekinv(Client *c, const Seperator *sep) bFound = true; for (int16 i=0; i<=21; i++) { const ItemInst* inst = client->GetInv().GetItem(i); - item = (inst) ? inst->GetItem() : NULL; + item = (inst) ? inst->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), "WornSlot: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", i, @@ -3022,7 +3022,7 @@ void command_peekinv(Client *c, const Seperator *sep) bFound = true; for (int16 i=22; i<=29; i++) { const ItemInst* inst = client->GetInv().GetItem(i); - item = (inst) ? inst->GetItem() : NULL; + item = (inst) ? inst->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), "InvSlot: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", i, @@ -3041,7 +3041,7 @@ void command_peekinv(Client *c, const Seperator *sep) if (inst && inst->IsType(ItemClassContainer)) { for (uint8 j=0; j<10; j++) { const ItemInst* instbag = client->GetInv().GetItem(i, j); - item = (instbag) ? instbag->GetItem() : NULL; + item = (instbag) ? instbag->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), " InvBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", @@ -3064,7 +3064,7 @@ void command_peekinv(Client *c, const Seperator *sep) if(c->GetClientVersion() >= EQClientSoF) { const ItemInst* inst = client->GetInv().GetItem(9999); - item = (inst) ? inst->GetItem() : NULL; + item = (inst) ? inst->GetItem() : nullptr; c->Message((item==0), "InvSlot: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", 9999, ((item==0)?0:item->ID),0x12, ((item==0)?0:item->ID), ((item==0)?"null":item->Name), 0x12, @@ -3095,7 +3095,7 @@ void command_peekinv(Client *c, const Seperator *sep) else { for(it=client->GetInv().cursor_begin();it!=client->GetInv().cursor_end();it++,i++) { const ItemInst* inst = *it; - item = (inst) ? inst->GetItem() : NULL; + item = (inst) ? inst->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), "CursorSlot: %i, Depth: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", SLOT_CURSOR,i, @@ -3114,7 +3114,7 @@ void command_peekinv(Client *c, const Seperator *sep) if (inst && inst->IsType(ItemClassContainer) && i==0) { // 'CSD 1' - only display contents of slot 30[0] container..higher ones don't exist for (uint8 j=0; j<10; j++) { const ItemInst* instbag = client->GetInv().GetItem(SLOT_CURSOR, j); - item = (instbag) ? instbag->GetItem() : NULL; + item = (instbag) ? instbag->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), " CursorBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", @@ -3142,7 +3142,7 @@ void command_peekinv(Client *c, const Seperator *sep) bFound = true; for (int16 i=TRIBUTE_SLOT_START; i<(TRIBUTE_SLOT_START + MAX_PLAYER_TRIBUTES); i++) { const ItemInst* inst = client->GetInv().GetItem(i); - item = (inst) ? inst->GetItem() : NULL; + item = (inst) ? inst->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), "TributeSlot: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", i, @@ -3166,7 +3166,7 @@ void command_peekinv(Client *c, const Seperator *sep) int16 i = 0; for (i=2000; i<=2023; i++) { const ItemInst* inst = client->GetInv().GetItem(i); - item = (inst) ? inst->GetItem() : NULL; + item = (inst) ? inst->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), "BankSlot: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", i, @@ -3185,7 +3185,7 @@ void command_peekinv(Client *c, const Seperator *sep) if (inst && inst->IsType(ItemClassContainer)) { for (uint8 j=0; j<10; j++) { const ItemInst* instbag = client->GetInv().GetItem(i, j); - item = (instbag) ? instbag->GetItem() : NULL; + item = (instbag) ? instbag->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), " BankBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", @@ -3207,7 +3207,7 @@ void command_peekinv(Client *c, const Seperator *sep) } for (i=2500; i<=2501; i++) { const ItemInst* inst = client->GetInv().GetItem(i); - item = (inst) ? inst->GetItem() : NULL; + item = (inst) ? inst->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), "ShBankSlot: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", i, @@ -3226,7 +3226,7 @@ void command_peekinv(Client *c, const Seperator *sep) if (inst && inst->IsType(ItemClassContainer)) { for (uint8 j=0; j<10; j++) { const ItemInst* instbag = client->GetInv().GetItem(i, j); - item = (instbag) ? instbag->GetItem() : NULL; + item = (instbag) ? instbag->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), " ShBankBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", @@ -3252,7 +3252,7 @@ void command_peekinv(Client *c, const Seperator *sep) bFound = true; for (int16 i=3000; i<=3007; i++) { const ItemInst* inst = client->GetInv().GetItem(i); - item = (inst) ? inst->GetItem() : NULL; + item = (inst) ? inst->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), "TradeSlot: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", i, @@ -3271,7 +3271,7 @@ void command_peekinv(Client *c, const Seperator *sep) if (inst && inst->IsType(ItemClassContainer)) { for (uint8 j=0; j<10; j++) { const ItemInst* instbag = client->GetInv().GetItem(i, j); - item = (instbag) ? instbag->GetItem() : NULL; + item = (instbag) ? instbag->GetItem() : nullptr; if (c->GetClientVersion() >= EQClientSoF) { c->Message((item==0), " TradeBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", @@ -3697,7 +3697,7 @@ void command_equipitem(Client *c, const Seperator *sep) // also send out a wear change packet? } - else if (from_inst == NULL) + else if (from_inst == nullptr) c->Message(13, "Error: There is no item on your cursor"); else c->Message(13, "Error: Item on your cursor cannot be equipped"); @@ -3919,7 +3919,7 @@ void command_fixmob(Client *c, const Seperator *sep) uint32 DrakkinTattoo = target->GetDrakkinTattoo(); uint32 DrakkinDetails = target->GetDrakkinDetails(); - const char* ChangeType = NULL; // If it's still NULL after processing, they didn't send a valid command + const char* ChangeType = nullptr; // If it's still nullptr after processing, they didn't send a valid command uint32 ChangeSetting; char* command = sep->arg[1]; @@ -4087,7 +4087,7 @@ void command_fixmob(Client *c, const Seperator *sep) } - if (ChangeType == NULL) + if (ChangeType == nullptr) { c->Message(0,Usage); } @@ -6085,7 +6085,7 @@ void command_wpinfo(Client *c, const Seperator *sep) { Mob *t=c->GetTarget(); - if (t == NULL || !t->IsNPC()) { + if (t == nullptr || !t->IsNPC()) { c->Message(0,"You must target an NPC to use this."); return; } @@ -6106,7 +6106,7 @@ void command_wpadd(Client *c, const Seperator *sep) { Spawn2* s2info = t->CastToNPC()->respawn2; - if(s2info == NULL) // Can't figure out where this mob's spawn came from... maybe a dynamic mob created by #spawn + if(s2info == nullptr) // Can't figure out where this mob's spawn came from... maybe a dynamic mob created by #spawn { c->Message(0,"#wpadd FAILED -- Can't determine which spawn record in the database this mob came from!"); return; @@ -6197,7 +6197,7 @@ void command_giveitem(Client *c, const Seperator *sep) { if (!sep->IsNumber(1)) { c->Message(13, "Usage: #summonitem [item id] [charges], charges are optional"); - } else if(c->GetTarget() == NULL) { + } else if(c->GetTarget() == nullptr) { c->Message(13, "You must target a client to give the item to."); } else if(!c->GetTarget()->IsClient()) { c->Message(13, "You can only give items to players with this command."); @@ -6235,7 +6235,7 @@ void command_givemoney(Client *c, const Seperator *sep) if (!sep->IsNumber(1)) { //as long as the first one is a number, we'll just let atoi convert the rest to 0 or a number c->Message(13, "Usage: #Usage: #givemoney [pp] [gp] [sp] [cp]"); } - else if(c->GetTarget() == NULL) { + else if(c->GetTarget() == nullptr) { c->Message(13, "You must target a player to give money to."); } else if(!c->GetTarget()->IsClient()) { @@ -6288,7 +6288,7 @@ void command_itemsearch(Client *c, const Seperator *sep) strn0cpy(sName, item->Name, sizeof(sName)); strupr(sName); pdest = strstr(sName, sCriteria); - if (pdest != NULL) { + if (pdest != nullptr) { if (c->GetClientVersion() >= EQClientRoF) { c->Message(0, " %i: %c%06X0000000000000000000000000000000000000000000000000%s%c",(int) item->ID,0x12, item->ID, item->Name, 0x12); @@ -6526,7 +6526,7 @@ void command_ban(Client *c, const Seperator *sep) worldserver.SendPacket(pack); safe_delete(pack); - Client *client = NULL; + Client *client = nullptr; client = entity_list.GetClientByName(sep->arg[1]); if(client) { @@ -6559,7 +6559,7 @@ void command_ban(Client *c, const Seperator *sep) void command_suspend(Client *c, const Seperator *sep) { char errbuf[MYSQL_ERRMSG_SIZE]; - char *query = NULL; + char *query = nullptr; if((sep->arg[1][0] == 0) || (sep->arg[2][0] == 0)) c->Message(0, "Usage: #suspend (Specify 0 days to lift the suspension immediately)"); @@ -6671,7 +6671,7 @@ void command_revoke(Client *c, const Seperator *sep) if(query) { safe_delete_array(query); - query=NULL; + query=nullptr; } } } @@ -7320,7 +7320,7 @@ void command_opcode(Client *c, const Seperator *sep) { void command_logsql(Client *c, const Seperator *sep) { if(!strcasecmp( sep->arg[1], "off" )) { - c->ChangeSQLLog(NULL); + c->ChangeSQLLog(nullptr); } else if(sep->arg[1][0] != '\0') { c->ChangeSQLLog(sep->argplus[1]); } else { @@ -7468,7 +7468,7 @@ void command_fear(Client *c, const Seperator *sep) { } if(!strcasecmp(sep->arg[1], "view")) { - if(zone->pathing == NULL) { + if(zone->pathing == nullptr) { c->Message(13, "There is no fear grid file loaded for this zone."); return; } @@ -7479,13 +7479,13 @@ void command_fear(Client *c, const Seperator *sep) { PathNode_Struct *node = zone->pathing->GetNode(0); //assumes nodes are stored in a linear array for(r = 0; r < count; r++, node++) { sprintf(buf, "Fear_Point%d 3", r); - NPC* npc = NPC::SpawnNPC(buf, node->x, node->y, node->z, c->GetHeading(), NULL); - if(npc == NULL) + NPC* npc = NPC::SpawnNPC(buf, node->x, node->y, node->z, c->GetHeading(), nullptr); + if(npc == nullptr) c->Message(13, "Unable to spawn new NPC marker."); //do we need to do anything else? } } else if(!strcasecmp(sep->arg[1], "path")) { - if(zone->pathing == NULL) { + if(zone->pathing == nullptr) { c->Message(13, "There is no fear grid file loaded for this zone."); return; } @@ -7516,8 +7516,8 @@ void command_fear(Client *c, const Seperator *sep) { it.z = fs.z; pts.push_back(it); } else { - NPC* npc = NPC::SpawnNPC(buf, fs.x, fs.y, fs.z, c->GetHeading(), NULL); - if(npc == NULL) + NPC* npc = NPC::SpawnNPC(buf, fs.x, fs.y, fs.z, c->GetHeading(), nullptr); + if(npc == nullptr) c->Message(13, "Unable to spawn new NPC marker."); } @@ -7534,7 +7534,7 @@ void command_fear(Client *c, const Seperator *sep) { it.z = fs.z; pts.push_back(it); } else { - NPC::SpawnNPC(buf, fs.x, fs.y, fs.z, c->GetHeading(), NULL); + NPC::SpawnNPC(buf, fs.x, fs.y, fs.z, c->GetHeading(), nullptr); } } @@ -7543,7 +7543,7 @@ void command_fear(Client *c, const Seperator *sep) { } } else if(!strcasecmp(sep->arg[1], "close")) { - if(zone->pathing == NULL) { + if(zone->pathing == nullptr) { c->Message(13, "There is no fear grid file loaded for this zone."); return; } @@ -7554,8 +7554,8 @@ void command_fear(Client *c, const Seperator *sep) { return; } - NPC* npc = NPC::SpawnNPC("Close_Fear_Point 2", fs.x, fs.y, fs.z, c->GetHeading(), NULL); - if(npc == NULL) + NPC* npc = NPC::SpawnNPC("Close_Fear_Point 2", fs.x, fs.y, fs.z, c->GetHeading(), nullptr); + if(npc == nullptr) c->Message(13, "Unable to spawn new NPC marker."); } else if(!strcasecmp(sep->arg[1], "see")) { @@ -7564,7 +7564,7 @@ void command_fear(Client *c, const Seperator *sep) { Mob* target = c->GetTarget(); - if(target == NULL) { + if(target == nullptr) { //empty length packet == not found. EQApplicationPacket outapp(OP_FindPersonReply, 0); c->QueuePacket(&outapp); @@ -7676,7 +7676,7 @@ void command_path(Client *c, const Seperator *sep) if(zone->zonemap) { VERTEX loc(px, py, pz); - best_z = zone->zonemap->FindBestZ(MAP_ROOT_NODE, loc, NULL, NULL); + best_z = zone->zonemap->FindBestZ(MAP_ROOT_NODE, loc, nullptr, nullptr); } else { @@ -7703,7 +7703,7 @@ void command_path(Client *c, const Seperator *sep) if(zone->zonemap) { VERTEX loc(px, py, pz); - best_z = zone->zonemap->FindBestZ(MAP_ROOT_NODE, loc, NULL, NULL); + best_z = zone->zonemap->FindBestZ(MAP_ROOT_NODE, loc, nullptr, nullptr); } else { @@ -7932,7 +7932,7 @@ void Client::Undye() { for (int cur_slot = 0; cur_slot < 9 ; cur_slot++ ){ uint8 slot2=SlotConvert(cur_slot); ItemInst* inst = m_inv.GetItem(slot2); - if(inst != NULL) { + if(inst != nullptr) { inst->SetColor(inst->GetItem()->Color); database.SaveInventory(CharacterID(), inst, slot2); } @@ -7981,7 +7981,7 @@ void command_ginfo(Client *c, const Seperator *sep) uint32 r; for(r = 0; r < MAX_GROUP_MEMBERS; r++) { - if(g->members[r] == NULL) { + if(g->members[r] == nullptr) { if(g->membername[r][0] == '\0') continue; c->Message(0, "...Zoned Member: %s, Roles: %s %s %s", g->membername[r], @@ -8006,7 +8006,7 @@ void command_hp(Client *c, const Seperator *sep) void command_aggro(Client *c, const Seperator *sep) { - if(c->GetTarget() == NULL || !c->GetTarget()->IsNPC()) { + if(c->GetTarget() == nullptr || !c->GetTarget()->IsNPC()) { c->Message(0, "Error: you must have an NPC target."); return; } @@ -8040,7 +8040,7 @@ void command_pf(Client *c, const Seperator *sep) } void command_bestz(Client *c, const Seperator *sep) { - if (zone->zonemap == NULL) { + if (zone->zonemap == nullptr) { c->Message(0,"Maps deactivated in this zone."); return; } @@ -8064,10 +8064,10 @@ void command_bestz(Client *c, const Seperator *sep) { VERTEX bme(me); bme.z -= 500; - float best_z = zone->zonemap->FindBestZ(pnode, me, &hit, NULL); + float best_z = zone->zonemap->FindBestZ(pnode, me, &hit, nullptr); float best_z2 = -999990; - if(zone->zonemap->LineIntersectsNode(pnode, me, bme, &hit, NULL)) { + if(zone->zonemap->LineIntersectsNode(pnode, me, bme, &hit, nullptr)) { best_z2 = hit.z; } @@ -8080,7 +8080,7 @@ void command_bestz(Client *c, const Seperator *sep) { c->Message(0,"Found no Z."); } - if(zone->watermap == NULL) { + if(zone->watermap == nullptr) { c->Message(0,"Water Region Map not loaded for this zone"); } else { WaterRegionType RegionType; @@ -8124,7 +8124,7 @@ void command_flags(Client *c, const Seperator *sep) { if(c->Admin() >= minStatusToSeeOthersZoneFlags) { Mob *tgt = c->GetTarget(); - if(tgt != NULL && tgt->IsClient()) + if(tgt != nullptr && tgt->IsClient()) t = tgt->CastToClient(); } @@ -8231,7 +8231,7 @@ void command_flagedit(Client *c, const Seperator *sep) { } Mob *t = c->GetTarget(); - if(t == NULL || !t->IsClient()) { + if(t == nullptr || !t->IsClient()) { c->Message(13, "client target required"); return; } @@ -8251,7 +8251,7 @@ void command_flagedit(Client *c, const Seperator *sep) { } Mob *t = c->GetTarget(); - if(t == NULL || !t->IsClient()) { + if(t == nullptr || !t->IsClient()) { c->Message(13, "client target required"); return; } @@ -8290,7 +8290,7 @@ void command_mlog(Client *c, const Seperator *sep) { else { c->Message(13, "Invalid argument. Expected on/off."); return; } Mob *tgt = c->GetTarget(); - if(tgt == NULL) { + if(tgt == nullptr) { c->Message(13, "You must have a target for this command."); return; } @@ -8470,7 +8470,7 @@ void command_guildlist(Client *c, const Seperator *sep) void command_hatelist(Client *c, const Seperator *sep) { Mob *target = c->GetTarget(); - if(target == NULL) { + if(target == nullptr) { c->Message(0, "Error: you must have a target."); return; } @@ -8621,7 +8621,7 @@ void command_rules(Client *c, const Seperator *sep) { c->Message(0, " %s", *cur); } } else if(sep->argnum == 2) { - const char *catfilt = NULL; + const char *catfilt = nullptr; if(std::string("all") != sep->arg[2]) catfilt = sep->arg[2]; std::vector rule_list; @@ -8644,7 +8644,7 @@ void command_rules(Client *c, const Seperator *sep) { c->Message(13, "Invalid argument count, see help."); return; } else { - const char *catfilt = NULL; + const char *catfilt = nullptr; if(std::string("all") != sep->arg[2]) catfilt = sep->arg[2]; std::vector rule_list; @@ -8777,11 +8777,11 @@ void command_altactivate(Client *c, const Seperator *sep){ if(!strcasecmp(sep->arg[1], "list")){ c->Message(10, "You have access to the following AA Abilities:"); int x, val; - SendAA_Struct* saa = NULL; + SendAA_Struct* saa = nullptr; for(x = 0; x < aaHighestID; x++){ if(AA_Actions[x][0].spell_id || AA_Actions[x][0].action){ //if there's an action or spell associated we assume it's a valid val = 0; //and assume if they don't have a value for the first rank then it isn't valid for any rank - saa = NULL; + saa = nullptr; val = c->GetAA(x); if(val){ saa = zone->FindAA(x); @@ -8810,7 +8810,7 @@ void command_altactivate(Client *c, const Seperator *sep){ } void command_refundaa(Client *c, const Seperator *sep){ - Client* refundee = NULL; + Client* refundee = nullptr; int curpt = 0; bool refunded = false; if(c){ @@ -9355,7 +9355,7 @@ void command_instance(Client *c, const Seperator *sep) return; } - const char * zn = NULL; + const char * zn = nullptr; uint32 zone_id = 0; if(sep->IsNumber(2)) @@ -9478,7 +9478,7 @@ void command_instance(Client *c, const Seperator *sep) uint32 charid = database.GetCharacterID(sep->arg[2]); if(charid <= 0) { - if(c->GetTarget() == NULL || (c->GetTarget() && !c->GetTarget()->IsClient())) + if(c->GetTarget() == nullptr || (c->GetTarget() && !c->GetTarget()->IsClient())) { c->Message(0, "Character not found."); return; @@ -9508,7 +9508,7 @@ void command_instance(Client *c, const Seperator *sep) void command_setstartzone(Client *c, const Seperator *sep) { uint32 startzone = 0; - Client* target = NULL; + Client* target = nullptr; if(c->GetTarget() && c->GetTarget()->IsClient() && sep->arg[1][0] != 0) target = c->GetTarget()->CastToClient(); else { @@ -9584,7 +9584,7 @@ void command_object(Client *c, const Seperator *sep) int iObjectsFound = 0; int len; - Object* o = NULL; + Object* o = nullptr; Object_Struct od; Door door; Doors* doors; @@ -9814,7 +9814,7 @@ void command_object(Client *c, const Seperator *sep) // Already in database? if (database.RunQuery(query, len, errbuf, &result)) { - if ((row = mysql_fetch_row(result)) != NULL) + if ((row = mysql_fetch_row(result)) != nullptr) { if (atoi(row[0]) > 0) { @@ -9863,7 +9863,7 @@ void command_object(Client *c, const Seperator *sep) iObjectsFound = 0; if (database.RunQuery(query, len, errbuf, &result)) { - if ((row = mysql_fetch_row(result)) != NULL) + if ((row = mysql_fetch_row(result)) != nullptr) { iObjectsFound = atoi(row[0]); // Number of nearby objects from database } @@ -9947,7 +9947,7 @@ void command_object(Client *c, const Seperator *sep) od.zone_id = zone->GetZoneID(); od.zone_instance = zone->GetInstanceVersion(); - o = new Object(id, od.object_type, icon, od, NULL); + o = new Object(id, od.object_type, icon, od, nullptr); // Add to our zone entity list and spawn immediately for all clients entity_list.AddObject(o, true); @@ -10364,7 +10364,7 @@ void command_object(Client *c, const Seperator *sep) } else { - o->GetLocation(NULL, &od.y, NULL); + o->GetLocation(nullptr, &od.y, nullptr); } if (sep->argnum > 4) @@ -10373,7 +10373,7 @@ void command_object(Client *c, const Seperator *sep) } else { - o->GetLocation(NULL, NULL, &od.z); + o->GetLocation(nullptr, nullptr, &od.z); } if (sep->argnum > 5) @@ -10404,7 +10404,7 @@ void command_object(Client *c, const Seperator *sep) return; } - if ((o = entity_list.FindObject(id)) == NULL) + if ((o = entity_list.FindObject(id)) == nullptr) { c->Message(0, "ERROR: Object %u not found in zone, or is a static object not yet unlocked with '#object Edit' for editing.", id); @@ -10820,7 +10820,7 @@ void command_object(Client *c, const Seperator *sep) app = new EQApplicationPacket(); o->CreateDeSpawnPacket(app); - entity_list.QueueClients(NULL, app); + entity_list.QueueClients(nullptr, app); entity_list.RemoveObject(o->GetID()); @@ -10945,7 +10945,7 @@ void command_object(Client *c, const Seperator *sep) od.object_type = TempStaticType; } - o = new Object(id, od.object_type, icon, od, NULL); + o = new Object(id, od.object_type, icon, od, nullptr); entity_list.AddObject(o, true); c->Message(0, "Object %u reloaded from database.", id); @@ -11097,7 +11097,7 @@ void command_emotesearch(Client *c, const Seperator *sep) strn0cpy(sText, nes->text, sizeof(sText)); strupr(sText); pdest = strstr(sText, sCriteria); - if (pdest != NULL) + if (pdest != nullptr) { c->Message(0, "EmoteID: %i Event: %i Type: %i Text: %s", nes->emoteid, nes->event_, nes->type, nes->text); count++; @@ -11124,14 +11124,14 @@ void command_reloademote(Client *c, const Seperator *sep) void command_globalview(Client *c, const Seperator *sep) { - NPC * npcmob = NULL; + NPC * npcmob = nullptr; if(c->GetTarget() && c->GetTarget()->IsNPC()) { npcmob = c->GetTarget()->CastToNPC(); - QGlobalCache *npc_c = NULL; - QGlobalCache *char_c = NULL; - QGlobalCache *zone_c = NULL; + QGlobalCache *npc_c = nullptr; + QGlobalCache *char_c = nullptr; + QGlobalCache *zone_c = nullptr; if(npcmob) npc_c = npcmob->GetQGlobals(); @@ -11174,8 +11174,8 @@ void command_globalview(Client *c, const Seperator *sep) } else { - QGlobalCache *char_c = NULL; - QGlobalCache *zone_c = NULL; + QGlobalCache *char_c = nullptr; + QGlobalCache *zone_c = nullptr; char_c = c->GetQGlobals(); zone_c = zone->GetQGlobals(); @@ -11485,7 +11485,7 @@ void command_mysql(Client *c, const Seperator *sep) LineVec.push_back(LineText.str()); LineText.str(""); } - LineText << fields[i].name << ":" << "[" << (row[i] ? row[i] : "NULL") << "] "; + LineText << fields[i].name << ":" << "[" << (row[i] ? row[i] : "nullptr") << "] "; } LineVec.push_back(LineText.str()); @@ -11627,7 +11627,7 @@ void command_augmentitem(Client *c, const Seperator *sep) in_augment->unknown02[0] = 0; in_augment->unknown02[1] = 0; in_augment->augment_slot = -1; - if(c->GetTradeskillObject() != NULL) + if(c->GetTradeskillObject() != nullptr) Object::HandleAugmentation(c, in_augment, c->GetTradeskillObject()); safe_delete_array(in_augment); } diff --git a/zone/doors.cpp b/zone/doors.cpp index c638ef746..2c9b2fd7e 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -291,14 +291,14 @@ void Doors::HandleClick(Client* sender, uint8 trigger) } } } - else if(lockpicks != NULL) + else if(lockpicks != nullptr) { if(sender->GetSkill(PICK_LOCK)) { if(lockpicks->GetItem()->ItemType == ItemTypeLockPick) { float modskill=sender->GetSkill(PICK_LOCK); - sender->CheckIncreaseSkill(PICK_LOCK, NULL, 1); + sender->CheckIncreaseSkill(PICK_LOCK, nullptr, 1); #if EQDEBUG>=5 LogFile->write(EQEMuLog::Debug, "Client has lockpicks: skill=%f", modskill); @@ -580,7 +580,7 @@ int32 ZoneDatabase::GetDoorsCount(uint32* oMaxID, const char *zone_name, int16 v if (RunQuery(query, strlen(query), errbuf, &result)) { safe_delete_array(query); row = mysql_fetch_row(result); - if (row != NULL && row[1] != 0) { + if (row != nullptr && row[1] != 0) { int32 ret = atoi(row[1]); if (oMaxID) { if (row[0]) @@ -614,7 +614,7 @@ int32 ZoneDatabase::GetDoorsCountPlusOne(const char *zone_name, int16 version) { if (RunQuery(query, strlen(query), errbuf, &result)) { safe_delete_array(query); row = mysql_fetch_row(result); - if (row != NULL && row[1] != 0) { + if (row != nullptr && row[1] != 0) { if (row[0]) oMaxID = atoi(row[0]) + 1; else @@ -645,7 +645,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) if (RunQuery(query, strlen(query), errbuf, &result)) { safe_delete_array(query); row = mysql_fetch_row(result); - if (row != NULL && row[1] != 0) { + if (row != nullptr && row[1] != 0) { if (row[0]) oMaxID = atoi(row[0]) + 1; else @@ -711,7 +711,7 @@ bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name into[r].incline=atoi(row[23]); into[r].size=atoi(row[24]); into[r].is_ldon_door=atoi(row[25]); - into[r].client_version_mask = (uint32)strtoul(row[26], NULL, 10); + into[r].client_version_mask = (uint32)strtoul(row[26], nullptr, 10); } mysql_free_result(result); } diff --git a/zone/effects.cpp b/zone/effects.cpp index 67cc4b937..e84959c92 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -445,7 +445,7 @@ bool Client::TrainDiscipline(uint32 itemid) { //get the item info const Item_Struct *item = database.GetItem(itemid); - if(item == NULL) { + if(item == nullptr) { Message(13, "Unable to find the tome you turned in!"); LogFile->write(EQEMuLog::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); return(false); diff --git a/zone/embparser.cpp b/zone/embparser.cpp index dc77b4e75..37fe1ba5a 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -100,7 +100,7 @@ extern Zone* zone; PerlembParser::PerlembParser(void) : Parser() { - perl = NULL; + perl = nullptr; eventQueueProcessing = false; globalPlayerQuestLoaded = pQuestReadyToLoad; globalNPCQuestLoaded = nQuestReadyToLoad; @@ -229,7 +229,7 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d EventRecord e; e.event = event; e.objid = objid; - if(data != NULL) + if(data != nullptr) e.data = data; e.npcmob = npcmob; e.iteminst = iteminst; @@ -368,9 +368,9 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d if(npcmob && npcmob->GetQglobal()) { map globhash; - QGlobalCache *npc_c = NULL; - QGlobalCache *char_c = NULL; - QGlobalCache *zone_c = NULL; + QGlobalCache *npc_c = nullptr; + QGlobalCache *char_c = nullptr; + QGlobalCache *zone_c = nullptr; //retrieve our globals npc_c = npcmob->GetQGlobals(); @@ -429,8 +429,8 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d else { map globhash; - QGlobalCache *char_c = NULL; - QGlobalCache *zone_c = NULL; + QGlobalCache *char_c = nullptr; + QGlobalCache *zone_c = nullptr; //retrieve our globals if(mob && mob->IsClient()) @@ -560,7 +560,7 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d for(int slot=HASITEM_FIRST; slot<=HASITEM_LAST;slot++) { - char *hi_decl=NULL; + char *hi_decl=nullptr; int itemid=mob->CastToClient()->GetItemIDAt(slot); if(!HASITEM_ISNULLITEM(itemid)) { @@ -578,7 +578,7 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d if(mob && mob->IsClient()) { string hashname = packagename + std::string("::oncursor"); perl->eval(std::string("%").append(hashname).append(" = ();").c_str()); - char *hi_decl = NULL; + char *hi_decl = nullptr; int itemid = mob->CastToClient()->GetItemIDAt(30); if(!HASITEM_ISNULLITEM(itemid)) { MakeAnyLenString(&hi_decl, "push (@{$%s{%d}},%d);",hashname.c_str(),itemid,30); @@ -817,7 +817,7 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d } if(isPlayerQuest || isGlobalPlayerQuest){ - SendCommands(packagename.c_str(), sub_name, 0, mob, mob, NULL); + SendCommands(packagename.c_str(), sub_name, 0, mob, mob, nullptr); } else if(isItemQuest) { SendCommands(packagename.c_str(), sub_name, 0, mob, mob, iteminst); @@ -825,13 +825,13 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d else if(isSpellQuest) { if(mob) { - SendCommands(packagename.c_str(), sub_name, 0, mob, mob, NULL); + SendCommands(packagename.c_str(), sub_name, 0, mob, mob, nullptr); } else { - SendCommands(packagename.c_str(), sub_name, 0, npcmob, mob, NULL); + SendCommands(packagename.c_str(), sub_name, 0, npcmob, mob, nullptr); } } else { - SendCommands(packagename.c_str(), sub_name, objid, npcmob, mob, NULL); + SendCommands(packagename.c_str(), sub_name, objid, npcmob, mob, nullptr); } //now handle any events that cropped up... @@ -839,27 +839,27 @@ void PerlembParser::EventCommon(QuestEventID event, uint32 objid, const char * d } void PerlembParser::EventGlobalNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data) { - EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, NULL, init, extra_data, true); + EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, init, extra_data, true); } void PerlembParser::EventNPC(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data) { - EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, NULL, init, extra_data); + EventCommon(evt, npc->GetNPCTypeID(), data.c_str(), npc, nullptr, init, extra_data); } void PerlembParser::EventPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data) { - EventCommon(evt, 0, data.c_str(), NULL, NULL, client, extra_data); + EventCommon(evt, 0, data.c_str(), nullptr, nullptr, client, extra_data); } void PerlembParser::EventGlobalPlayer(QuestEventID evt, Client *client, std::string data, uint32 extra_data) { - EventCommon(evt, 0, data.c_str(), NULL, NULL, client, extra_data, true); + EventCommon(evt, 0, data.c_str(), nullptr, nullptr, client, extra_data, true); } void PerlembParser::EventItem(QuestEventID evt, Client *client, ItemInst *item, uint32 objid, uint32 extra_data) { - EventCommon(evt, objid, NULL, NULL, item, client, extra_data); + EventCommon(evt, objid, nullptr, nullptr, item, client, extra_data); } void PerlembParser::EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data) { - EventCommon(evt, 0, itoa(spell_id), npc, NULL, client, extra_data); + EventCommon(evt, 0, itoa(spell_id), npc, nullptr, client, extra_data); } void PerlembParser::ReloadQuests(bool with_timers) { @@ -873,22 +873,22 @@ void PerlembParser::ReloadQuests(bool with_timers) { command_clear_perl(); try { - if(perl == NULL) + if(perl == nullptr) perl = new Embperl; else perl->Reinit(); map_funs(); } catch(std::exception &e) { - if(perl != NULL) { + if(perl != nullptr) { delete perl; - perl = NULL; + perl = nullptr; } LogFile->write(EQEMuLog::Status, "Error re-initializing perlembed: %s", e.what()); throw e.what(); } try { - LoadScript(0, NULL); + LoadScript(0, nullptr); } catch(const char * err) { LogFile->write(EQEMuLog::Status, "Error loading default script: %s", err); @@ -944,7 +944,7 @@ int PerlembParser::LoadScript(int npcid, const char * zone, Mob* activater) int count0 = 0; bool filefound = false; tmpf = fopen(filename.c_str(), "r"); - if(tmpf != NULL) + if(tmpf != nullptr) { fclose(tmpf); filefound = true; @@ -958,7 +958,7 @@ int PerlembParser::LoadScript(int npcid, const char * zone, Mob* activater) //revert to just path filename = bnfilename; const NPCType *npct = database.GetNPCType(npcid); - if(npct == NULL) + if(npct == nullptr) { //LogFile->write(EQEMuLog::Debug, " no npc type"); //revert and go on with life @@ -974,7 +974,7 @@ int PerlembParser::LoadScript(int npcid, const char * zone, Mob* activater) if(nlen < 64) { int r; - //this should get our NULL as well.. + //this should get our nullptr as well.. for(r = 0; r <= nlen; r++) { tmpname[r] = npct->name[r]; @@ -1021,7 +1021,7 @@ int PerlembParser::LoadScript(int npcid, const char * zone, Mob* activater) #ifdef QUEST_TEMPLATES_BYNAME tmpf = fopen(filename.c_str(), "r"); - if(tmpf != NULL) + if(tmpf != nullptr) { fclose(tmpf); filefound = true; @@ -1063,7 +1063,7 @@ int PerlembParser::LoadScript(int npcid, const char * zone, Mob* activater) #endif //QUEST_SCRIPTS_BYNAME tmpf = fopen(filename.c_str(), "r"); - if(tmpf != NULL) + if(tmpf != nullptr) { fclose(tmpf); filefound = true; @@ -1080,7 +1080,7 @@ int PerlembParser::LoadScript(int npcid, const char * zone, Mob* activater) } tmpf = fopen(filename.c_str(), "r"); - if(tmpf != NULL) + if(tmpf != nullptr) { fclose(tmpf); filefound = true; @@ -1102,7 +1102,7 @@ int PerlembParser::LoadScript(int npcid, const char * zone, Mob* activater) //check for existance of quest file before trying to make perl load it. tmpf = fopen(filename.c_str(), "r"); - if(tmpf == NULL) + if(tmpf == nullptr) { //the npc has no qst file, attach the defaults std::string setdefcmd = "$"; @@ -1533,7 +1533,7 @@ void PerlembParser::SendCommands(const char * pkgprefix, const char *event, uint if(mob && mob->IsClient()) quest_manager.StartQuest(other, mob->CastToClient()); else - quest_manager.StartQuest(other, NULL); + quest_manager.StartQuest(other, nullptr); try { @@ -1570,7 +1570,7 @@ void PerlembParser::SendCommands(const char * pkgprefix, const char *event, uint void PerlembParser::ExecCommand(Client *c, Seperator *sep) { #ifdef EMBPERL_XS_CLASSES SV *client = get_sv("commands::client", true); - if(c != NULL) { + if(c != nullptr) { sv_setref_pv(client, "Client", c); } else { //clear out the value, mainly to get rid of blessedness diff --git a/zone/embperl.cpp b/zone/embperl.cpp index 13e822ddf..8895b500c 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -114,7 +114,7 @@ void Embperl::DoInit() { #ifdef EMBPERL_IO_CAPTURE "-w", "-W", #endif - "-e", "0;", NULL }; + "-e", "0;", nullptr }; int argc = 3; #ifdef EMBPERL_IO_CAPTURE @@ -122,7 +122,7 @@ void Embperl::DoInit() { #endif char **argv = (char **)argv_eqemu; - char **env = { NULL }; + char **env = { nullptr }; PL_perl_destruct_level = 1; diff --git a/zone/embperl.h b/zone/embperl.h index 77c8dab2f..0ef7ea62d 100644 --- a/zone/embperl.h +++ b/zone/embperl.h @@ -91,7 +91,7 @@ public: //evaluate an expression. throws string errors on fail void eval(const char * code); //execute a subroutine. throws lasterr on failure - void dosub(const char * subname, const std::vector * args = NULL, int mode = G_SCALAR|G_DISCARD|G_EVAL); + void dosub(const char * subname, const std::vector * args = nullptr, int mode = G_SCALAR|G_DISCARD|G_EVAL); //Access to perl variables //all varnames here should be of the form package::name @@ -138,7 +138,7 @@ public: SV *val = newSVpv(it->second.c_str(), it->second.length()); // If val was not added to hash, reset reference count - if (hv_store(hv, it->first.c_str(), keylen, val, 0) == NULL) + if (hv_store(hv, it->first.c_str(), keylen, val, 0) == nullptr) val->sv_refcnt = 0; } } diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 35e7730f4..402bf7c73 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -28,13 +28,13 @@ const char *getItemName(unsigned itemid) { - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; item = database.GetItem(itemid); if (item) return item->Name; else - return NULL; + return nullptr; } XS(XS_qc_getItemName); /* prototype to pass -Wmissing-prototypes */ diff --git a/zone/entity.cpp b/zone/entity.cpp index 660db5d7d..6026329fd 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -83,7 +83,7 @@ void Entity::SetID(uint16 set_id) { Client* Entity::CastToClient() { if(this==0x00){ - cout << "CastToClient error (NULL)" << endl; + cout << "CastToClient error (nullptr)" << endl; DebugBreak(); return 0; } @@ -188,7 +188,7 @@ Beacon* Entity::CastToBeacon() { const Client* Entity::CastToClient() const { if(this==0x00){ - cout << "CastToClient error (NULL)" << endl; + cout << "CastToClient error (nullptr)" << endl; DebugBreak(); return 0; } @@ -350,7 +350,7 @@ void EntityList::TrapProcess() { } -// Debug function -- checks to see if group_list has any NULL entries. +// Debug function -- checks to see if group_list has any nullptr entries. // Meant to be called after each group-related function, in order // to track down bugs. void EntityList::CheckGroupList (const char *fname, const int fline) @@ -359,9 +359,9 @@ void EntityList::CheckGroupList (const char *fname, const int fline) for (it = group_list.begin(); it != group_list.end(); it++) { - if (*it == NULL) + if (*it == nullptr) { - LogFile->write(EQEMuLog::Error, "NULL group, %s:%i", fname, fline); + LogFile->write(EQEMuLog::Error, "nullptr group, %s:%i", fname, fline); } } } @@ -556,7 +556,7 @@ void EntityList::BeaconProcess() { void EntityList::AddGroup(Group* group) { - if(group == NULL) //this seems to be happening somehow... + if(group == nullptr) //this seems to be happening somehow... return; uint32 gid = worldserver.NextGroupID(); @@ -584,7 +584,7 @@ void EntityList::AddGroup(Group* group, uint32 gid) { } void EntityList::AddRaid(Raid* raid) { - if(raid == NULL) + if(raid == nullptr) return; uint32 gid = worldserver.NextGroupID(); @@ -619,7 +619,7 @@ void EntityList::AddCorpse(Corpse* corpse, uint32 in_id) { void EntityList::AddNPC(NPC* npc, bool SendSpawnPacket, bool dontqueue) { npc->SetID(GetFreeID()); - parse->EventNPC(EVENT_SPAWN, npc, NULL, "", 0); + parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0); uint16 emoteid = npc->GetEmoteID(); if(emoteid != 0) @@ -671,7 +671,7 @@ void EntityList::AddMerc(Merc* merc, bool SendSpawnPacket, bool dontqueue) { safe_delete(ns); } - //parse->EventMERC(EVENT_SPAWN, merc, NULL, "", 0); + //parse->EventMERC(EVENT_SPAWN, merc, nullptr, "", 0); } merc_list.Insert(merc); @@ -800,7 +800,7 @@ Object* EntityList::FindObject(uint32 object_id) } iterator.Advance(); } - return NULL; + return nullptr; } Object* EntityList::FindNearbyObject(float x, float y, float z, float radius) @@ -830,7 +830,7 @@ Object* EntityList::FindNearbyObject(float x, float y, float z, float radius) } - return NULL; + return nullptr; } @@ -1604,7 +1604,7 @@ void EntityList::QueueClientsByTarget(Mob* sender, const EQApplicationPacket* ap if(!Target) continue; - Mob *TargetsTarget = NULL; + Mob *TargetsTarget = nullptr; if(Target) TargetsTarget = Target->GetTarget(); @@ -1659,7 +1659,7 @@ void EntityList::QueueClientsByXTarget(Mob* sender, const EQApplicationPacket* a } void EntityList::QueueCloseClients(Mob* sender, const EQApplicationPacket* app, bool ignore_sender, float dist, Mob* SkipThisMob, bool ackreq, eqFilterType filter) { - if (sender == NULL) { + if (sender == nullptr) { QueueClients(sender, app, ignore_sender); return; } @@ -1962,7 +1962,7 @@ Client* EntityList::GetRandomClient(float x, float y, float z, float Distance, C } if(ClientsInRange.size() == 0) - return NULL; + return nullptr; return ClientsInRange[MakeRandomInt(0, ClientsInRange.size() - 1)]; } @@ -3546,7 +3546,7 @@ void EntityList::AddHealAggro(Mob* target, Mob* caster, uint16 thedam) LinkedListIterator iterator(npc_list); iterator.Reset(); - NPC *cur = NULL; + NPC *cur = nullptr; uint16 count = 0; while(iterator.MoreElements()) { @@ -3573,7 +3573,7 @@ void EntityList::AddHealAggro(Mob* target, Mob* caster, uint16 thedam) thedam = 1; } - cur = NULL; + cur = nullptr; iterator.Reset(); while(iterator.MoreElements()) { @@ -3717,7 +3717,7 @@ void EntityList::ProcessMove(Client *c, float x, float y, float z) { for(iterator.Reset(); iterator.MoreElements(); iterator.Advance()) { NPC *d = iterator.GetData(); NPCProximity *l = d->proximity; - if(l == NULL) + if(l == nullptr) continue; //This is done to address the issue of this code not being reentrant @@ -3786,7 +3786,7 @@ void EntityList::ProcessProximitySay(const char *Message, Client *c, uint8 langu for(iterator.Reset(); iterator.MoreElements(); iterator.Advance()) { NPC *d = iterator.GetData(); NPCProximity *l = d->proximity; - if(l == NULL || !l->say) + if(l == nullptr || !l->say) continue; if( c->GetX() < l->min_x || c->GetX() > l->max_x @@ -4033,7 +4033,7 @@ void EntityList::DestroyTempPets(Mob *owner) bool Entity::CheckCoordLosNoZLeaps(float cur_x, float cur_y, float cur_z, float trg_x, float trg_y, float trg_z, float perwalk) { - if(zone->zonemap == NULL) { + if(zone->zonemap == nullptr) { return(true); } VERTEX myloc; @@ -4084,11 +4084,11 @@ void EntityList::QuestJournalledSayClose(Mob *sender, Client *QuestInitiator, fl Corpse* EntityList::GetClosestCorpse(Mob* sender, const char* Name) { if(!sender) - return NULL; + return nullptr; uint32 CurrentDistance, ClosestDistance = 4294967295u; - Corpse *CurrentCorpse, *ClosestCorpse = NULL; + Corpse *CurrentCorpse, *ClosestCorpse = nullptr; LinkedListIterator iterator(corpse_list); @@ -4123,7 +4123,7 @@ void EntityList::ForceGroupUpdate(uint32 gid) { iterator.Reset(); while(iterator.MoreElements()) { if(iterator.GetData()){ - Group *g = NULL; + Group *g = nullptr; g = iterator.GetData()->GetGroup(); if(g){ if(g->GetID() == gid) @@ -4142,7 +4142,7 @@ void EntityList::SendGroupLeave(uint32 gid, const char *name) { while(iterator.MoreElements()) { Client *c = iterator.GetData(); if(c){ - Group *g = NULL; + Group *g = nullptr; g = c->GetGroup(); if(g){ if(g->GetID() == gid) @@ -4172,7 +4172,7 @@ void EntityList::SendGroupJoin(uint32 gid, const char *name) { iterator.Reset(); while(iterator.MoreElements()) { if(iterator.GetData()){ - Group *g = NULL; + Group *g = nullptr; g = iterator.GetData()->GetGroup(); if(g){ if(g->GetID() == gid) @@ -4201,7 +4201,7 @@ void EntityList::GroupMessage(uint32 gid, const char *from, const char *message) iterator.Reset(); while(iterator.MoreElements()) { if(iterator.GetData()){ - Group *g = NULL; + Group *g = nullptr; g = iterator.GetData()->GetGroup(); if(g){ if(g->GetID() == gid) @@ -4267,7 +4267,7 @@ uint16 EntityList::CreateDoor(const char *model, float x, float y, float z, floa Mob* EntityList::GetTargetForMez(Mob* caster) { if(!caster) - return NULL; + return nullptr; LinkedListIterator iterator(mob_list); iterator.Reset(); @@ -4303,7 +4303,7 @@ Mob* EntityList::GetTargetForMez(Mob* caster) } iterator.Advance(); } - return NULL; + return nullptr; } void EntityList::SendZoneAppearance(Client *c) @@ -4649,7 +4649,7 @@ void EntityList::UnMarkNPC(uint16 ID) { if(iterator.GetData()) { - Group *g = NULL; + Group *g = nullptr; g = iterator.GetData()->GetGroup(); @@ -4982,7 +4982,7 @@ void EntityList::HideCorpses(Client *c, uint8 CurrentMode, uint8 NewMode) return; } - Group *g = NULL; + Group *g = nullptr; if(NewMode == HideCorpseAllButGroup) { @@ -5124,10 +5124,10 @@ void EntityList::CameraEffect(uint32 duration, uint32 intensity) { NPC* EntityList::GetClosestBanker(Mob* sender, uint32 &distance) { if(!sender) - return NULL; + return nullptr; distance = 4294967295u; - NPC* nc = NULL; + NPC* nc = nullptr; LinkedListIterator iterator(npc_list); iterator.Reset(); @@ -5168,11 +5168,11 @@ Mob* EntityList::GetClosestMobByBodyType(Mob* sender, bodyType BodyType) { if(!sender) - return NULL; + return nullptr; uint32 CurrentDistance, ClosestDistance = 4294967295u; - Mob *CurrentMob, *ClosestMob = NULL; + Mob *CurrentMob, *ClosestMob = nullptr; LinkedListIterator iterator(mob_list); @@ -5296,7 +5296,7 @@ Mob* EntityList::GetTargetForVirus(Mob* spreader) } if(TargetsInRange.size() == 0) - return NULL; + return nullptr; return TargetsInRange[MakeRandomInt(0, TargetsInRange.size() - 1)]; } diff --git a/zone/entity.h b/zone/entity.h index 3e3364e5a..fab3f8d9e 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -145,7 +145,7 @@ public: Client* GetClientByCharID(uint32 iCharID); Client* GetClientByWID(uint32 iWID); Client* GetClient(uint32 ip, uint16 port); - Client* GetRandomClient(float x, float y, float z, float Distance, Client *ExcludeClient = NULL); + Client* GetRandomClient(float x, float y, float z, float Distance, Client *ExcludeClient = nullptr); Group* GetGroupByMob(Mob* mob); Group* GetGroupByClient(Client* client); Group* GetGroupByID(uint32 id); @@ -180,7 +180,7 @@ public: void RefreshAllGuildInfo(uint32 guild_id); void SendGuildList(); // void SendGuildJoin(GuildJoin_Struct* gj); - // Check group list for NULL entries + // Check group list for nullptr entries void CheckGroupList (const char *fname, const int fline); void GroupProcess(); void RaidProcess(); diff --git a/zone/exp.cpp b/zone/exp.cpp index 4d43b64af..5f6973c98 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -510,7 +510,7 @@ void Group::SplitExp(uint32 exp, Mob* other) { uint8 maxlevel = 1; for (i = 0; i < MAX_GROUP_MEMBERS; i++) { - if (members[i] != NULL) { + if (members[i] != nullptr) { if(members[i]->GetLevel() > maxlevel) maxlevel = members[i]->GetLevel(); @@ -542,7 +542,7 @@ void Group::SplitExp(uint32 exp, Mob* other) { return; for (i = 0; i < MAX_GROUP_MEMBERS; i++) { - if (members[i] != NULL && members[i]->IsClient()) // If Group Member is Client + if (members[i] != nullptr && members[i]->IsClient()) // If Group Member is Client { Client *cmember = members[i]->CastToClient(); // add exp + exp cap @@ -571,7 +571,7 @@ void Raid::SplitExp(uint32 exp, Mob* other) { uint8 maxlevel = 1; for (int i = 0; i < MAX_RAID_MEMBERS; i++) { - if (members[i].member != NULL) { + if (members[i].member != nullptr) { if(members[i].member->GetLevel() > maxlevel) maxlevel = members[i].member->GetLevel(); @@ -589,7 +589,7 @@ void Raid::SplitExp(uint32 exp, Mob* other) { return; for (unsigned int x = 0; x < MAX_RAID_MEMBERS; x++) { - if (members[x].member != NULL) // If Group Member is Client + if (members[x].member != nullptr) // If Group Member is Client { Client *cmember = members[x].member; // add exp + exp cap @@ -642,7 +642,7 @@ void Client::SendLeadershipEXPUpdate() { uint32 Client::GetCharMaxLevelFromQGlobal() { - QGlobalCache *char_c = NULL; + QGlobalCache *char_c = nullptr; char_c = this->GetQGlobals(); std::list globalMap; @@ -665,4 +665,4 @@ uint32 Client::GetCharMaxLevelFromQGlobal() { } return false; // Default is false -} \ No newline at end of file +} diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 6a1268beb..ed7d5045a 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -210,7 +210,7 @@ void Mob::CalculateNewFearpoint() //old fear function, kept for ref. /*void Mob::SetFeared(Mob *caster, uint32 duration, bool flee) { //special args to stop fear - if(caster == NULL && duration == 0) { + if(caster == nullptr && duration == 0) { fear_state = fearStateNotFeared; #ifdef FLEE_HP_RATIO flee_mode = false; @@ -222,14 +222,14 @@ void Mob::CalculateNewFearpoint() flee_mode = flee; //fear dosent work without at least maps - if(zone->zonemap == NULL) { + if(zone->zonemap == nullptr) { fear_state = fearStateStuck; return; //just stand there } //if we are allready feared, and we are on a fear grid.. //then just stay happy on the grid... - if(fear_path_state != NULL) { + if(fear_path_state != nullptr) { if(fear_state != fearStateGrid) { LogFile->write(EQEMuLog::Debug, "Umm... %s has a fear path state, but is not in a grid state. Wtf?", GetName()); fear_state = fearStateGrid; @@ -247,7 +247,7 @@ void Mob::CalculateNewFearpoint() //now we have to think a little more. //first, try to find a fear node that we can see. - if(zone->pathing != NULL) { + if(zone->pathing != nullptr) { fear_path_state = new MobFearState(); if(zone->pathing->FindNearestFear(fear_path_state, GetX(), GetY(), GetZ())) { #ifdef FEAR_PATHING_DEBUG @@ -284,7 +284,7 @@ void Mob::CalculateNewFearpoint() //old fear function, kept for ref. bool Mob::FearTryStraight(Mob *caster, uint32 duration, bool flee, VERTEX &hit, VERTEX &fear_vector) { //gotta have somebody to run from - if(caster == NULL) + if(caster == nullptr) return(false); //our goal is to run along this vector... @@ -310,7 +310,7 @@ bool Mob::FearTryStraight(Mob *caster, uint32 duration, bool flee, VERTEX &hit, end.y = start.y + fear_vector.y * distance; end.z = start.z; - if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, NULL)) { + if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, nullptr)) { #ifdef FEAR_PATHING_DEBUG LogFile->write(EQEMuLog::Debug, "Fear Pathing Start: can run entire vector from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f)", GetX(), GetY(), GetZ(), end.x, end.y, end.z); @@ -328,7 +328,7 @@ bool Mob::FearTryStraight(Mob *caster, uint32 duration, bool flee, VERTEX &hit, //old fear function, kept for ref. void Mob::CalculateFearPosition() { - if(zone->zonemap == NULL || fear_state == fearStateStuck) { + if(zone->zonemap == nullptr || fear_state == fearStateStuck) { return; //just stand there } @@ -395,7 +395,7 @@ void Mob::CalculateFearPosition() { } //we wanted to try to find a waypoint now, so lets try.. - if(zone->pathing != NULL) { + if(zone->pathing != nullptr) { fear_path_state = new MobFearState(); if(zone->pathing->FindNearestFear(fear_path_state, GetX(), GetY(), GetZ())) { @@ -473,7 +473,7 @@ void Mob::CalculateFearPosition() { end.y = start.y + fear_vector.y * 10; end.z = start.z; - if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &normalhit, NULL)) { + if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &normalhit, nullptr)) { #ifdef FEAR_PATHING_DEBUG LogFile->write(EQEMuLog::Debug, "Fear Pathing: From (%.2f, %.2f, %.2f) normal run to (%.2f, %.2f, %.2f)", GetX(), GetY(), GetZ(), end.x, end.y, end.z); @@ -514,7 +514,7 @@ void Mob::CalculateFearPosition() { NodeRef c = zone->zonemap->SeekNode(zone->zonemap->GetRoot(), end.x, end.y); if(c != NODE_NONE) { - cur_wp_z = zone->zonemap->FindBestZ(c, end, &hit, NULL); + cur_wp_z = zone->zonemap->FindBestZ(c, end, &hit, nullptr); if(cur_wp_z < start.z) cur_wp_z = end.z; //revert on error } @@ -540,7 +540,7 @@ void Mob::CalculateFearPosition() { end.y = start.y + fear_vector.y * speed; end.z = start.z + speed + speed; - if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, NULL)) { + if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, nullptr)) { #ifdef FEAR_PATHING_DEBUG LogFile->write(EQEMuLog::Debug, "Fear Pathing: From (%.2f, %.2f, %.2f) up hill run to (%.2f, %.2f, %.2f)", GetX(), GetY(), GetZ(), end.x, end.y, end.z); @@ -555,7 +555,7 @@ void Mob::CalculateFearPosition() { NodeRef c = zone->zonemap->SeekNode(zone->zonemap->GetRoot(), end.x, end.y); if(c != NODE_NONE) { - cur_wp_z = zone->zonemap->FindBestZ(c, end, &hit, NULL); + cur_wp_z = zone->zonemap->FindBestZ(c, end, &hit, nullptr); if(cur_wp_z < start.z) cur_wp_z = end.z; //revert on error } @@ -579,7 +579,7 @@ void Mob::CalculateFearPosition() { } end.z = start.z + 3; //a little lift as always - if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, NULL)) { + if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, nullptr)) { #ifdef FEAR_PATHING_DEBUG LogFile->write(EQEMuLog::Debug, "Fear Pathing: From (%.2f, %.2f, %.2f) strafe 1 to (%.2f, %.2f, %.2f)", GetX(), GetY(), GetZ(), end.x, end.y, end.z); @@ -602,7 +602,7 @@ void Mob::CalculateFearPosition() { } end.z = start.z + 3; //a little lift as always - if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, NULL)) { + if(!zone->zonemap->LineIntersectsZone(start, end, 0.5, &hit, nullptr)) { #ifdef FEAR_PATHING_DEBUG LogFile->write(EQEMuLog::Debug, "Fear Pathing: From (%.2f, %.2f, %.2f) strafe 2 to (%.2f, %.2f, %.2f)", GetX(), GetY(), GetZ(), end.x, end.y, end.z); diff --git a/zone/forage.cpp b/zone/forage.cpp index 388d0c119..175fb06c9 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -56,27 +56,27 @@ very low chance of dropping. Schema: CREATE TABLE forage ( - id int(11) NOT NULL auto_increment, - zoneid int(4) NOT NULL default '0', - Itemid int(11) NOT NULL default '0', - level smallint(6) NOT NULL default '0', - chance smallint(6) NOT NULL default '0', + id int(11) NOT nullptr auto_increment, + zoneid int(4) NOT nullptr default '0', + Itemid int(11) NOT nullptr default '0', + level smallint(6) NOT nullptr default '0', + chance smallint(6) NOT nullptr default '0', PRIMARY KEY (id) ) TYPE=MyISAM; old table upgrade: -alter table forage add chance smallint(6) NOT NULL default '0'; +alter table forage add chance smallint(6) NOT nullptr default '0'; update forage set chance=100; CREATE TABLE fishing ( - id int(11) NOT NULL auto_increment, - zoneid int(4) NOT NULL default '0', - Itemid int(11) NOT NULL default '0', - skill_level smallint(6) NOT NULL default '0', - chance smallint(6) NOT NULL default '0', - npc_id int NOT NULL default 0, - npc_chance int NOT NULL default 0, + id int(11) NOT nullptr auto_increment, + zoneid int(4) NOT nullptr default '0', + Itemid int(11) NOT nullptr default '0', + skill_level smallint(6) NOT nullptr default '0', + chance smallint(6) NOT nullptr default '0', + npc_id int NOT nullptr default 0, + npc_chance int NOT nullptr default 0, PRIMARY KEY (id) ) TYPE=MyISAM; @@ -208,7 +208,7 @@ bool Client::CanFish() { //make sure we still have a fishing pole on: const ItemInst* Pole = m_inv[SLOT_PRIMARY]; int32 bslot = m_inv.HasItemByUse(ItemTypeFishingBait, 1, invWhereWorn|invWherePersonal); - const ItemInst* Bait = NULL; + const ItemInst* Bait = nullptr; if(bslot != SLOT_INVALID) Bait = m_inv.GetItem(bslot); @@ -225,7 +225,7 @@ bool Client::CanFish() { return false; } - if(zone->zonemap!=NULL && zone->watermap != NULL && RuleB(Watermap, CheckForWaterWhenFishing)) { + if(zone->zonemap!=nullptr && zone->watermap != nullptr && RuleB(Watermap, CheckForWaterWhenFishing)) { float RodX, RodY, RodZ; // Tweak Rod and LineLength if required const float RodLength = RuleR(Watermap, FishingRodLength); @@ -246,7 +246,7 @@ bool Client::CanFish() { dest.z = z_pos+10; NodeRef n = zone->zonemap->SeekNode( zone->zonemap->GetRoot(), dest.x, dest.y); if(n != NODE_NONE) { - RodZ = zone->zonemap->FindBestZ(n, dest, NULL, NULL) - 1; + RodZ = zone->zonemap->FindBestZ(n, dest, nullptr, nullptr) - 1; bool in_lava = zone->watermap->InLava(RodX, RodY, RodZ); bool in_water = zone->watermap->InWater(RodX, RodY, RodZ) || zone->watermap->InVWater(RodX, RodY, RodZ); //Message(0, "Rod is at %4.3f, %4.3f, %4.3f, InWater says %d, InLava says %d", RodX, RodY, RodZ, in_water, in_lava); @@ -298,7 +298,7 @@ void Client::GoFish() //make sure we still have a fishing pole on: int32 bslot = m_inv.HasItemByUse(ItemTypeFishingBait, 1, invWhereWorn|invWherePersonal); - const ItemInst* Bait = NULL; + const ItemInst* Bait = nullptr; if(bslot != SLOT_INVALID) Bait = m_inv.GetItem(bslot); @@ -325,8 +325,8 @@ void Client::GoFish() if(npc_chance > 0 && npc_id) { if(npc_chance < MakeRandomInt(0, 99)) { const NPCType* tmp = database.GetNPCType(npc_id); - if(tmp != NULL) { - NPC* npc = new NPC(tmp, NULL, GetX()+3, GetY(), GetZ(), GetHeading(), FlyMode3); + if(tmp != nullptr) { + NPC* npc = new NPC(tmp, nullptr, GetX()+3, GetY(), GetZ(), GetHeading(), FlyMode3); npc->AddLootTable(); npc->AddToHateList(this, 1, 0, false); //no help yelling @@ -351,7 +351,7 @@ void Client::GoFish() Message_StringID(MT_Skills, FISHING_SUCCESS); const ItemInst* inst = database.CreateItem(food_item, 1); - if(inst != NULL) { + if(inst != nullptr) { if(CheckLoreConflict(inst->GetItem())) { this->Message_StringID(0,DUP_LORE); @@ -366,7 +366,7 @@ void Client::GoFish() safe_delete(inst); } - parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst != NULL ? inst->GetItem()->ID : 0); + parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst != nullptr ? inst->GetItem()->ID : 0); } else { @@ -393,7 +393,7 @@ void Client::GoFish() DeleteItemInInventory(13,0,true); } - if(CheckIncreaseSkill(FISHING, NULL, 5)) + if(CheckIncreaseSkill(FISHING, nullptr, 5)) { if(title_manager.IsNewTradeSkillTitleAvailable(FISHING, GetRawSkill(FISHING))) NotifyNewTitlesAvailable(); @@ -435,7 +435,7 @@ void Client::ForageItem(bool guarantee) { const Item_Struct* food_item = database.GetItem(foragedfood); if(!food_item) { - LogFile->write(EQEMuLog::Error, "NULL returned from database.GetItem in ClientForageItem"); + LogFile->write(EQEMuLog::Error, "nullptr returned from database.GetItem in ClientForageItem"); return; } @@ -460,7 +460,7 @@ void Client::ForageItem(bool guarantee) { Message_StringID(MT_Skills, stringid); const ItemInst* inst = database.CreateItem(food_item, 1); - if(inst != NULL) { + if(inst != nullptr) { // check to make sure it isn't a foraged lore item if(CheckLoreConflict(inst->GetItem())) { @@ -475,7 +475,7 @@ void Client::ForageItem(bool guarantee) { safe_delete(inst); } - parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst != NULL ? inst->GetItem()->ID : 0); + parse->EventPlayer(EVENT_FORAGE_SUCCESS, this, "", inst != nullptr ? inst->GetItem()->ID : 0); int ChanceSecondForage = aabonuses.ForageAdditionalItems + itembonuses.ForageAdditionalItems + spellbonuses.ForageAdditionalItems; if(!guarantee && MakeRandomInt(0,99) < ChanceSecondForage) { @@ -488,6 +488,6 @@ void Client::ForageItem(bool guarantee) { parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0); } - CheckIncreaseSkill(FORAGE, NULL, 5); + CheckIncreaseSkill(FORAGE, nullptr, 5); } diff --git a/zone/groups.cpp b/zone/groups.cpp index bcb100147..5d0168607 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -45,7 +45,7 @@ members array. Group::Group(uint32 gid) : GroupIDConsumer(gid) { - leader = NULL; + leader = nullptr; memset(members,0,sizeof(Mob*) * MAX_GROUP_MEMBERS); AssistTargetID = 0; TankTargetID = 0; @@ -119,7 +119,7 @@ void Group::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinu uint32 i; uint8 membercount = 0; for (i = 0; i < MAX_GROUP_MEMBERS; i++) { - if (members[i] != NULL) { + if (members[i] != nullptr) { membercount++; } @@ -193,7 +193,7 @@ void Group::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinu msg += " as your split"; for (i = 0; i < MAX_GROUP_MEMBERS; i++) { - if (members[i] != NULL && members[i]->IsClient()) { // If Group Member is Client + if (members[i] != nullptr && members[i]->IsClient()) { // If Group Member is Client Client *c = members[i]->CastToClient(); //I could not get MoneyOnCorpse to work, so we use this c->AddMoneyToPP(cpsplit, spsplit, gpsplit, ppsplit, true); @@ -208,7 +208,7 @@ bool Group::AddMember(Mob* newmember, const char *NewMemberName, uint32 Characte bool InZone = true; bool ismerc = false; - // This method should either be passed a Mob*, if the new member is in this zone, or a NULL Mob* + // This method should either be passed a Mob*, if the new member is in this zone, or a nullptr Mob* // and the name and CharacterID of the new member, if they are out of zone. // if(!newmember && !NewMemberName) @@ -274,7 +274,7 @@ bool Group::AddMember(Mob* newmember, const char *NewMemberName, uint32 Characte gj->leader_aas = LeaderAbilities; for (i = 0;i < MAX_GROUP_MEMBERS; i++) { - if (members[i] != NULL && members[i] != newmember) { + if (members[i] != nullptr && members[i] != newmember) { //fill in group join & send it if(members[i]->IsMerc()) { @@ -330,7 +330,7 @@ bool Group::AddMember(Mob* newmember, const char *NewMemberName, uint32 Characte } #ifdef BOTS for (i = 0;i < MAX_GROUP_MEMBERS; i++) { - if (members[i] != NULL && members[i]->IsBot()) { + if (members[i] != nullptr && members[i]->IsBot()) { members[i]->CastToBot()->CalcChanceToCast(); } } @@ -476,20 +476,20 @@ bool Group::UpdatePlayer(Mob* update){ void Group::MemberZoned(Mob* removemob) { uint32 i; - if (removemob == NULL) + if (removemob == nullptr) return; if(removemob == GetLeader()) - SetLeader(NULL); + SetLeader(nullptr); for (i = 0; i < MAX_GROUP_MEMBERS; i++) { if (members[i] == removemob) { - members[i] = NULL; + members[i] = nullptr; //should NOT clear the name, it is used for world communication. break; } #ifdef BOTS - if (members[i] != NULL && members[i]->IsBot()) { + if (members[i] != nullptr && members[i]->IsBot()) { members[i]->CastToBot()->CalcChanceToCast(); } #endif //BOTS @@ -539,13 +539,13 @@ bool Group::DelMemberOOZ(const char *Name) { bool Group::DelMember(Mob* oldmember,bool ignoresender) { - if (oldmember == NULL){ + if (oldmember == nullptr){ return false; } for (uint32 i = 0; i < MAX_GROUP_MEMBERS; i++) { if (members[i] == oldmember) { - members[i] = NULL; + members[i] = nullptr; membername[i][0] = '\0'; memset(membername[i],0,64); MemberRoles[i] = 0; @@ -581,7 +581,7 @@ bool Group::DelMember(Mob* oldmember,bool ignoresender) gu->leader_aas = LeaderAbilities; for (uint32 i = 0; i < MAX_GROUP_MEMBERS; i++) { - if (members[i] == NULL) { + if (members[i] == nullptr) { //if (DEBUG>=5) LogFile->write(EQEMuLog::Debug, "Group::DelMember() null member at slot %i", i); continue; } @@ -591,7 +591,7 @@ bool Group::DelMember(Mob* oldmember,bool ignoresender) members[i]->CastToClient()->QueuePacket(outapp); } #ifdef BOTS - if (members[i] != NULL && members[i]->IsBot()) { + if (members[i] != nullptr && members[i]->IsBot()) { members[i]->CastToBot()->CalcChanceToCast(); } #endif //BOTS @@ -671,7 +671,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { caster->SpellOnTarget(spell_id, caster->GetPet()); #endif } - else if(members[z] != NULL) + else if(members[z] != nullptr) { distance = caster->DistNoRoot(*members[z]); if(distance <= range2) { @@ -710,7 +710,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) { caster->BardPulse(spell_id, caster->GetPet()); #endif } - else if(members[z] != NULL) + else if(members[z] != nullptr) { distance = caster->DistNoRoot(*members[z]); if(distance <= range2) { @@ -789,11 +789,11 @@ void Group::DisbandGroup() { GroupUpdate_Struct* gu = (GroupUpdate_Struct*) outapp->pBuffer; gu->action = groupActDisband; - Client *Leader = NULL; + Client *Leader = nullptr; uint32 i; for (i = 0; i < MAX_GROUP_MEMBERS; i++) { - if (members[i] == NULL) { + if (members[i] == nullptr) { continue; } @@ -809,7 +809,7 @@ void Group::DisbandGroup() { } members[i]->SetGrouped(false); - members[i] = NULL; + members[i] = nullptr; membername[i][0] = '\0'; } @@ -857,14 +857,14 @@ void Group::SendUpdate(uint32 type, Mob* member) gu->leader_aas = LeaderAbilities; for (uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) - if((members[i] != NULL) && IsLeader(members[i])) + if((members[i] != nullptr) && IsLeader(members[i])) { strcpy(gu->leadersname, members[i]->GetName()); break; } for (uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) - if (members[i] != NULL && members[i] != member) + if (members[i] != nullptr && members[i] != member) strcpy(gu->membername[x++], members[i]->GetName()); member->CastToClient()->QueuePacket(outapp); @@ -949,7 +949,7 @@ void Group::TeleportGroup(Mob* sender, uint32 zoneID, uint16 instance_id, float uint32 i; for (i = 0; i < MAX_GROUP_MEMBERS; i++) { - if (members[i] != NULL && members[i]->IsClient() && members[i] != sender) + if (members[i] != nullptr && members[i]->IsClient() && members[i] != sender) { members[i]->CastToClient()->MovePC(zoneID, instance_id, x, y, z, heading, 0, ZoneSolicited); } @@ -973,7 +973,7 @@ bool Group::LearnMembers() { while((row = mysql_fetch_row(result))) { if(!row[0]) continue; - members[i] = NULL; + members[i] = nullptr; strn0cpy(membername[i], row[0], 64); i++; @@ -997,23 +997,23 @@ void Group::VerifyGroup() { #if EQDEBUG >= 7 LogFile->write(EQEMuLog::Debug, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); #endif - members[i] = NULL; + members[i] = nullptr; continue; } //it should be safe to use GetClientByName, but Group is trying //to be generic, so we'll go for general Mob Mob *them = entity_list.GetMob(membername[i]); - if(them == NULL && members[i] != NULL) { //they arnt here anymore.... + if(them == nullptr && members[i] != nullptr) { //they arnt here anymore.... #if EQDEBUG >= 6 LogFile->write(EQEMuLog::Debug, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); #endif membername[i][0] = '\0'; - members[i] = NULL; + members[i] = nullptr; continue; } - if(them != NULL && members[i] != them) { //our pointer is out of date... not so good. + if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good. #if EQDEBUG >= 5 LogFile->write(EQEMuLog::Debug, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); #endif @@ -1030,7 +1030,7 @@ LogFile->write(EQEMuLog::Debug, "Group %lu: Verify %d: Empty.\n", (unsigned long void Group::GroupMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance) { uint32 i; for (i = 0; i < MAX_GROUP_MEMBERS; i++) { - if(members[i] == NULL) + if(members[i] == nullptr) continue; if(members[i] == sender) @@ -1183,7 +1183,7 @@ void Group::MarkNPC(Mob* Target, int Number) if(i == (Number - 1)) return; - UpdateXTargetMarkedNPC(i+1, NULL); + UpdateXTargetMarkedNPC(i+1, nullptr); MarkedNPCs[i] = 0; AlreadyMarked = true; @@ -1199,7 +1199,7 @@ void Group::MarkNPC(Mob* Target, int Number) if(m) m->IsTargeted(-1); - UpdateXTargetMarkedNPC(Number, NULL); + UpdateXTargetMarkedNPC(Number, nullptr); } if(EntityID) @@ -1274,7 +1274,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle) if(updateDB) { char errbuff[MYSQL_ERRMSG_SIZE]; - char *Query = NULL; + char *Query = nullptr; if (!database.RunQuery(Query, MakeAnyLenString(&Query, "UPDATE group_leaders SET maintank='%s' WHERE gid=%i LIMIT 1", MainTankName.c_str(), GetID()), errbuff)) @@ -1323,7 +1323,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle) if(updateDB) { char errbuff[MYSQL_ERRMSG_SIZE]; - char *Query = NULL; + char *Query = nullptr; if (!database.RunQuery(Query, MakeAnyLenString(&Query, "UPDATE group_leaders SET assist='%s' WHERE gid=%i LIMIT 1", MainAssistName.c_str(), GetID()), errbuff)) @@ -1372,7 +1372,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle) if(updateDB) { char errbuff[MYSQL_ERRMSG_SIZE]; - char *Query = NULL; + char *Query = nullptr; if (!database.RunQuery(Query, MakeAnyLenString(&Query, "UPDATE group_leaders SET puller='%s' WHERE gid=%i LIMIT 1", PullerName.c_str(), GetID()), errbuff)) @@ -1539,8 +1539,8 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle) if(members[i] && members[i]->IsClient()) { NotifyMainTank(members[i]->CastToClient(), toggle); - members[i]->CastToClient()->UpdateXTargetType(GroupTank, NULL, ""); - members[i]->CastToClient()->UpdateXTargetType(GroupTankTarget, NULL); + members[i]->CastToClient()->UpdateXTargetType(GroupTank, nullptr, ""); + members[i]->CastToClient()->UpdateXTargetType(GroupTankTarget, nullptr); } } } @@ -1573,7 +1573,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle) if(members[i] && members[i]->IsClient()) { members[i]->CastToClient()->QueuePacket(outapp); - members[i]->CastToClient()->UpdateXTargetType(GroupAssist, NULL, ""); + members[i]->CastToClient()->UpdateXTargetType(GroupAssist, nullptr, ""); } safe_delete(outapp); @@ -1595,7 +1595,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle) if(members[i] && members[i]->IsClient()) { NotifyMainAssist(members[i]->CastToClient(), toggle); - members[i]->CastToClient()->UpdateXTargetType(GroupAssistTarget, NULL); + members[i]->CastToClient()->UpdateXTargetType(GroupAssistTarget, nullptr); } } } @@ -1625,8 +1625,8 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle) if(members[i] && members[i]->IsClient()) { NotifyPuller(members[i]->CastToClient(), toggle); - members[i]->CastToClient()->UpdateXTargetType(Puller, NULL, ""); - members[i]->CastToClient()->UpdateXTargetType(PullerTarget, NULL); + members[i]->CastToClient()->UpdateXTargetType(Puller, nullptr, ""); + members[i]->CastToClient()->UpdateXTargetType(PullerTarget, nullptr); } } } @@ -1895,7 +1895,7 @@ void Group::UnMarkNPC(uint16 ID) if(MarkedNPCs[i] == ID) { MarkedNPCs[i] = 0; - UpdateXTargetMarkedNPC(i + 1, NULL); + UpdateXTargetMarkedNPC(i + 1, nullptr); } } } diff --git a/zone/groups.h b/zone/groups.h index 51c54ce82..6fa0b4fb0 100644 --- a/zone/groups.h +++ b/zone/groups.h @@ -51,7 +51,7 @@ public: Group(uint32 gid); ~Group(); - bool AddMember(Mob* newmember, const char* NewMemberName = NULL, uint32 CharacterID = 0); + bool AddMember(Mob* newmember, const char* NewMemberName = nullptr, uint32 CharacterID = 0); void AddMember(const char* NewMemberName); void SendUpdate(uint32 type,Mob* member); void SendLeadershipAAUpdate(); @@ -69,7 +69,7 @@ public: void GroupMessage(Mob* sender,uint8 language,uint8 lang_skill,const char* message); void GroupMessage_StringID(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); uint32 GetTotalGroupDamage(Mob* other); - void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = NULL); + void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = nullptr); inline void SetLeader(Mob* newleader){ leader=newleader; }; inline Mob* GetLeader(){ return leader; }; char* GetLeaderName() { return membername[0]; }; diff --git a/zone/guild.cpp b/zone/guild.cpp index e83fea6e6..f2238e0ca 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -137,7 +137,7 @@ void Client::SendGuildList() { //ask the guild manager to build us a nice guild list packet outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size); - if(outapp->pBuffer == NULL) { + if(outapp->pBuffer == nullptr) { mlog(GUILDS__ERROR, "Unable to make guild list!"); return; } @@ -152,13 +152,13 @@ void Client::SendGuildList() { void Client::SendGuildMembers() { uint32 len; uint8 *data = guild_mgr.MakeGuildMembers(GuildID(), GetName(), len); - if(data == NULL) + if(data == nullptr) return; //invalid guild, shouldent happen. EQApplicationPacket* outapp = new EQApplicationPacket(OP_GuildMemberList); outapp->size = len; outapp->pBuffer = data; - data = NULL; + data = nullptr; mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildMemberList of length %d", outapp->size); mpkt(GUILDS__OUT_PACKET_TRACE, outapp); diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 597b25359..b040acdfc 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -26,49 +26,49 @@ /* CREATE TABLE guilds ( - id MEDIUMINT UNSIGNED NOT NULL, - name VARCHAR(32) NOT NULL, - leader int NOT NULL, - minstatus SMALLINT NOT NULL, - tribute INT UNSIGNED NOT NULL, - motd TEXT NOT NULL DEFAULT '', + id MEDIUMINT UNSIGNED NOT nullptr, + name VARCHAR(32) NOT nullptr, + leader int NOT nullptr, + minstatus SMALLINT NOT nullptr, + tribute INT UNSIGNED NOT nullptr, + motd TEXT NOT nullptr DEFAULT '', PRIMARY KEY(id), UNIQUE KEY(name), UNIQUE KEY(leader) ); CREATE TABLE guild_ranks ( - guild_id MEDIUMINT UNSIGNED NOT NULL, - rank TINYINT UNSIGNED NOT NULL, - title VARCHAR(128) NOT NULL, - can_hear TINYINT UNSIGNED NOT NULL, - can_speak TINYINT UNSIGNED NOT NULL, - can_invite TINYINT UNSIGNED NOT NULL, - can_remove TINYINT UNSIGNED NOT NULL, - can_promote TINYINT UNSIGNED NOT NULL, - can_demote TINYINT UNSIGNED NOT NULL, - can_motd TINYINT UNSIGNED NOT NULL, - can_warpeace TINYINT UNSIGNED NOT NULL, + guild_id MEDIUMINT UNSIGNED NOT nullptr, + rank TINYINT UNSIGNED NOT nullptr, + title VARCHAR(128) NOT nullptr, + can_hear TINYINT UNSIGNED NOT nullptr, + can_speak TINYINT UNSIGNED NOT nullptr, + can_invite TINYINT UNSIGNED NOT nullptr, + can_remove TINYINT UNSIGNED NOT nullptr, + can_promote TINYINT UNSIGNED NOT nullptr, + can_demote TINYINT UNSIGNED NOT nullptr, + can_motd TINYINT UNSIGNED NOT nullptr, + can_warpeace TINYINT UNSIGNED NOT nullptr, PRIMARY KEY(guild_id,rank) ); # guild1 < guild2 by definition. CREATE TABLE guild_relations ( - guild1 MEDIUMINT UNSIGNED NOT NULL, - guild2 MEDIUMINT UNSIGNED NOT NULL, - relation TINYINT NOT NULL, + guild1 MEDIUMINT UNSIGNED NOT nullptr, + guild2 MEDIUMINT UNSIGNED NOT nullptr, + relation TINYINT NOT nullptr, PRIMARY KEY(guild1, guild1) ); CREATE TABLE guild_members ( - char_id INT NOT NULL, - guild_id MEDIUMINT UNSIGNED NOT NULL, - rank TINYINT UNSIGNED NOT NULL, - tribute_enable TINYINT UNSIGNED NOT NULL DEFAULT 0, - total_tribute INT UNSIGNED NOT NULL DEFAULT 0, - last_tribute INT UNSIGNED NOT NULL DEFAULT 0, - banker TINYINT UNSIGNED NOT NULL DEFAULT 0, - public_note TEXT NOT NULL DEFAULT '', + char_id INT NOT nullptr, + guild_id MEDIUMINT UNSIGNED NOT nullptr, + rank TINYINT UNSIGNED NOT nullptr, + tribute_enable TINYINT UNSIGNED NOT nullptr DEFAULT 0, + total_tribute INT UNSIGNED NOT nullptr DEFAULT 0, + last_tribute INT UNSIGNED NOT nullptr DEFAULT 0, + banker TINYINT UNSIGNED NOT nullptr DEFAULT 0, + public_note TEXT NOT nullptr DEFAULT '', PRIMARY KEY(char_id) ); @@ -166,7 +166,7 @@ uint8 *ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char *prefix_na vector members; if(!GetEntireGuild(guild_id, members)) - return(NULL); + return(nullptr); //figure out the actual packet length. uint32 fixed_length = sizeof(Internal_GuildMembers_Struct) + members.size()*sizeof(Internal_GuildMemberEntry_Struct); @@ -357,14 +357,14 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { Client *c = entity_list.GetClientByCharID(s->char_id); - if(c != NULL) { + if(c != nullptr) { //this reloads the char's guild info from the database and sends appearance updates c->RefreshGuildInfo(); } //it would be nice if we had the packet to send just a one-person update if(s->guild_id == GUILD_NONE) { - if(c != NULL) + if(c != nullptr) c->SendGuildMembers(); //only need to update this player's list (trying to clear it) } else { entity_list.SendGuildMembers(s->guild_id); //even send GUILD_NONE (empty) @@ -372,7 +372,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { if(s->old_guild_id != 0 && s->old_guild_id != GUILD_NONE && s->old_guild_id != s->guild_id) entity_list.SendGuildMembers(s->old_guild_id); - else if(c != NULL && s->guild_id != GUILD_NONE) { + else if(c != nullptr && s->guild_id != GUILD_NONE) { //char is in zone, and has changed into a new guild, send MOTD. c->SendGuildMOTD(); } @@ -403,7 +403,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { strn0cpy(gsrs->MemberName, sgrus->MemberName, sizeof(gsrs->MemberName)); gsrs->Banker = sgrus->Banker; - entity_list.QueueClientsGuild(NULL, outapp, false, sgrus->GuildID); + entity_list.QueueClientsGuild(nullptr, outapp, false, sgrus->GuildID); safe_delete(outapp); } @@ -449,7 +449,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { gmus->InstanceID = 0; // I don't think we care what Instance they are in, for the Guild Management Window. gmus->LastSeen = sgmus->LastSeen; - entity_list.QueueClientsGuild(NULL, outapp, false, sgmus->GuildID); + entity_list.QueueClientsGuild(nullptr, outapp, false, sgmus->GuildID); safe_delete(outapp); } @@ -473,7 +473,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct)); GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer; char Name[64]; - gmus->LastSeen = time(NULL); + gmus->LastSeen = time(nullptr); gmus->InstanceID = 0; gmus->GuildID = c->GuildID(); for (int i=0;iToggle = Toggle; gts->TimePosted = TimePosted; gts->Name[0] = 0; - entity_list.QueueClientsGuild(NULL, outapp, false, GuildID); + entity_list.QueueClientsGuild(nullptr, outapp, false, GuildID); safe_delete(outapp); break; } @@ -850,7 +850,7 @@ bool GuildBankManager::IsAreaFull(uint32 GuildID, uint16 Area) if(Iterator == Banks.end()) return true; - GuildBankItem* BankArea = NULL; + GuildBankItem* BankArea = nullptr; int AreaSize = 0; @@ -885,7 +885,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 return false; } - GuildBankItem* BankArea = NULL; + GuildBankItem* BankArea = nullptr; int AreaSize = 0; @@ -1131,21 +1131,21 @@ ItemInst* GuildBankManager::GetItem(uint32 GuildID, uint16 Area, uint16 SlotID, std::list::iterator Iterator = GetGuildBank(GuildID); if(Iterator == Banks.end()) - return NULL; + return nullptr; - GuildBankItem* BankArea = NULL; + GuildBankItem* BankArea = nullptr; - ItemInst* inst = NULL; + ItemInst* inst = nullptr; if(Area == GuildBankDepositArea) { if((SlotID > (GUILD_BANK_DEPOSIT_AREA_SIZE - 1))) - return NULL; + return nullptr; inst = database.CreateItem((*Iterator)->Items.DepositArea[SlotID].ItemID); if(!inst) - return NULL; + return nullptr; BankArea = &(*Iterator)->Items.DepositArea[0]; } @@ -1153,12 +1153,12 @@ ItemInst* GuildBankManager::GetItem(uint32 GuildID, uint16 Area, uint16 SlotID, { if((SlotID > (GUILD_BANK_MAIN_AREA_SIZE - 1))) - return NULL; + return nullptr; inst = database.CreateItem((*Iterator)->Items.MainArea[SlotID].ItemID); if(!inst) - return NULL; + return nullptr; BankArea = &(*Iterator)->Items.MainArea[0]; } @@ -1220,7 +1220,7 @@ bool GuildBankManager::DeleteItem(uint32 GuildID, uint16 Area, uint16 SlotID, ui char* query = 0; - GuildBankItem* BankArea = NULL; + GuildBankItem* BankArea = nullptr; if(Area == GuildBankMainArea) { diff --git a/zone/hate_list.cpp b/zone/hate_list.cpp index 25a0bc197..cce98d18f 100644 --- a/zone/hate_list.cpp +++ b/zone/hate_list.cpp @@ -33,7 +33,7 @@ extern Zone *zone; HateList::HateList() { - owner = NULL; + owner = nullptr; } HateList::~HateList() @@ -88,7 +88,7 @@ tHateEntry *HateList::Find(Mob *ent) return iterator.GetData(); iterator.Advance(); } - return NULL; + return nullptr; } void HateList::Set(Mob* other, uint32 in_hate, uint32 in_dam) @@ -106,17 +106,17 @@ void HateList::Set(Mob* other, uint32 in_hate, uint32 in_dam) Mob* HateList::GetDamageTop(Mob* hater) { _ZP(HateList_GetDamageTop); - Mob* current = NULL; - Group* grp = NULL; - Raid* r = NULL; + Mob* current = nullptr; + Group* grp = nullptr; + Raid* r = nullptr; uint32 dmg_amt = 0; LinkedListIterator iterator(list); iterator.Reset(); while(iterator.MoreElements()) { - grp = NULL; - r = NULL; + grp = nullptr; + r = nullptr; if(iterator.GetData()->ent && iterator.GetData()->ent->IsClient()){ r = entity_list.GetRaidByClient(iterator.GetData()->ent->CastToClient()); @@ -131,7 +131,7 @@ Mob* HateList::GetDamageTop(Mob* hater) dmg_amt = r->GetTotalRaidDamage(hater); } } - else if (iterator.GetData()->ent != NULL && grp != NULL) + else if (iterator.GetData()->ent != nullptr && grp != nullptr) { if (grp->GetTotalGroupDamage(hater) >= dmg_amt) { @@ -139,7 +139,7 @@ Mob* HateList::GetDamageTop(Mob* hater) dmg_amt = grp->GetTotalGroupDamage(hater); } } - else if (iterator.GetData()->ent != NULL && (uint32)iterator.GetData()->damage >= dmg_amt) + else if (iterator.GetData()->ent != nullptr && (uint32)iterator.GetData()->damage >= dmg_amt) { current = iterator.GetData()->ent; dmg_amt = iterator.GetData()->damage; @@ -151,7 +151,7 @@ Mob* HateList::GetDamageTop(Mob* hater) Mob* HateList::GetClosest(Mob *hater) { _ZP(HateList_GetClosest); - Mob* close = NULL; + Mob* close = nullptr; float closedist = 99999.9f; float thisdist; @@ -159,7 +159,7 @@ Mob* HateList::GetClosest(Mob *hater) { iterator.Reset(); while(iterator.MoreElements()) { thisdist = iterator.GetData()->ent->DistNoRootNoZ(*hater); - if(iterator.GetData()->ent != NULL && thisdist <= closedist) { + if(iterator.GetData()->ent != nullptr && thisdist <= closedist) { closedist = thisdist; close = iterator.GetData()->ent; } @@ -243,7 +243,7 @@ void HateList::DoFactionHits(int32 nfl_id) { if (iterator.GetData()->ent && iterator.GetData()->ent->IsClient()) p = iterator.GetData()->ent->CastToClient(); else - p = NULL; + p = nullptr; if (p) p->SetFactionLevel(p->CharacterID(), nfl_id, p->GetBaseClass(), p->GetBaseRace(), p->GetDeity()); @@ -254,11 +254,11 @@ void HateList::DoFactionHits(int32 nfl_id) { Mob *HateList::GetTop(Mob *center) { _ZP(HateList_GetTop); - Mob* top = NULL; + Mob* top = nullptr; int32 hate = -1; if (RuleB(Aggro,SmartAggroList)){ - Mob* topClientTypeInRange = NULL; + Mob* topClientTypeInRange = nullptr; int32 hateClientTypeInRange = -1; int skipped_count = 0; @@ -351,7 +351,7 @@ Mob *HateList::GetTop(Mob *center) iterator.Advance(); } - if(topClientTypeInRange != NULL && top != NULL) { + if(topClientTypeInRange != nullptr && top != nullptr) { bool isTopClientType = top->IsClient(); #ifdef BOTS if(!isTopClientType) { @@ -375,7 +375,7 @@ Mob *HateList::GetTop(Mob *center) return top; } else { - if(top == NULL && skipped_count > 0) { + if(top == nullptr && skipped_count > 0) { return center->GetTarget(); } return top; @@ -396,14 +396,14 @@ Mob *HateList::GetTop(Mob *center) } } - if(cur->ent != NULL && ((cur->hate > hate) || cur->bFrenzy )) + if(cur->ent != nullptr && ((cur->hate > hate) || cur->bFrenzy )) { top = cur->ent; hate = cur->hate; } iterator.Advance(); } - if(top == NULL && skipped_count > 0) { + if(top == nullptr && skipped_count > 0) { return center->GetTarget(); } return top; @@ -413,7 +413,7 @@ Mob *HateList::GetTop(Mob *center) Mob *HateList::GetMostHate(){ _ZP(HateList_GetMostHate); - Mob* top = NULL; + Mob* top = nullptr; int32 hate = -1; LinkedListIterator iterator(list); @@ -421,7 +421,7 @@ Mob *HateList::GetMostHate(){ while(iterator.MoreElements()) { tHateEntry *cur = iterator.GetData(); - if(cur->ent != NULL && (cur->hate > hate)) + if(cur->ent != nullptr && (cur->hate > hate)) { top = cur->ent; hate = cur->hate; @@ -443,7 +443,7 @@ Mob *HateList::GetRandom() count++; } if(!count) - return NULL; + return nullptr; int random = MakeRandomInt(0, count-1); iterator.Reset(); diff --git a/zone/hate_list.h b/zone/hate_list.h index 3334632e4..07c2dd16a 100644 --- a/zone/hate_list.h +++ b/zone/hate_list.h @@ -49,9 +49,9 @@ public: Mob *GetTop(Mob *center); // gets any on the list Mob *GetRandom(); - // get closest mob or NULL if list empty + // get closest mob or nullptr if list empty Mob *GetClosest(Mob *hater); - // gets top mob or NULL if hate list empty + // gets top mob or nullptr if hate list empty Mob *GetDamageTop(Mob *hater); // used to check if mob is on hatelist bool IsOnHateList(Mob *); diff --git a/zone/horse.cpp b/zone/horse.cpp index 79e2bb881..3ccf30525 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -31,7 +31,7 @@ map Horse::horse_types; LinkedList horses_auto_delete; Horse::Horse(Client *_owner, uint16 spell_id, float x, float y, float z, float heading) - : NPC(GetHorseType(spell_id), NULL, x, y, z, heading, FlyMode3) + : NPC(GetHorseType(spell_id), nullptr, x, y, z, heading, FlyMode3) { //give the horse its proper name. strn0cpy(name, _owner->GetCleanName(), 55); @@ -55,13 +55,13 @@ bool Horse::IsHorseSpell(uint16 spell_id) { //than we need to to figure out if this is a horse spell. //the logic is that people calling this function will post //likely immediately summon the horse, so we need the extra anyways. - return(GetHorseType(spell_id) != NULL); + return(GetHorseType(spell_id) != nullptr); } const NPCType *Horse::GetHorseType(uint16 spell_id) { if(horse_types.count(spell_id) == 1) return(horse_types[spell_id]); - //cache invalid spell IDs as NULL entries + //cache invalid spell IDs as nullptr entries const NPCType *ret; horse_types[spell_id] = ret = BuildHorseType(spell_id); return(ret); @@ -124,12 +124,12 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { safe_delete_array(query); } mysql_free_result(result); - return NULL; + return nullptr; } else { LogFile->write(EQEMuLog::Error, "Error in Mount query '%s': %s", query, errbuf); safe_delete_array(query); - return NULL; + return nullptr; } } @@ -183,7 +183,7 @@ void Client::SetHorseId(uint16 horseid_in) { //if we have a horse, get rid of it no matter what. if(horseId) { Mob *horse = entity_list.GetMob(horseId); - if(horse != NULL) + if(horse != nullptr) horse->Depop(); } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index acfcab8ed..cbf9503ba 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -38,7 +38,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) { if (itemnum == 0) return 0; uint32 x = 0; - ItemInst *cur = NULL; + ItemInst *cur = nullptr; int i; if(where_to_check & invWhereWorn) { @@ -201,7 +201,7 @@ bool Client::CheckLoreConflict(const Item_Struct* item) { void Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, uint16 to_slot) { const Item_Struct* item = database.GetItem(item_id); - if (item == NULL) { + if (item == nullptr) { Message(0, "No such item: %i", item_id); return; } else { @@ -340,7 +340,7 @@ void Client::DropItem(int16 slot_id) list::const_iterator s=m_inv.cursor_begin(),e=m_inv.cursor_end(); database.SaveCursor(CharacterID(), s, e); } else - database.SaveInventory(CharacterID(), NULL, slot_id); + database.SaveInventory(CharacterID(), nullptr, slot_id); // Package as zone object Object* object = new Object(this, inst); @@ -467,7 +467,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd bool isDeleted = m_inv.DeleteItem(slot_id, quantity); - const ItemInst* inst=NULL; + const ItemInst* inst=nullptr; if (slot_id==SLOT_CURSOR) { list::const_iterator s=m_inv.cursor_begin(),e=m_inv.cursor_end(); if(update_db) @@ -569,7 +569,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI // solar: our bag went into slot_id, now let's pack the contents in for(int i = 0; i < 10; i++) { - if(bag_item_data[i] == NULL) + if(bag_item_data[i] == nullptr) continue; const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug1, bag_item_data[i]->aug2, bag_item_data[i]->aug3, bag_item_data[i]->aug4, bag_item_data[i]->aug5); interior_slot = Inventory::CalcSlotId(slot_id, i); @@ -1032,7 +1032,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if(!banker || distance > USE_NPC_RANGE2) { - char *hacked_string = NULL; + char *hacked_string = nullptr; MakeAnyLenString(&hacked_string, "Player tried to make use of a banker(items) but %s is non-existant or too far away (%u units).", banker ? banker->GetName() : "UNKNOWN NPC", distance); database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName()); @@ -1142,7 +1142,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } // Step 3: Check for interaction with World Container (tradeskills) - if(m_tradeskill_object != NULL) { + if(m_tradeskill_object != nullptr) { if (src_slot_id>=4000 && src_slot_id<=4009) { // Picking up item from world container ItemInst* inst = m_tradeskill_object->PopItem(Inventory::CalcBagIdx(src_slot_id)); @@ -1161,7 +1161,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { ItemInst* world_inst = m_tradeskill_object->PopItem(world_idx); // Case 1: No item in container, unidirectional "Put" - if (world_inst == NULL) { + if (world_inst == nullptr) { m_tradeskill_object->PutItem(world_idx, src_inst); m_inv.DeleteItem(src_slot_id); } @@ -1277,7 +1277,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (src_inst->GetCharges() < 1) { mlog(INVENTORY__SLOTS, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); - database.SaveInventory(CharacterID(),NULL,src_slot_id); + database.SaveInventory(CharacterID(),nullptr,src_slot_id); m_inv.DeleteItem(src_slot_id); } else { mlog(INVENTORY__SLOTS, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); @@ -1748,7 +1748,7 @@ void Client::RemoveDuplicateLore(bool client_update) { if(inst) { if(CheckLoreConflict(inst->GetItem())) { mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); - database.SaveInventory(character_id, NULL, slot_id); + database.SaveInventory(character_id, nullptr, slot_id); } else { m_inv.PutItem(slot_id, *inst); @@ -1762,7 +1762,7 @@ void Client::RemoveDuplicateLore(bool client_update) { if(inst) { if(CheckLoreConflict(inst->GetItem())) { mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); - database.SaveInventory(character_id, NULL, 9999); + database.SaveInventory(character_id, nullptr, 9999); } else { m_inv.PutItem(9999, *inst); @@ -1776,7 +1776,7 @@ void Client::RemoveDuplicateLore(bool client_update) { if(inst) { if(CheckLoreConflict(inst->GetItem())) { mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); - database.SaveInventory(character_id, NULL, slot_id); + database.SaveInventory(character_id, nullptr, slot_id); } else { m_inv.PutItem(slot_id, *inst); @@ -1791,7 +1791,7 @@ void Client::RemoveDuplicateLore(bool client_update) { if(inst) { if(CheckLoreConflict(inst->GetItem())) { mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); - database.SaveInventory(character_id, NULL, slot_id); + database.SaveInventory(character_id, nullptr, slot_id); } else { m_inv.PutItem(slot_id, *inst); @@ -1806,7 +1806,7 @@ void Client::RemoveDuplicateLore(bool client_update) { if(inst) { if(CheckLoreConflict(inst->GetItem())) { mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); - database.SaveInventory(character_id, NULL, slot_id); + database.SaveInventory(character_id, nullptr, slot_id); } else { m_inv.PutItem(slot_id, *inst); @@ -1830,7 +1830,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); mlog(INVENTORY__ERROR, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, client_update); - database.SaveInventory(character_id, NULL, slot_id); + database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); } } @@ -1843,7 +1843,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); mlog(INVENTORY__ERROR, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= EQClientSoF) ? client_update : false); - database.SaveInventory(character_id, NULL, slot_id); + database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); } @@ -1967,8 +1967,8 @@ void Client::SendItemPacket(int16 slot_id, const ItemInst* inst, ItemPacketType string packet = inst->Serialize(slot_id); EmuOpcode opcode = OP_Unknown; - EQApplicationPacket* outapp = NULL; - ItemPacket_Struct* itempacket = NULL; + EQApplicationPacket* outapp = nullptr; + ItemPacket_Struct* itempacket = nullptr; // Construct packet opcode = (packet_type==ItemPacketViewLink) ? OP_ItemLinkResponse : OP_ItemPacket; @@ -1992,8 +1992,8 @@ EQApplicationPacket* Client::ReturnItemPacket(int16 slot_id, const ItemInst* ins string packet = inst->Serialize(slot_id); EmuOpcode opcode = OP_Unknown; - EQApplicationPacket* outapp = NULL; - BulkItemPacket_Struct* itempacket = NULL; + EQApplicationPacket* outapp = nullptr; + BulkItemPacket_Struct* itempacket = nullptr; // Construct packet opcode = OP_ItemPacket; diff --git a/zone/loottables.cpp b/zone/loottables.cpp index 75e442afc..67115ee6a 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -176,7 +176,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml //if itemlist is null, just send wear changes void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange) { - if(item2 == NULL) + if(item2 == nullptr) return; //make sure we are doing something... @@ -188,8 +188,8 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge LogFile->write(EQEMuLog::Debug, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); #endif - EQApplicationPacket* outapp = NULL; - WearChange_Struct* wc = NULL; + EQApplicationPacket* outapp = nullptr; + WearChange_Struct* wc = nullptr; if(wearchange) { outapp = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct)); wc = (WearChange_Struct*)outapp->pBuffer; @@ -209,7 +209,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge if (equipit) { uint8 eslot = 0xFF; char newid[20]; - const Item_Struct* compitem = NULL; + const Item_Struct* compitem = nullptr; bool found = false; // track if we found an empty slot we fit into int32 foundslot = -1; // for multi-slot items @@ -285,7 +285,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge eslot = MATERIAL_PRIMARY; } else if (foundslot == SLOT_SECONDARY - && (GetOwner() != NULL || (GetLevel() >= 13 && MakeRandomInt(0,99) < NPC_DW_CHANCE) || (item2->Damage==0)) && + && (GetOwner() != nullptr || (GetLevel() >= 13 && MakeRandomInt(0,99) < NPC_DW_CHANCE) || (item2->Damage==0)) && (item2->ItemType == ItemType1HS || item2->ItemType == ItemType1HB || item2->ItemType == ItemTypeShield || item2->ItemType == ItemTypePierce)) { @@ -346,7 +346,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge item->equipSlot = item2->Slots; } - if(itemlist != NULL) + if(itemlist != nullptr) itemlist->push_back(item); else safe_delete(item); @@ -365,7 +365,7 @@ void NPC::AddItem(const Item_Struct* item, uint16 charges, bool equipitem) { void NPC::AddItem(uint32 itemid, uint16 charges, bool equipitem) { //slot isnt needed, its determined from the item. const Item_Struct * i = database.GetItem(itemid); - if(i == NULL) + if(i == nullptr) return; AddLootDrop(i, &itemlist, charges, 1, 127, equipitem, equipitem); } diff --git a/zone/map.h b/zone/map.h index 93abb051a..31f2c8928 100644 --- a/zone/map.h +++ b/zone/map.h @@ -100,7 +100,7 @@ typedef struct _nodeHeader { uint8 flags; union { - uint16 nodes[4]; //index 0 means NULL, not root + uint16 nodes[4]; //index 0 means nullptr, not root struct { uint32 count; uint32 offset; @@ -125,7 +125,7 @@ typedef uint16 NodeRef; class Map { public: - static Map* LoadMapfile(const char* in_zonename, const char *directory = NULL); + static Map* LoadMapfile(const char* in_zonename, const char *directory = nullptr); Map(); ~Map(); @@ -142,10 +142,10 @@ public: bool LocWithinNode( NodeRef _node, float x, float y ) const; //nodes to these functions must be final - bool LineIntersectsNode( NodeRef _node, VERTEX start, VERTEX end, VERTEX *result, FACE **on = NULL) const; + bool LineIntersectsNode( NodeRef _node, VERTEX start, VERTEX end, VERTEX *result, FACE **on = nullptr) const; bool LineIntersectsFace( PFACE cface, VERTEX start, VERTEX end, VERTEX *result) const; - float FindBestZ( NodeRef _node, VERTEX start, VERTEX *result, FACE **on = NULL) const; - bool LineIntersectsZone(VERTEX start, VERTEX end, float step, VERTEX *result, FACE **on = NULL) const; + float FindBestZ( NodeRef _node, VERTEX start, VERTEX *result, FACE **on = nullptr) const; + bool LineIntersectsZone(VERTEX start, VERTEX end, float step, VERTEX *result, FACE **on = nullptr) const; // inline unsigned int GetVertexNumber( ) {return m_Vertex; } inline uint32 GetFacesNumber( ) const { return m_Faces; } diff --git a/zone/merc.cpp b/zone/merc.cpp index 04df278a3..6f7c8142f 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1521,7 +1521,7 @@ void Merc::AI_Process() { if(DivineAura()) return; - int hateCount = entity_list.GetHatedCount(this, NULL); + int hateCount = entity_list.GetHatedCount(this, nullptr); if(GetHatedCount() < hateCount) { SetHatedCount(hateCount); @@ -2126,7 +2126,7 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) { switch (iSpellTypes) { case SpellType_Heal: { - Mob* tar = NULL; + Mob* tar = nullptr; int8 numToHeal = g->GetNumberNeedingHealedInGroup(IsEngaged() ? 75 : 95, true); int8 checkHPR = IsEngaged() ? 95 : 99; int8 checkPetHPR = IsEngaged() ? 95 : 99; @@ -2440,7 +2440,7 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) { break; } case SpellType_Cure: { - Mob* tar = NULL; + Mob* tar = nullptr; for(int i = 0; i < MAX_GROUP_MEMBERS; i++) { if(g->members[i] && !g->members[i]->qglobal) { if(GetNeedsCured(g->members[i]) && (g->members[i]->DontCureMeBefore() < Timer::GetCurrentTime())) { @@ -2679,7 +2679,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { //item focus for(int x =0; x < MAX_WORN_INVENTORY; ++x) { - TempItem = NULL; + TempItem = nullptr; if (equipment[x] == 0) continue; TempItem = database.GetItem(equipment[x]); @@ -4420,7 +4420,7 @@ bool Merc::CheckAETaunt() { } Corpse* Merc::GetGroupMemberCorpse() { - Corpse* corpse = NULL; + Corpse* corpse = nullptr; if(HasGroup()) { Group* g = GetGroup(); @@ -4652,7 +4652,7 @@ float Merc::GetMaxMeleeRangeToTarget(Mob* target) { } void Merc::DoClassAttacks(Mob *target) { - if(target == NULL) + if(target == nullptr) return; //gotta have a target for all these bool ca_time = classattack_timer.Check(false); @@ -4691,7 +4691,7 @@ void Merc::DoClassAttacks(Mob *target) { DoAnim(animKick); int32 dmg = 0; - if(GetWeaponDamage(target, (const Item_Struct*)NULL) <= 0){ + if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ dmg = -5; } else{ @@ -4713,7 +4713,7 @@ void Merc::DoClassAttacks(Mob *target) { DoAnim(animTailRake); int32 dmg = 0; - if(GetWeaponDamage(target, (const Item_Struct*)NULL) <= 0){ + if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ dmg = -5; } else{ @@ -4743,7 +4743,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo _ZP(Client_Attack); if (!other) { - SetTarget(NULL); + SetTarget(nullptr); LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); return false; } @@ -4798,7 +4798,7 @@ void Merc::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_sk Save(); Mob *give_exp = hate_list.GetDamageTop(this); - Client *give_exp_client = NULL; + Client *give_exp_client = nullptr; if(give_exp && give_exp->IsClient()) give_exp_client = give_exp->CastToClient(); @@ -4817,7 +4817,7 @@ void Merc::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_sk // br->SplitExp((EXP_FORMULA), this); // if(br->GetBotMainTarget() == this) - // br->SetBotMainTarget(NULL); + // br->SetBotMainTarget(nullptr); // /* Send the EVENT_KILLED_MERIT event for all raid members */ // if(br->BotRaidGroups[0]) { @@ -5048,7 +5048,7 @@ Merc* Merc::LoadMerc(Client *c, MercTemplate* merc_template, uint32 merchant_id, //get mercenary data if(merc_template) { const NPCType* npc_type_to_copy = database.GetMercType(merc_template->MercNPCID, merc_template->RaceID, c->GetLevel()); //TODO: Maybe add a way of updating client merc stats in a seperate function? like, for example, on leveling up. - if(npc_type_to_copy != NULL) + if(npc_type_to_copy != nullptr) { NPCType* npc_type = new NPCType; //This is actually a very terrible method of assigning stats, and should be changed at some point. See the comment in merc's deconstructor. memset(npc_type, 0, sizeof(NPCType)); @@ -5458,7 +5458,7 @@ bool Client::CheckCanDismissMerc() { void Client::CheckMercSuspendTimer() { if(GetMercInfo().SuspendedTime != 0) { - if(time(NULL) >= GetMercInfo().SuspendedTime){ + if(time(nullptr) >= GetMercInfo().SuspendedTime){ SendMercSuspendResponsePacket(0); } } @@ -5539,7 +5539,7 @@ void Client::SpawnMercOnZone() SendMercPersonalInfo(); if(GetMercInfo().SuspendedTime != 0) { - if(time(NULL) >= GetMercInfo().SuspendedTime){ + if(time(nullptr) >= GetMercInfo().SuspendedTime){ GetMercInfo().SuspendedTime = 0; } } @@ -5571,7 +5571,7 @@ bool Merc::Suspend() { SetSuspended(true); mercOwner->GetMercInfo().IsSuspended = true; - mercOwner->GetMercInfo().SuspendedTime = time(NULL) + RuleI(Mercs, SuspendIntervalS); + mercOwner->GetMercInfo().SuspendedTime = time(nullptr) + RuleI(Mercs, SuspendIntervalS); mercOwner->GetMercInfo().MercTimerRemaining = mercOwner->GetMercTimer()->GetRemainingTime(); mercOwner->GetMercInfo().Stance = GetStance(); Save(); @@ -5622,7 +5622,7 @@ bool Merc::Unsuspend(bool setMaxStats) { if(!g) { delete g; - g = NULL; + g = nullptr; return false; } @@ -5630,7 +5630,7 @@ bool Merc::Unsuspend(bool setMaxStats) { if(g->GetID() == 0) { delete g; - g = NULL; + g = nullptr; return false; } @@ -5770,7 +5770,7 @@ bool Merc::AddMercToGroup(Merc* merc, Group* group) { Merc::RemoveMercFromGroup(merc, merc->GetGroup()); } //Try and add the member, followed by checking if the merc owner exists. - if(group->AddMember(merc) && merc->GetMercOwner() != NULL) { + if(group->AddMember(merc) && merc->GetMercOwner() != nullptr) { merc->SetFollowID(merc->GetMercOwner()->GetID()); Result = true; } @@ -5791,17 +5791,17 @@ void Client::InitializeMercInfo() { Merc* Client::GetMerc() { if(GetMercID() == 0) - return(NULL); + return(nullptr); Merc* tmp = entity_list.GetMercByID(GetMercID()); - if(tmp == NULL) { + if(tmp == nullptr) { SetMercID(0); - return(NULL); + return(nullptr); } if(tmp->GetOwnerID() != GetID()) { SetMercID(0); - return(NULL); + return(nullptr); } return(tmp); @@ -5843,7 +5843,7 @@ void Client::SetMerc(Merc* newmerc) { SetMercID(0); GetMercInfo().mercid = 0; GetMercInfo().MercTemplateID = 0; - GetMercInfo().myTemplate = NULL; + GetMercInfo().myTemplate = nullptr; GetMercInfo().IsSuspended = false; GetMercInfo().SuspendedTime = 0; GetMercInfo().Gender = 0; diff --git a/zone/mob.cpp b/zone/mob.cpp index b7b89d925..87c302023 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -122,7 +122,7 @@ Mob::Mob(const char* in_name, rewind_z = 0; //Stored z_pos for /rewind move_tic_count = 0; - _egnode = NULL; + _egnode = nullptr; adverrorinfo = 0; name[0]=0; orig_name[0]=0; @@ -196,7 +196,7 @@ Mob::Mob(const char* in_name, ExtraHaste = 0; bEnraged = false; - shield_target = NULL; + shield_target = nullptr; cur_mana = 0; max_mana = 0; hp_regen = in_hp_regen; @@ -961,7 +961,7 @@ void Mob::CreateHPPacket(EQApplicationPacket* app) snprintf(buf, 9, "%i", GetNextHPEvent()); buf[9] = '\0'; SetNextHPEvent(-1); - parse->EventNPC(EVENT_HP, CastToNPC(), NULL, buf, 0); + parse->EventNPC(EVENT_HP, CastToNPC(), nullptr, buf, 0); } } @@ -973,7 +973,7 @@ void Mob::CreateHPPacket(EQApplicationPacket* app) snprintf(buf, 9, "%i", GetNextIncHPEvent()); buf[9] = '\0'; SetNextIncHPEvent(-1); - parse->EventNPC(EVENT_HP, CastToNPC(), NULL, buf, 1); + parse->EventNPC(EVENT_HP, CastToNPC(), nullptr, buf, 1); } } } @@ -1117,7 +1117,7 @@ void Mob::SendPosUpdate(uint8 iSendToSelf) { } else { - entity_list.QueueCloseClients(this, app, (iSendToSelf==0), 800, NULL, false); + entity_list.QueueCloseClients(this, app, (iSendToSelf==0), 800, nullptr, false); move_tic_count++; } #endif @@ -1507,7 +1507,7 @@ void Mob::SendAppearancePacket(uint32 type, uint32 value, bool WholeZone, bool i appearance->parameter = value; if (WholeZone) entity_list.QueueClients(this, outapp, iIgnoreSelf); - else if(specific_target != NULL) + else if(specific_target != nullptr) specific_target->QueuePacket(outapp, false, Client::CLIENT_CONNECTED); else if (this->IsClient()) this->CastToClient()->QueuePacket(outapp, false, Client::CLIENT_CONNECTED); @@ -1555,7 +1555,7 @@ void Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 la->value4b = 1; la->value5a = 1; la->value5b = 1; - if(specific_target == NULL) { + if(specific_target == nullptr) { entity_list.QueueClients(this,outapp); } else if (specific_target->IsClient()) { @@ -1570,7 +1570,7 @@ void Mob::SendTargetable(bool on, Client *specific_target) { ut->id = GetID(); ut->targetable_flag = on == true ? 1 : 0; - if(specific_target == NULL) { + if(specific_target == nullptr) { entity_list.QueueClients(this, outapp); } else if (specific_target->IsClient()) { @@ -1858,8 +1858,8 @@ void Mob::SetAttackTimer() { //an invalid weapon equipped: attack_timer.SetAtTrigger(4000, true); - Timer* TimerToUse = NULL; - const Item_Struct* PrimaryWeapon = NULL; + Timer* TimerToUse = nullptr; + const Item_Struct* PrimaryWeapon = nullptr; for (int i=SLOT_RANGE; i<=SLOT_SECONDARY; i++) { @@ -1873,7 +1873,7 @@ void Mob::SetAttackTimer() { else //invalid slot (hands will always hit this) continue; - const Item_Struct* ItemToUse = NULL; + const Item_Struct* ItemToUse = nullptr; //find our item if (IsClient()) { @@ -1885,13 +1885,13 @@ void Mob::SetAttackTimer() { //The code before here was fundementally flawed because equipment[] //isn't the same as PC inventory and also: //NPCs don't use weapon speed to dictate how fast they hit anyway. - ItemToUse = NULL; + ItemToUse = nullptr; } //special offhand stuff if(i == SLOT_SECONDARY) { //if we have a 2H weapon in our main hand, no dual - if(PrimaryWeapon != NULL) { + if(PrimaryWeapon != nullptr) { if( PrimaryWeapon->ItemClass == ItemClassCommon && (PrimaryWeapon->ItemType == ItemType2HS || PrimaryWeapon->ItemType == ItemType2HB @@ -1918,18 +1918,18 @@ void Mob::SetAttackTimer() { } //see if we have a valid weapon - if(ItemToUse != NULL) { + if(ItemToUse != nullptr) { //check type and damage/delay if(ItemToUse->ItemClass != ItemClassCommon || ItemToUse->Damage == 0 || ItemToUse->Delay == 0) { //no weapon - ItemToUse = NULL; + ItemToUse = nullptr; } // Check to see if skill is valid else if((ItemToUse->ItemType > ItemTypeThrowing) && (ItemToUse->ItemType != ItemTypeHand2Hand) && (ItemToUse->ItemType != ItemType2HPierce)) { //no weapon - ItemToUse = NULL; + ItemToUse = nullptr; } } @@ -1938,7 +1938,7 @@ void Mob::SetAttackTimer() { DelayMod = -99; //if we have no weapon.. - if (ItemToUse == NULL) { + if (ItemToUse == nullptr) { //above checks ensure ranged weapons do not fall into here // Work out if we're a monk if ((GetClass() == MONK) || (GetClass() == BEASTLORD)) { @@ -2258,7 +2258,7 @@ bool Mob::HateSummon() { // check if mob has ability to summon // 97% is the offical % that summoning starts on live, not 94 // if the mob can summon and is charmed, it can only summon mobs it has LoS to - Mob* mob_owner = NULL; + Mob* mob_owner = nullptr; if(GetOwnerID()) mob_owner = entity_list.GetMob(GetOwnerID()); @@ -2819,7 +2819,7 @@ void Mob::SetTarget(Mob* mob) { if(IsNPC()) parse->EventNPC(EVENT_TARGET_CHANGE, CastToNPC(), mob, "", 0); //parse->Event(EVENT_TARGET_CHANGE, this->GetNPCTypeID(), 0, this->CastToNPC(), mob); else if (IsClient()) - parse->EventPlayer(EVENT_TARGET_CHANGE, CastToClient(), "", 0); //parse->Event(EVENT_TARGET_CHANGE, 0, "", (NPC*)NULL, this->CastToClient()); + parse->EventPlayer(EVENT_TARGET_CHANGE, CastToClient(), "", 0); //parse->Event(EVENT_TARGET_CHANGE, 0, "", (NPC*)nullptr, this->CastToClient()); if(IsPet() && GetOwner() && GetOwner()->IsClient()) GetOwner()->CastToClient()->UpdateXTargetType(MyPetTarget, mob); @@ -2959,7 +2959,7 @@ const char* Mob::GetEntityVariable(const char *id) { return iter->second.c_str(); } - return NULL; + return nullptr; } bool Mob::EntityVariableExists(const char *id) @@ -3059,7 +3059,7 @@ void Mob::TriggerOnCast(uint32 focus_spell, uint32 spell_id, bool aa_trigger) void Mob::TrySpellTrigger(Mob *target, uint32 spell_id) { - if(target == NULL || !IsValidSpell(spell_id)) + if(target == nullptr || !IsValidSpell(spell_id)) { return; } @@ -3111,7 +3111,7 @@ void Mob::TrySpellTrigger(Mob *target, uint32 spell_id) void Mob::TryApplyEffect(Mob *target, uint32 spell_id) { - if(target == NULL || !IsValidSpell(spell_id)) + if(target == nullptr || !IsValidSpell(spell_id)) { return; } @@ -3309,7 +3309,7 @@ bool Mob::TryFadeEffect(int slot) void Mob::TrySympatheticProc(Mob *target, uint32 spell_id) { - if(target == NULL || !IsValidSpell(spell_id)) + if(target == nullptr || !IsValidSpell(spell_id)) return; int focus_spell = CastToClient()->GetSympatheticFocusEffect(focusSympatheticProc,spell_id); @@ -3784,12 +3784,12 @@ void Mob::InsertQuestGlobal(int charid, int npcid, int zoneid, const char *varna char *query = 0; char errbuf[MYSQL_ERRMSG_SIZE]; - // Make duration string either "unix_timestamp(now()) + xxx" or "NULL" + // Make duration string either "unix_timestamp(now()) + xxx" or "nullptr" stringstream duration_ss; if (duration == INT_MAX) { - duration_ss << "NULL"; + duration_ss << "nullptr"; } else { @@ -4182,7 +4182,7 @@ bool Mob::TryReflectSpell(uint32 spell_id) void Mob::DoGravityEffect() { - Mob *caster = NULL; + Mob *caster = nullptr; int away = -1; float caster_x, caster_y, amount, value, cur_x, my_x, cur_y, my_y, x_vector, y_vector, hypot; @@ -4274,7 +4274,7 @@ void Mob::SpreadVirus(uint16 spell_id, uint16 casterID) int num_targs = spells[spell_id].viral_targets; Mob* caster = entity_list.GetMob(casterID); - Mob* target = NULL; + Mob* target = nullptr; // Only spread in zones without perm buffs if(!zone->BuffTimersSuspended()) { for(int i = 0; i < num_targs; i++) { diff --git a/zone/mob.h b/zone/mob.h index cefa8842d..8e5ee6d95 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -122,8 +122,8 @@ public: //Appearance void SendLevelAppearance(); void SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 parm4, uint32 parm5, - Client *specific_target=NULL); - void SendTargetable(bool on, Client *specific_target = NULL); + Client *specific_target=nullptr); + void SendTargetable(bool on, Client *specific_target = nullptr); virtual void SendWearChange(uint8 material_slot); virtual void SendTextureWC(uint8 slot, uint16 texture, uint32 hero_forge_model = 0, uint32 elite_material = 0, uint32 unknown06 = 0, uint32 unknown18 = 0); @@ -148,7 +148,7 @@ public: //Spell void SendSpellEffect(uint32 effectid, uint32 duration, uint32 finish_delay, bool zone_wide, - uint32 unk020, bool perm_effect = false, Client *c = NULL); + uint32 unk020, bool perm_effect = false, Client *c = nullptr); bool IsBeneficialAllowed(Mob *target); virtual int GetCasterLevel(uint16 spell_id); void ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* newbon, uint16 casterID = 0, @@ -169,7 +169,7 @@ public: virtual void SpellProcess(); virtual bool CastSpell(uint16 spell_id, uint16 target_id, uint16 slot = 10, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0, uint32 item_slot = 0xFFFFFFFF, - uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, uint32 type = 0, int16 *resist_adjust = NULL); + uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, uint32 type = 0, int16 *resist_adjust = nullptr); virtual bool DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot = 10, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0, uint32 item_slot = 0xFFFFFFFF, uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, uint32 type = 0, int16 resist_adjust = 0); @@ -212,7 +212,7 @@ public: virtual int GetMaxSongSlots() const { return 0; } virtual int GetMaxDiscSlots() const { return 0; } virtual int GetMaxTotalSlots() const { return 0; } - virtual void InitializeBuffSlots() { buffs = NULL; current_buff_count = 0; } + virtual void InitializeBuffSlots() { buffs = nullptr; current_buff_count = 0; } virtual void UninitializeBuffSlots() { } inline bool HasRune() const { return m_hasRune; } inline bool HasSpellRune() const { return m_hasSpellRune; } @@ -246,7 +246,7 @@ public: //Basic Stats/Inventory virtual void SetLevel(uint8 in_level, bool command = false) { level = in_level; } - void TempName(const char *newname = NULL); + void TempName(const char *newname = nullptr); void SetTargetable(bool on); bool IsTargetable() const { return m_targetable; } virtual uint16 GetSkill(SkillType skill_num) const { return 0; } @@ -262,7 +262,7 @@ public: bool ChangeHP(Mob* other, int32 amount, uint16 spell_id = 0, int8 buffslot = -1, bool iBuffTic = false); inline void SetOOCRegen(int32 newoocregen) {oocregen = newoocregen;} virtual void Heal(); - virtual void HealDamage(uint32 ammount, Mob* caster = NULL); + virtual void HealDamage(uint32 ammount, Mob* caster = nullptr); virtual void SetMaxHP() { cur_hp = max_hp; } virtual inline uint16 GetBaseRace() const { return base_race; } virtual inline uint8 GetBaseGender() const { return base_gender; } @@ -288,7 +288,7 @@ public: inline const char* GetOrigName() const { return orig_name; } inline const char* GetLastName() const { return lastname; } const char *GetCleanName(); - virtual void SetName(const char *new_name = NULL) { new_name ? strn0cpy(name, new_name, 64) : + virtual void SetName(const char *new_name = nullptr) { new_name ? strn0cpy(name, new_name, 64) : strn0cpy(name, GetName(), 64); return; }; inline Mob* GetTarget() const { return target; } virtual void SetTarget(Mob* mob); @@ -417,8 +417,8 @@ public: inline const uint32 LastChange() const { return pLastChange; } //Quest - void QuestReward(Client *c = NULL, uint32 silver = 0, uint32 gold = 0, uint32 platinum = 0); - void CameraEffect(uint32 duration, uint32 intensity, Client *c = NULL, bool global = false); + void QuestReward(Client *c = nullptr, uint32 silver = 0, uint32 gold = 0, uint32 platinum = 0); + void CameraEffect(uint32 duration, uint32 intensity, Client *c = nullptr, bool global = false); inline bool GetQglobal() const { return qglobal; } //Other Packet @@ -434,8 +434,8 @@ public: static uint8 GetDefaultGender(uint16 in_race, uint8 in_gender = 0xFF); static void CreateSpawnPacket(EQApplicationPacket* app, NewSpawn_Struct* ns); uint16 GetSkillByItemType(int ItemType); - virtual void MakePet(uint16 spell_id, const char* pettype, const char *petname = NULL); - virtual void MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const char *petname = NULL); + virtual void MakePet(uint16 spell_id, const char* pettype, const char *petname = nullptr); + virtual void MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const char *petname = nullptr); bool IsWarriorClass() const; char GetCasterClass() const; uint8 GetArchetype() const; @@ -505,8 +505,8 @@ public: virtual void UnStun(); inline void Silence(bool newval) { silenced = newval; } inline void Amnesia(bool newval) { amnesiad = newval; } - void TemporaryPets(uint16 spell_id, Mob *target, const char *name_override = NULL, uint32 duration_override = 0); - void TypesTemporaryPets(uint32 typesid, Mob *target, const char *name_override = NULL, uint32 duration_override = 0, bool followme = false); + void TemporaryPets(uint16 spell_id, Mob *target, const char *name_override = nullptr, uint32 duration_override = 0); + void TypesTemporaryPets(uint32 typesid, Mob *target, const char *name_override = nullptr, uint32 duration_override = 0, bool followme = false); void WakeTheDead(uint16 spell_id, Mob *target, uint32 duration); void Spin(); void Kill(); @@ -535,7 +535,7 @@ public: void CastOnCurer(uint32 spell_id); void CastOnCure(uint32 spell_id); void CastOnNumHitFade(uint32 spell_id); - int SlowMitigation(bool slow_msg=false, Mob *caster = NULL,int slow_value = 0); + int SlowMitigation(bool slow_msg=false, Mob *caster = nullptr,int slow_value = 0); int16 GetCritDmgMob(uint16 skill); int16 GetMeleeDamageMod_SE(uint16 skill); int16 GetMeleeMinDamageMod_SE(uint16 skill); @@ -565,7 +565,7 @@ public: uint8 GetFlurryChance() { return NPC_FlurryChance; } static uint32 GetAppearanceValue(EmuAppearance iAppearance); - void SendAppearancePacket(uint32 type, uint32 value, bool WholeZone = true, bool iIgnoreSelf = false, Client *specific_target=NULL); + void SendAppearancePacket(uint32 type, uint32 value, bool WholeZone = true, bool iIgnoreSelf = false, Client *specific_target=nullptr); void SetAppearance(EmuAppearance app, bool iIgnoreSelf = true); inline EmuAppearance GetAppearance() const { return _appearance; } inline const uint8 GetRunAnimSpeed() const { return pRunAnimSpeed; } @@ -635,9 +635,9 @@ public: int32 AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker); virtual void DoSpecialAttackDamage(Mob *who, SkillType skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool HitChance=false); - virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=NULL, const Item_Struct* item=NULL, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0); + virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const Item_Struct* item=nullptr, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0); virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillType skillinuse, int16 chance_mod=0, int16 focus=0, bool CanRiposte=false); - virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=NULL, const ItemInst* Ammo=NULL, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0); + virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemInst* Ammo=nullptr, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0); bool CanDoSpecialAttack(Mob *other); bool Flurry(); bool Rampage(); @@ -742,9 +742,9 @@ public: virtual uint32 GetAA(uint32 aa_id) const { return(0); } uint16 GetInstrumentMod(uint16 spell_id) const; - int CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level = 1, Mob *caster = NULL, int ticsremaining = 0); + int CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level = 1, Mob *caster = nullptr, int ticsremaining = 0); int CalcSpellEffectValue_formula(int formula, int base, int max, int caster_level, uint16 spell_id, int ticsremaining = 0); - virtual int CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int caster_level2, Mob* caster1 = NULL, Mob* caster2 = NULL); + virtual int CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int caster_level2, Mob* caster1 = nullptr, Mob* caster2 = nullptr); uint32 GetCastedSpellInvSlot() const { return casting_spell_inventory_slot; } // HP Event @@ -782,7 +782,7 @@ public: inline virtual bool IsBlockedBuff(int16 SpellID) { return false; } inline virtual bool IsBlockedPetBuff(int16 SpellID) { return false; } - void SetGlobal(const char *varname, const char *newvalue, int options, const char *duration, Mob *other = NULL); + void SetGlobal(const char *varname, const char *newvalue, int options, const char *duration, Mob *other = nullptr); void TarGlobal(const char *varname, const char *value, const char *duration, int npcid, int charid, int zoneid); void DelGlobal(const char *varname); @@ -895,7 +895,7 @@ protected: virtual float GetProcChances(float &ProcBonus, float &ProcChance, uint16 weapon_speed = 30, uint16 hand = 13); virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 weapon_speed = 30, uint16 hand = 13); int GetWeaponDamage(Mob *against, const Item_Struct *weapon_item); - int GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate = NULL); + int GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate = nullptr); int GetKickDamage(); int GetBashDamage(); virtual void ApplySpecialAttackMod(SkillType skill, int32 &dmg, int32 &mindmg); diff --git a/zone/net.cpp b/zone/net.cpp index 2ac9d1c61..e7d7ddf1c 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -96,7 +96,7 @@ EQStreamFactory eqsf(ZoneStream); npcDecayTimes_Struct npcCorpseDecayTimes[100]; TitleManager title_manager; DBAsyncFinishedQueue MTdbafq; -DBAsync *dbasync = NULL; +DBAsync *dbasync = nullptr; TaskManager *taskmanager = 0; QuestParserCollection *parse = 0; @@ -174,7 +174,7 @@ int main(int argc, char** argv) { dbasync->AddFQ(&MTdbafq); guild_mgr.SetDatabase(&database); - GuildBanks = NULL; + GuildBanks = nullptr; #ifdef _EQDEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); @@ -238,7 +238,7 @@ int main(int argc, char** argv) { } _log(ZONE__INIT, "Loading spells"); - EQEmu::MemoryMappedFile *mmf = NULL; + EQEmu::MemoryMappedFile *mmf = nullptr; LoadSpells(&mmf); _log(ZONE__INIT, "Loading guilds"); diff --git a/zone/npc.cpp b/zone/npc.cpp index a2c1addb1..a8f876253 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -123,12 +123,12 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float int moblevel=GetLevel(); NPCTypedata = d; - NPCTypedata_ours = NULL; + NPCTypedata_ours = nullptr; respawn2 = in_respawn; swarm_timer.Disable(); taunting = false; - proximity = NULL; + proximity = nullptr; copper = 0; silver = 0; gold = 0; @@ -141,7 +141,7 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float max_wp=0; save_wp = 0; spawn_group = 0; - swarmInfoPtr = NULL; + swarmInfoPtr = nullptr; spellscale = d->spellscale; healscale = d->healscale; @@ -345,7 +345,7 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float } reface_timer = new Timer(15000); reface_timer->Disable(); - qGlobals = NULL; + qGlobals = nullptr; guard_x_saved = 0; guard_y_saved = 0; guard_z_saved = 0; @@ -361,7 +361,7 @@ NPC::~NPC() entity_list.RemoveNPC(GetID()); AI_Stop(); - if(proximity != NULL) { + if(proximity != nullptr) { entity_list.RemoveProximity(GetID()); safe_delete(proximity); } @@ -431,7 +431,7 @@ ServerLootItem_Struct* NPC::GetItem(int slot_id) { return item; } } - return(NULL); + return(nullptr); } void NPC::RemoveItem(uint32 item_id, uint16 quantity, uint16 slot) { @@ -457,7 +457,7 @@ void NPC::RemoveItem(uint32 item_id, uint16 quantity, uint16 slot) { void NPC::CheckMinMaxLevel(Mob *them) { - if(them == NULL || !them->IsClient()) + if(them == nullptr || !them->IsClient()) return; uint16 themlevel = them->GetLevel(); @@ -1011,7 +1011,7 @@ uint32 ZoneDatabase::NPCSpawnDB(uint8 command, const char* zone, uint32 zone_ver } else { - // row[0] is NULL - No npc_type IDs set in this range yet + // row[0] is nullptr - No npc_type IDs set in this range yet npc_type_id = starting_npc_id; } } @@ -1123,7 +1123,7 @@ uint32 ZoneDatabase::NPCSpawnDB(uint8 command, const char* zone, uint32 zone_ver safe_delete_array(query); row = mysql_fetch_row(result); - if (row == NULL) return false; + if (row == nullptr) return false; if (row[0]) tmp = atoi(row[0]); if (row[1]) tmp2 = atoi(row[1]); @@ -1158,7 +1158,7 @@ uint32 ZoneDatabase::NPCSpawnDB(uint8 command, const char* zone, uint32 zone_ver safe_delete_array(query); row = mysql_fetch_row(result); - if (row == NULL) return false; + if (row == nullptr) return false; if (row[0]) tmp = atoi(row[0]); if (row[1]) tmp2 = atoi(row[1]); mysql_free_result(result); @@ -1263,7 +1263,7 @@ uint32 NPC::GetMaxDamage(uint8 tlevel) void NPC::PickPocket(Client* thief) { - thief->CheckIncreaseSkill(PICK_POCKETS, NULL, 5); + thief->CheckIncreaseSkill(PICK_POCKETS, nullptr, 5); //make sure were allowed to targte them: int olevel = GetLevel(); @@ -2200,7 +2200,7 @@ void NPC::NPCSlotTexture(uint8 slot, uint16 texture) uint32 NPC::GetSwarmOwner() { - if(GetSwarmInfo() != NULL) + if(GetSwarmInfo() != nullptr) { return GetSwarmInfo()->owner_id; } @@ -2209,7 +2209,7 @@ uint32 NPC::GetSwarmOwner() uint32 NPC::GetSwarmTarget() { - if(GetSwarmInfo() != NULL) + if(GetSwarmInfo() != nullptr) { return GetSwarmInfo()->target; } @@ -2218,7 +2218,7 @@ uint32 NPC::GetSwarmTarget() void NPC::SetSwarmTarget(int target_id) { - if(GetSwarmInfo() != NULL) + if(GetSwarmInfo() != nullptr) { GetSwarmInfo()->target = target_id; } @@ -2281,18 +2281,18 @@ NPC_Emote_Struct* NPC::GetNPCEmote(uint16 emoteid, uint8 event_) { } iterator.Advance(); } - return (NULL); + return (nullptr); } void NPC::DoNPCEmote(uint8 event_, uint16 emoteid) { - if(this == NULL || emoteid == 0) + if(this == nullptr || emoteid == 0) { return; } NPC_Emote_Struct* nes = GetNPCEmote(emoteid,event_); - if(nes == NULL) + if(nes == nullptr) { return; } @@ -2375,7 +2375,7 @@ FACTION_VALUE NPC::GetReverseFactionCon(Mob* iOther) { //if we are a pet, use our owner's faction stuff Mob *own = GetOwner(); - if (own != NULL) + if (own != nullptr) return own->GetReverseFactionCon(iOther); //make sure iOther is an npc diff --git a/zone/npc.h b/zone/npc.h index e810cfe1f..6b32b1c0a 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -410,12 +410,12 @@ public: } iterator.Advance(); } - return NULL; + return nullptr; } bool DoesQuestItemExist(uint32 itmID, int charges, bool flagItemForDeletion=false) { ItemInst* inst = FindQuestItemByID(itmID,charges,flagItemForDeletion); - if ( inst != NULL ) + if ( inst != nullptr ) { return true; } diff --git a/zone/object.h b/zone/object.h index a39708a7e..9de16cee6 100644 --- a/zone/object.h +++ b/zone/object.h @@ -171,7 +171,7 @@ public: virtual uint16 VarSave(); virtual void SetID(uint16 set_id); - void ClearUser() { user = NULL; } + void ClearUser() { user = nullptr; } uint32 GetDBID(); uint32 GetType(); diff --git a/zone/parser.cpp b/zone/parser.cpp index 79e97917a..4ff3a0f56 100644 --- a/zone/parser.cpp +++ b/zone/parser.cpp @@ -581,7 +581,7 @@ void Parser::SendCommands(const char * event, uint32 npcid, NPC* npcmob, Mob* mo if(mob && mob->IsClient()) quest_manager.StartQuest(npcmob, mob->CastToClient()); else - quest_manager.StartQuest(npcmob, NULL); + quest_manager.StartQuest(npcmob, nullptr); while (listIt2 != p->Event.end()) { pp = *listIt2; @@ -615,7 +615,7 @@ void Parser::scanformat(char *string, const char *format, char arg[10][1024]) for(;;) { - // increment while they're the same (and not NULL) + // increment while they're the same (and not nullptr) while(*format && *string && *format == *string) { format++; string++; @@ -1150,7 +1150,7 @@ printf("GetVar(%s) = '%s'\n", varname.c_str(), p->value.c_str()); iterator++; } checkfirst=""; - checkfirst = "NULL"; + checkfirst = "nullptr"; return checkfirst; } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 8c79cabf0..0e2264ece 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -45,13 +45,13 @@ float VertexDistanceNoRoot(VERTEX a, VERTEX b) PathManager* PathManager::LoadPathFile(const char* ZoneName) { - FILE *PathFile = NULL; + FILE *PathFile = nullptr; char LowerCaseZoneName[64]; char ZonePathFileName[256]; - PathManager* Ret = NULL; + PathManager* Ret = nullptr; strn0cpy(LowerCaseZoneName, ZoneName, 64); @@ -85,8 +85,8 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) PathManager::PathManager() { - PathNodes = NULL; - ClosedListFlag = NULL; + PathNodes = nullptr; + ClosedListFlag = nullptr; Head.PathNodeCount = 0; Head.version = 2; QuickConnectTarget = -1; @@ -397,7 +397,7 @@ list PathManager::FindRoute(VERTEX Start, VERTEX End) { _log(PATHING__DEBUG, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); - if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, NULL, NULL)) + if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr, nullptr)) { ClosestPathNodeToStart = (*Iterator).id; break; @@ -438,7 +438,7 @@ list PathManager::FindRoute(VERTEX Start, VERTEX End) End.x, End.y, End.z, PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); - if(!zone->zonemap->LineIntersectsZone(End, PathNodes[(*Iterator).id].v, 1.0f, NULL, NULL)) + if(!zone->zonemap->LineIntersectsZone(End, PathNodes[(*Iterator).id].v, 1.0f, nullptr, nullptr)) { ClosestPathNodeToEnd = (*Iterator).id; break; @@ -478,7 +478,7 @@ list PathManager::FindRoute(VERTEX Start, VERTEX End) if((*Second) < 0) break; - if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Second)].v, 1.0f, NULL, NULL) + if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Second)].v, 1.0f, nullptr, nullptr) && zone->pathing->NoHazards(Start, PathNodes[(*Second)].v)) { noderoute.erase(First); @@ -511,7 +511,7 @@ list PathManager::FindRoute(VERTEX Start, VERTEX End) if((*Second) < 0) break; - if(!zone->zonemap->LineIntersectsZone(End, PathNodes[(*Second)].v, 1.0f, NULL, NULL) + if(!zone->zonemap->LineIntersectsZone(End, PathNodes[(*Second)].v, 1.0f, nullptr, nullptr) && zone->pathing->NoHazards(End, PathNodes[(*Second)].v)) { noderoute.erase(First); @@ -772,7 +772,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, NULL, NULL)) + if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; @@ -865,7 +865,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, NULL, NULL)) + if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; @@ -904,7 +904,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { mlog(PATHING__DEBUG, " Checking for short LOS at distance %8.3f.", Distance); - if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, NULL, NULL)) + if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; @@ -1057,7 +1057,7 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Waypo { mlog(PATHING__DEBUG, " Checking for long LOS at distance %8.3f.", Distance); - if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, NULL, NULL)) + if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; @@ -1137,7 +1137,7 @@ int PathManager::FindNearestPathNode(VERTEX Position) { _log(PATHING__DEBUG, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); - if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, NULL, NULL)) + if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr, nullptr)) { ClosestPathNodeToStart = (*Iterator).id; break; @@ -1159,7 +1159,7 @@ bool PathManager::NoHazards(VERTEX From, VERTEX To) // VERTEX MidPoint((From.x + To.x) / 2, (From.y + To.y) / 2, From.z); - float NewZ = zone->zonemap->FindBestZ(MAP_ROOT_NODE, MidPoint, NULL, NULL); + float NewZ = zone->zonemap->FindBestZ(MAP_ROOT_NODE, MidPoint, nullptr, nullptr); if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) { @@ -1199,7 +1199,7 @@ bool PathManager::NoHazardsAccurate(VERTEX From, VERTEX To) stepz = (stepz/factor)*step_size; VERTEX TestPoint(curx, cury, curz); - float NewZ = zone->zonemap->FindBestZ(MAP_ROOT_NODE, TestPoint, NULL, NULL); + float NewZ = zone->zonemap->FindBestZ(MAP_ROOT_NODE, TestPoint, nullptr, nullptr); if(ABS(NewZ - last_z) > 5.0) { _log(PATHING__DEBUG, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", @@ -1225,7 +1225,7 @@ bool PathManager::NoHazardsAccurate(VERTEX From, VERTEX To) VERTEX hit; TestPointWaterDest.z -= 500; float best_z2 = -999990; - if(zone->zonemap->LineIntersectsNode(n, TestPointWater, TestPointWaterDest, &hit, NULL)) + if(zone->zonemap->LineIntersectsNode(n, TestPointWater, TestPointWaterDest, &hit, nullptr)) { best_z2 = hit.z; } @@ -1360,7 +1360,7 @@ PathNode* PathManager::FindPathNodeByCoordinates(float x, float y, float z) if((PathNodes[i].v.x == x) && (PathNodes[i].v.y == y) && (PathNodes[i].v.z == z)) return &PathNodes[i]; - return NULL; + return nullptr; } int PathManager::GetRandomPathNode() @@ -1743,7 +1743,7 @@ bool PathManager::DeleteNode(int32 id) else { delete[] PathNodes; - PathNodes = NULL; + PathNodes = nullptr; } return true; } @@ -1777,8 +1777,8 @@ void PathManager::ConnectNodeToNode(Client *c, int32 Node2, int32 teleport, int3 void PathManager::ConnectNodeToNode(int32 Node1, int32 Node2, int32 teleport, int32 doorid) { - PathNode *a = NULL; - PathNode *b = NULL; + PathNode *a = nullptr; + PathNode *b = nullptr; for(uint32 x = 0; x < Head.PathNodeCount; ++x) { if(PathNodes[x].id == Node1) @@ -1795,7 +1795,7 @@ void PathManager::ConnectNodeToNode(int32 Node1, int32 Node2, int32 teleport, in } } - if(a == NULL || b == NULL) + if(a == nullptr || b == nullptr) return; bool connect_a_to_b = true; @@ -1867,8 +1867,8 @@ void PathManager::ConnectNode(Client *c, int32 Node2, int32 teleport, int32 door void PathManager::ConnectNode(int32 Node1, int32 Node2, int32 teleport, int32 doorid) { - PathNode *a = NULL; - PathNode *b = NULL; + PathNode *a = nullptr; + PathNode *b = nullptr; for(uint32 x = 0; x < Head.PathNodeCount; ++x) { if(PathNodes[x].id == Node1) @@ -1885,7 +1885,7 @@ void PathManager::ConnectNode(int32 Node1, int32 Node2, int32 teleport, int32 do } } - if(a == NULL || b == NULL) + if(a == nullptr || b == nullptr) return; bool connect_a_to_b = true; @@ -1932,8 +1932,8 @@ void PathManager::DisconnectNodeToNode(Client *c, int32 Node2) void PathManager::DisconnectNodeToNode(int32 Node1, int32 Node2) { - PathNode *a = NULL; - PathNode *b = NULL; + PathNode *a = nullptr; + PathNode *b = nullptr; for(uint32 x = 0; x < Head.PathNodeCount; ++x) { if(PathNodes[x].id == Node1) @@ -1950,7 +1950,7 @@ void PathManager::DisconnectNodeToNode(int32 Node1, int32 Node2) } } - if(a == NULL || b == NULL) + if(a == nullptr || b == nullptr) return; bool disconnect_a_from_b = false; @@ -2018,7 +2018,7 @@ void PathManager::MoveNode(Client *c) if(zone->zonemap) { VERTEX loc(c->GetX(), c->GetY(), c->GetZ()); - Node->bestz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, loc, NULL, NULL); + Node->bestz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, loc, nullptr, nullptr); } else { @@ -2106,7 +2106,7 @@ bool PathManager::CheckLosFN(VERTEX a, VERTEX b) oloc.z = b.z; - if(zone->zonemap->LineIntersectsZone(myloc, oloc, 1.0f, NULL, NULL)) + if(zone->zonemap->LineIntersectsZone(myloc, oloc, 1.0f, nullptr, nullptr)) { return false; } diff --git a/zone/perl_PlayerCorpse.cpp b/zone/perl_PlayerCorpse.cpp index f4d502f3c..c27b781fb 100644 --- a/zone/perl_PlayerCorpse.cpp +++ b/zone/perl_PlayerCorpse.cpp @@ -58,8 +58,8 @@ XS(XS_Corpse_GetCharID) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCharID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -84,8 +84,8 @@ XS(XS_Corpse_GetDecayTime) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDecayTime(); XSprePUSH; PUSHu((UV)RETVAL); @@ -108,8 +108,8 @@ XS(XS_Corpse_Lock) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Lock(); } @@ -131,8 +131,8 @@ XS(XS_Corpse_UnLock) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UnLock(); } @@ -155,8 +155,8 @@ XS(XS_Corpse_IsLocked) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsLocked(); ST(0) = boolSV(RETVAL); @@ -180,8 +180,8 @@ XS(XS_Corpse_ResetLooter) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ResetLooter(); } @@ -205,8 +205,8 @@ XS(XS_Corpse_GetDBID) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDBID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -231,8 +231,8 @@ XS(XS_Corpse_GetOwnerName) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetOwnerName(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -256,8 +256,8 @@ XS(XS_Corpse_SetDecayTimer) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDecayTimer(decaytime); } @@ -280,8 +280,8 @@ XS(XS_Corpse_IsEmpty) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsEmpty(); ST(0) = boolSV(RETVAL); @@ -308,8 +308,8 @@ XS(XS_Corpse_AddItem) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) slot = 0; @@ -340,8 +340,8 @@ XS(XS_Corpse_GetWornItem) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWornItem(equipSlot); XSprePUSH; PUSHu((UV)RETVAL); @@ -365,8 +365,8 @@ XS(XS_Corpse_RemoveItem) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveItem(lootslot); } @@ -392,8 +392,8 @@ XS(XS_Corpse_SetCash) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetCash(in_copper, in_silver, in_gold, in_platinum); } @@ -415,8 +415,8 @@ XS(XS_Corpse_RemoveCash) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveCash(); } @@ -440,8 +440,8 @@ XS(XS_Corpse_CountItems) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CountItems(); XSprePUSH; PUSHu((UV)RETVAL); @@ -464,8 +464,8 @@ XS(XS_Corpse_Delete) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Delete(); } @@ -489,8 +489,8 @@ XS(XS_Corpse_GetCopper) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCopper(); XSprePUSH; PUSHu((UV)RETVAL); @@ -515,8 +515,8 @@ XS(XS_Corpse_GetSilver) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSilver(); XSprePUSH; PUSHu((UV)RETVAL); @@ -541,8 +541,8 @@ XS(XS_Corpse_GetGold) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGold(); XSprePUSH; PUSHu((UV)RETVAL); @@ -567,8 +567,8 @@ XS(XS_Corpse_GetPlatinum) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPlatinum(); XSprePUSH; PUSHu((UV)RETVAL); @@ -593,8 +593,8 @@ XS(XS_Corpse_Summon) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -602,8 +602,8 @@ XS(XS_Corpse_Summon) } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == NULL) - Perl_croak(aTHX_ "client is NULL, avoiding crash."); + if(client == nullptr) + Perl_croak(aTHX_ "client is nullptr, avoiding crash."); THIS->Summon(client, spell, true); } @@ -627,8 +627,8 @@ XS(XS_Corpse_CastRezz) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(2))); @@ -636,8 +636,8 @@ XS(XS_Corpse_CastRezz) } else Perl_croak(aTHX_ "Caster is not of type Mob"); - if(Caster == NULL) - Perl_croak(aTHX_ "Caster is NULL, avoiding crash."); + if(Caster == nullptr) + Perl_croak(aTHX_ "Caster is nullptr, avoiding crash."); THIS->CastRezz(spellid, Caster); } @@ -659,8 +659,8 @@ XS(XS_Corpse_CompleteRezz) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->CompleteRezz(); } @@ -684,8 +684,8 @@ XS(XS_Corpse_CanMobLoot) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanMobLoot(charid); ST(0) = boolSV(RETVAL); @@ -711,8 +711,8 @@ XS(XS_Corpse_AllowMobLoot) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -720,8 +720,8 @@ XS(XS_Corpse_AllowMobLoot) } else Perl_croak(aTHX_ "them is not of type Mob"); - if(them == NULL) - Perl_croak(aTHX_ "them is NULL, avoiding crash."); + if(them == nullptr) + Perl_croak(aTHX_ "them is nullptr, avoiding crash."); THIS->AllowMobLoot(them, slot); } @@ -744,8 +744,8 @@ XS(XS_Corpse_AddLooter) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -753,8 +753,8 @@ XS(XS_Corpse_AddLooter) } else Perl_croak(aTHX_ "who is not of type Mob"); - if(who == NULL) - Perl_croak(aTHX_ "who is NULL, avoiding crash."); + if(who == nullptr) + Perl_croak(aTHX_ "who is nullptr, avoiding crash."); THIS->AddLooter(who); } @@ -777,8 +777,8 @@ XS(XS_Corpse_IsRezzed) } else Perl_croak(aTHX_ "THIS is not of type Corpse"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Rezzed(); ST(0) = boolSV(RETVAL); diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index de6632f78..f80366542 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -56,8 +56,8 @@ XS(XS_Client_SendSound) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendSound(); } @@ -81,8 +81,8 @@ XS(XS_Client_Save) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Save(iCommitNow); ST(0) = boolSV(RETVAL); @@ -106,8 +106,8 @@ XS(XS_Client_SaveBackup) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SaveBackup(); } @@ -130,8 +130,8 @@ XS(XS_Client_Connected) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Connected(); ST(0) = boolSV(RETVAL); @@ -156,8 +156,8 @@ XS(XS_Client_InZone) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->InZone(); ST(0) = boolSV(RETVAL); @@ -181,8 +181,8 @@ XS(XS_Client_Kick) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Kick(); } @@ -204,8 +204,8 @@ XS(XS_Client_Disconnect) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Disconnect(); } @@ -228,8 +228,8 @@ XS(XS_Client_IsLD) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsLD(); ST(0) = boolSV(RETVAL); @@ -253,8 +253,8 @@ XS(XS_Client_WorldKick) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->WorldKick(); } @@ -278,8 +278,8 @@ XS(XS_Client_GetAnon) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAnon(); XSprePUSH; PUSHu((UV)RETVAL); @@ -302,8 +302,8 @@ XS(XS_Client_Duck) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Duck(); } @@ -325,8 +325,8 @@ XS(XS_Client_Stand) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Stand(); } @@ -349,8 +349,8 @@ XS(XS_Client_SetGM) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetGM(toggle); } @@ -373,8 +373,8 @@ XS(XS_Client_SetPVP) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPVP(toggle); } @@ -397,8 +397,8 @@ XS(XS_Client_GetPVP) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPVP(); ST(0) = boolSV(RETVAL); @@ -423,8 +423,8 @@ XS(XS_Client_GetGM) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGM(); ST(0) = boolSV(RETVAL); @@ -449,8 +449,8 @@ XS(XS_Client_SetBaseClass) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBaseClass(i); } @@ -473,8 +473,8 @@ XS(XS_Client_SetBaseRace) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBaseRace(i); } @@ -497,8 +497,8 @@ XS(XS_Client_SetBaseGender) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBaseGender(i); } @@ -522,8 +522,8 @@ XS(XS_Client_GetBaseFace) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseFace(); XSprePUSH; PUSHu((UV)RETVAL); @@ -549,8 +549,8 @@ XS(XS_Client_GetLanguageSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLanguageSkill(n); XSprePUSH; PUSHu((UV)RETVAL); @@ -575,8 +575,8 @@ XS(XS_Client_GetLastName) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLastName(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -602,8 +602,8 @@ XS(XS_Client_GetLDoNPointsTheme) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNPointsTheme(theme_out); XSprePUSH; PUSHu((UV)RETVAL); @@ -628,8 +628,8 @@ XS(XS_Client_GetBaseSTR) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseSTR(); XSprePUSH; PUSHu((UV)RETVAL); @@ -654,8 +654,8 @@ XS(XS_Client_GetBaseSTA) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseSTA(); XSprePUSH; PUSHu((UV)RETVAL); @@ -680,8 +680,8 @@ XS(XS_Client_GetBaseCHA) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseCHA(); XSprePUSH; PUSHu((UV)RETVAL); @@ -706,8 +706,8 @@ XS(XS_Client_GetBaseDEX) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseDEX(); XSprePUSH; PUSHu((UV)RETVAL); @@ -732,8 +732,8 @@ XS(XS_Client_GetBaseINT) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseINT(); XSprePUSH; PUSHu((UV)RETVAL); @@ -758,8 +758,8 @@ XS(XS_Client_GetBaseAGI) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseAGI(); XSprePUSH; PUSHu((UV)RETVAL); @@ -784,8 +784,8 @@ XS(XS_Client_GetBaseWIS) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseWIS(); XSprePUSH; PUSHu((UV)RETVAL); @@ -810,8 +810,8 @@ XS(XS_Client_GetWeight) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWeight(); XSprePUSH; PUSHu((UV)RETVAL); @@ -836,8 +836,8 @@ XS(XS_Client_GetEXP) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEXP(); XSprePUSH; PUSHu((UV)RETVAL); @@ -862,8 +862,8 @@ XS(XS_Client_GetAAExp) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAAXP(); XSprePUSH; PUSHu((UV)RETVAL); @@ -888,8 +888,8 @@ XS(XS_Client_GetTotalSecondsPlayed) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTotalSecondsPlayed(); XSprePUSH; PUSHu((UV)RETVAL); @@ -915,8 +915,8 @@ XS(XS_Client_UpdateLDoNPoints) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->UpdateLDoNPoints(points, theme); ST(0) = boolSV(RETVAL); @@ -941,8 +941,8 @@ XS(XS_Client_SetDeity) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDeity(i); } @@ -967,8 +967,8 @@ XS(XS_Client_AddEXP) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) conlevel = 0xFF; @@ -1005,8 +1005,8 @@ XS(XS_Client_SetEXP) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) resexp = false; @@ -1038,8 +1038,8 @@ XS(XS_Client_SetBindPoint) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) to_zone = -1; @@ -1088,8 +1088,8 @@ XS(XS_Client_GetBindX) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; @@ -1121,8 +1121,8 @@ XS(XS_Client_GetBindY) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; @@ -1154,8 +1154,8 @@ XS(XS_Client_GetBindZ) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; @@ -1187,8 +1187,8 @@ XS(XS_Client_GetBindHeading) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; @@ -1220,8 +1220,8 @@ XS(XS_Client_GetBindZoneID) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 1) index = 0; @@ -1256,8 +1256,8 @@ XS(XS_Client_MovePC) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->MovePC(zoneID, x, y, z, heading); } @@ -1285,8 +1285,8 @@ XS(XS_Client_MovePCInstance) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->MovePC(zoneID, instanceID, x, y, z, heading); } @@ -1309,8 +1309,8 @@ XS(XS_Client_ChangeLastName) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ChangeLastName(in_lastname); } @@ -1341,8 +1341,8 @@ XS(XS_Client_GetFactionLevel) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(7), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(7))); @@ -1350,8 +1350,8 @@ XS(XS_Client_GetFactionLevel) } else Perl_croak(aTHX_ "tnpc is not of type Mob"); - if(tnpc == NULL) - Perl_croak(aTHX_ "tnpc is NULL, avoiding crash."); + if(tnpc == nullptr) + Perl_croak(aTHX_ "tnpc is nullptr, avoiding crash."); RETVAL = THIS->GetFactionLevel(char_id, npc_id, p_race, p_class, p_deity, pFaction, tnpc); XSprePUSH; PUSHi((IV)RETVAL); @@ -1379,8 +1379,8 @@ XS(XS_Client_SetFactionLevel) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFactionLevel(char_id, npc_id, char_class, char_race, char_deity); } @@ -1409,8 +1409,8 @@ XS(XS_Client_SetFactionLevel2) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items == 7) temp = 0; @@ -1440,8 +1440,8 @@ XS(XS_Client_GetRawItemAC) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRawItemAC(); XSprePUSH; PUSHi((IV)RETVAL); @@ -1466,8 +1466,8 @@ XS(XS_Client_AccountID) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->AccountID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1492,8 +1492,8 @@ XS(XS_Client_AccountName) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->AccountName(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -1518,8 +1518,8 @@ XS(XS_Client_Admin) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Admin(); XSprePUSH; PUSHi((IV)RETVAL); @@ -1544,8 +1544,8 @@ XS(XS_Client_CharacterID) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CharacterID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1569,8 +1569,8 @@ XS(XS_Client_UpdateAdmin) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) iFromDB = true; @@ -1599,8 +1599,8 @@ XS(XS_Client_UpdateWho) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) remove = 0; @@ -1630,8 +1630,8 @@ XS(XS_Client_GuildRank) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GuildRank(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1656,8 +1656,8 @@ XS(XS_Client_GuildID) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GuildID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1682,8 +1682,8 @@ XS(XS_Client_GetFace) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFace(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1709,8 +1709,8 @@ XS(XS_Client_TakeMoneyFromPP) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) updateclient = (bool)SvTRUE(ST(2)); @@ -1742,8 +1742,8 @@ XS(XS_Client_AddMoneyToPP) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddMoneyToPP(copper, silver, gold, platinum, updateclient); } @@ -1766,8 +1766,8 @@ XS(XS_Client_TGB) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->TGB(); ST(0) = boolSV(RETVAL); @@ -1793,8 +1793,8 @@ XS(XS_Client_GetSkillPoints) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSkillPoints(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1818,8 +1818,8 @@ XS(XS_Client_SetSkillPoints) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSkillPoints(inp); } @@ -1843,8 +1843,8 @@ XS(XS_Client_IncreaseSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) value = 1; @@ -1874,8 +1874,8 @@ XS(XS_Client_IncreaseLanguageSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) value = 1; @@ -1906,8 +1906,8 @@ XS(XS_Client_GetSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSkill(skill_id); XSprePUSH; PUSHu((UV)RETVAL); @@ -1933,8 +1933,8 @@ XS(XS_Client_GetRawSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRawSkill(skill_id); XSprePUSH; PUSHu((UV)RETVAL); @@ -1959,8 +1959,8 @@ XS(XS_Client_HasSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HasSkill(skill_id); ST(0) = boolSV(RETVAL); @@ -1986,8 +1986,8 @@ XS(XS_Client_CanHaveSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanHaveSkill(skill_id); ST(0) = boolSV(RETVAL); @@ -2013,8 +2013,8 @@ XS(XS_Client_SetSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSkill(skill_num, value); } @@ -2038,8 +2038,8 @@ XS(XS_Client_AddSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddSkill(skillid, value); } @@ -2062,8 +2062,8 @@ XS(XS_Client_CheckSpecializeIncrease) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->CheckSpecializeIncrease(spell_id); } @@ -2088,8 +2088,8 @@ XS(XS_Client_CheckIncreaseSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) chancemodi = 0; @@ -2097,7 +2097,7 @@ XS(XS_Client_CheckIncreaseSkill) chancemodi = (int)SvIV(ST(2)); } - RETVAL = THIS->CheckIncreaseSkill(skillid, NULL, chancemodi); + RETVAL = THIS->CheckIncreaseSkill(skillid, nullptr, chancemodi); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } @@ -2121,8 +2121,8 @@ XS(XS_Client_SetLanguageSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetLanguageSkill(langid, value); } @@ -2149,8 +2149,8 @@ XS(XS_Client_MaxSkill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(items > 2) class_ = (uint16)SvUV(ST(2)); @@ -2183,8 +2183,8 @@ XS(XS_Client_GMKill) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GMKill(); } @@ -2207,8 +2207,8 @@ XS(XS_Client_IsMedding) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMedding(); ST(0) = boolSV(RETVAL); @@ -2234,8 +2234,8 @@ XS(XS_Client_GetDuelTarget) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDuelTarget(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2259,8 +2259,8 @@ XS(XS_Client_IsDueling) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsDueling(); ST(0) = boolSV(RETVAL); @@ -2285,8 +2285,8 @@ XS(XS_Client_SetDuelTarget) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDuelTarget(set_id); } @@ -2309,8 +2309,8 @@ XS(XS_Client_SetDueling) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDueling(duel); } @@ -2332,8 +2332,8 @@ XS(XS_Client_ResetAA) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ResetAA(); } @@ -2358,8 +2358,8 @@ XS(XS_Client_MemSpell) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) update_client = true; @@ -2389,8 +2389,8 @@ XS(XS_Client_UnmemSpell) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) update_client = true; @@ -2419,8 +2419,8 @@ XS(XS_Client_UnmemSpellAll) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) update_client = true; @@ -2451,8 +2451,8 @@ XS(XS_Client_ScribeSpell) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) update_client = true; @@ -2482,8 +2482,8 @@ XS(XS_Client_UnscribeSpell) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) update_client = true; @@ -2512,8 +2512,8 @@ XS(XS_Client_UnscribeSpellAll) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) update_client = true; @@ -2543,8 +2543,8 @@ XS(XS_Client_UntrainDisc) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) update_client = true; @@ -2573,8 +2573,8 @@ XS(XS_Client_UntrainDiscAll) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) update_client = true; @@ -2603,8 +2603,8 @@ XS(XS_Client_IsSitting) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsSitting(); ST(0) = boolSV(RETVAL); @@ -2629,8 +2629,8 @@ XS(XS_Client_IsBecomeNPC) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsBecomeNPC(); ST(0) = boolSV(RETVAL); @@ -2656,8 +2656,8 @@ XS(XS_Client_GetBecomeNPCLevel) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBecomeNPCLevel(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2681,8 +2681,8 @@ XS(XS_Client_SetBecomeNPC) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBecomeNPC(flag); } @@ -2705,8 +2705,8 @@ XS(XS_Client_SetBecomeNPCLevel) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetBecomeNPCLevel(level); } @@ -2730,8 +2730,8 @@ XS(XS_Client_LootToStack) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->LootToStack(itemid); ST(0) = boolSV(RETVAL); @@ -2756,8 +2756,8 @@ XS(XS_Client_SetFeigned) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFeigned(in_feigned); } @@ -2780,8 +2780,8 @@ XS(XS_Client_GetFeigned) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFeigned(); ST(0) = boolSV(RETVAL); @@ -2806,8 +2806,8 @@ XS(XS_Client_AutoSplitEnabled) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->AutoSplitEnabled(); ST(0) = boolSV(RETVAL); @@ -2832,8 +2832,8 @@ XS(XS_Client_SetHorseId) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetHorseId(horseid_in); } @@ -2857,8 +2857,8 @@ XS(XS_Client_GetHorseId) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHorseId(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2885,8 +2885,8 @@ XS(XS_Client_NukeItem) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(items < 3){ where_to_check = 0xFF; @@ -2918,8 +2918,8 @@ XS(XS_Client_SetTint) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTint(slot_id, color); } @@ -2943,8 +2943,8 @@ XS(XS_Client_SetMaterial) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetMaterial(slot_id, item_id); } @@ -2966,8 +2966,8 @@ XS(XS_Client_Undye) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Undye(); } @@ -2992,8 +2992,8 @@ XS(XS_Client_GetItemIDAt) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItemIDAt(slot_id); XSprePUSH; PUSHu((UV)RETVAL); @@ -3020,8 +3020,8 @@ XS(XS_Client_GetAugmentIDAt) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAugmentIDAt(slot_id, augslot); XSprePUSH; PUSHu((UV)RETVAL); @@ -3047,8 +3047,8 @@ XS(XS_Client_DeleteItemInInventory) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) quantity = 0; @@ -3091,8 +3091,8 @@ XS(XS_Client_SummonItem) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) { charges = (int16)SvIV(ST(2)); @@ -3141,8 +3141,8 @@ XS(XS_Client_SetStats) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetStats(type, increase_val); } @@ -3166,8 +3166,8 @@ XS(XS_Client_IncStats) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->IncStats(type, increase_val); } @@ -3190,8 +3190,8 @@ XS(XS_Client_DropItem) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->DropItem(slot_id); } @@ -3213,8 +3213,8 @@ XS(XS_Client_BreakInvis) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->BreakInvis(); } @@ -3237,8 +3237,8 @@ XS(XS_Client_GetGroup) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroup(); ST(0) = sv_newmortal(); @@ -3262,8 +3262,8 @@ XS(XS_Client_LeaveGroup) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->LeaveGroup(); } @@ -3286,8 +3286,8 @@ XS(XS_Client_GetRaid) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRaid(); ST(0) = sv_newmortal(); @@ -3312,8 +3312,8 @@ XS(XS_Client_IsGrouped) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsGrouped(); ST(0) = boolSV(RETVAL); @@ -3338,8 +3338,8 @@ XS(XS_Client_IsRaidGrouped) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRaidGrouped(); ST(0) = boolSV(RETVAL); @@ -3364,8 +3364,8 @@ XS(XS_Client_Hungry) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Hungry(); ST(0) = boolSV(RETVAL); @@ -3390,8 +3390,8 @@ XS(XS_Client_Thirsty) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Thirsty(); ST(0) = boolSV(RETVAL); @@ -3418,8 +3418,8 @@ XS(XS_Client_GetInstrumentMod) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInstrumentMod(spell_id); XSprePUSH; PUSHu((UV)RETVAL); @@ -3445,8 +3445,8 @@ XS(XS_Client_DecreaseByID) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DecreaseByID(type, amt); ST(0) = boolSV(RETVAL); @@ -3473,8 +3473,8 @@ XS(XS_Client_SlotConvert2) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SlotConvert2(slot); XSprePUSH; PUSHu((UV)RETVAL); @@ -3497,8 +3497,8 @@ XS(XS_Client_Escape) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Escape(); } @@ -3520,8 +3520,8 @@ XS(XS_Client_RemoveNoRent) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveNoRent(); } @@ -3543,8 +3543,8 @@ XS(XS_Client_GoFish) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GoFish(); } @@ -3566,8 +3566,8 @@ XS(XS_Client_ForageItem) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ForageItem(); } @@ -3593,8 +3593,8 @@ XS(XS_Client_CalcPriceMod) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) other = 0; @@ -3605,8 +3605,8 @@ XS(XS_Client_CalcPriceMod) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); } if (items < 3) @@ -3636,8 +3636,8 @@ XS(XS_Client_ResetTrade) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ResetTrade(); } @@ -3662,8 +3662,8 @@ XS(XS_Client_UseDiscipline) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->UseDiscipline(spell_id, target); ST(0) = boolSV(RETVAL); @@ -3690,8 +3690,8 @@ XS(XS_Client_GetCharacterFactionLevel) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCharacterFactionLevel(faction_id); XSprePUSH; PUSHi((IV)RETVAL); @@ -3715,8 +3715,8 @@ XS(XS_Client_SetZoneFlag) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetZoneFlag(zone_id); } @@ -3739,8 +3739,8 @@ XS(XS_Client_ClearZoneFlag) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearZoneFlag(zone_id); } @@ -3764,8 +3764,8 @@ XS(XS_Client_HasZoneFlag) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HasZoneFlag(zone_id); ST(0) = boolSV(RETVAL); @@ -3790,8 +3790,8 @@ XS(XS_Client_SendZoneFlagInfo) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -3799,8 +3799,8 @@ XS(XS_Client_SendZoneFlagInfo) } else Perl_croak(aTHX_ "to is not of type Client"); - if(to == NULL) - Perl_croak(aTHX_ "to is NULL, avoiding crash."); + if(to == nullptr) + Perl_croak(aTHX_ "to is nullptr, avoiding crash."); THIS->SendZoneFlagInfo(to); } @@ -3822,8 +3822,8 @@ XS(XS_Client_LoadZoneFlags) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->LoadZoneFlags(); } @@ -3847,8 +3847,8 @@ XS(XS_Client_SetAATitle) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(strlen(txt) > 31) Perl_croak(aTHX_ "Title must be 31 characters or less"); @@ -3881,8 +3881,8 @@ XS(XS_Client_GetClientVersion) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientVersion(); XSprePUSH; PUSHu((UV)RETVAL); @@ -3907,8 +3907,8 @@ XS(XS_Client_GetClientVersionBit) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientVersionBit(); XSprePUSH; PUSHu((UV)RETVAL); @@ -3932,8 +3932,8 @@ XS(XS_Client_SetTitleSuffix) { } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(strlen(txt) > 31) Perl_croak(aTHX_ "Title must be 31 characters or less"); @@ -3964,8 +3964,8 @@ XS(XS_Client_SetAAPoints) { } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GetPP().aapoints = points; THIS->SendAAStats(); @@ -3989,8 +3989,8 @@ XS(XS_Client_GetAAPoints) { } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPP().aapoints; XSprePUSH; PUSHu((UV)RETVAL); @@ -4014,8 +4014,8 @@ XS(XS_Client_GetSpentAA) { } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPP().aapoints_spent; XSprePUSH; PUSHu((UV)RETVAL); @@ -4038,8 +4038,8 @@ XS(XS_Client_AddAAPoints) { } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GetPP().aapoints += points; THIS->SendAAStats(); @@ -4061,8 +4061,8 @@ XS(XS_Client_RefundAA) { } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); int curpt = 0; bool refunded = false; @@ -4113,8 +4113,8 @@ XS(XS_Client_GetModCharacterFactionLevel) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetModCharacterFactionLevel(faction_id); XSprePUSH; PUSHi((IV)RETVAL); @@ -4139,8 +4139,8 @@ XS(XS_Client_GetLDoNWins) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNWins(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4165,8 +4165,8 @@ XS(XS_Client_GetLDoNLosses) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNLosses(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4192,8 +4192,8 @@ XS(XS_Client_GetLDoNWinsTheme) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNWinsTheme(theme_out); XSprePUSH; PUSHu((UV)RETVAL); @@ -4219,8 +4219,8 @@ XS(XS_Client_GetLDoNLossesTheme) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLDoNLossesTheme(theme_out); XSprePUSH; PUSHu((UV)RETVAL); @@ -4245,8 +4245,8 @@ XS(XS_Client_GetItemAt) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInv().GetItem(slot); ST(0) = sv_newmortal(); @@ -4273,8 +4273,8 @@ XS(XS_Client_GetAugmentAt) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); ItemInst * inst = THIS->GetInv().GetItem(slot); if(inst) @@ -4283,7 +4283,7 @@ XS(XS_Client_GetAugmentAt) } else { - RETVAL = NULL; + RETVAL = nullptr; } ST(0) = sv_newmortal(); @@ -4309,8 +4309,8 @@ XS(XS_Client_GetStartZone) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetStartZone(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4337,8 +4337,8 @@ XS(XS_Client_SetStartZone) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(items == 5) { x = SvNV(ST(2)); @@ -4367,8 +4367,8 @@ XS(XS_Client_KeyRingAdd) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->KeyRingAdd(item_id);; } @@ -4392,8 +4392,8 @@ XS(XS_Client_KeyRingCheck) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->KeyRingCheck(item_id);; ST(0) = boolSV(RETVAL); @@ -4418,8 +4418,8 @@ XS(XS_Client_AddPVPPoints) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddPVPPoints(Points); } @@ -4443,8 +4443,8 @@ XS(XS_Client_AddCrystals) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddCrystals(Radiant, Ebon); } @@ -4468,8 +4468,8 @@ XS(XS_Client_GetPVPPoints) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPVPPoints(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4494,8 +4494,8 @@ XS(XS_Client_GetRadiantCrystals) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRadiantCrystals(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4520,8 +4520,8 @@ XS(XS_Client_GetEbonCrystals) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEbonCrystals(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4546,8 +4546,8 @@ XS(XS_Client_ReadBook) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->QuestReadBook(in_txt, type); } @@ -4571,8 +4571,8 @@ XS(XS_Client_UpdateGroupAAs) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UpdateGroupAAs(points, type); } @@ -4596,8 +4596,8 @@ XS(XS_Client_GetGroupPoints) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroupPoints(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4622,8 +4622,8 @@ XS(XS_Client_GetRaidPoints) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRaidPoints(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4647,8 +4647,8 @@ XS(XS_Client_LearnRecipe) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->LearnRecipe(recipe_id);; } @@ -4672,8 +4672,8 @@ XS(XS_Client_GetEndurance) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEndurance(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4698,8 +4698,8 @@ XS(XS_Client_GetMaxEndurance) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxEndurance(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4724,8 +4724,8 @@ XS(XS_Client_GetEnduranceRatio) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEndurancePercent(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4749,8 +4749,8 @@ XS(XS_Client_SetEndurance) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetEndurance(Endurance); } @@ -4765,7 +4765,7 @@ XS(XS_Client_SendOPTranslocateConfirm) Perl_croak(aTHX_ "Usage: Client::SendOPTranslocateConfirm(THIS, Caster, SpellID)"); { Client * THIS; - Mob * caster = NULL; + Mob * caster = nullptr; int32 spell_id = (int32)SvUV(ST(2)); if (sv_derived_from(ST(0), "Client")) { @@ -4774,8 +4774,8 @@ XS(XS_Client_SendOPTranslocateConfirm) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -4783,8 +4783,8 @@ XS(XS_Client_SendOPTranslocateConfirm) } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == NULL) - Perl_croak(aTHX_ "caster is NULL, avoiding crash."); + if(caster == nullptr) + Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); THIS->SendOPTranslocateConfirm(caster, spell_id); } @@ -4799,7 +4799,7 @@ XS(XS_Client_NPCSpawn) Perl_croak(aTHX_ "Usage: Client::NPCSpawn(THIS, target_npc, option, respawntime=1200)"); { Client * THIS; - NPC * target_npc = NULL; + NPC * target_npc = nullptr; Const_char * option = (Const_char *)SvPV_nolen(ST(2)); uint32 respawntime = 1200; @@ -4809,8 +4809,8 @@ XS(XS_Client_NPCSpawn) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "NPC")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -4818,8 +4818,8 @@ XS(XS_Client_NPCSpawn) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(target_npc == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(target_npc == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 3) respawntime = (uint32)SvUV(ST(3)); @@ -4846,8 +4846,8 @@ XS(XS_Client_GetIP) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetIP(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4872,8 +4872,8 @@ XS(XS_Client_AddLevelBasedExp) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) max_level = (uint8)SvUV(ST(2)); @@ -4899,12 +4899,12 @@ XS(XS_Client_IncrementAA) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); SendAA_Struct* aa2 = zone->FindAA(aaskillid); - if(aa2 == NULL) + if(aa2 == nullptr) Perl_croak(aTHX_ "Invalid AA."); if(THIS->GetAA(aaskillid) == aa2->max_level) @@ -4940,8 +4940,8 @@ XS(XS_Client_GetAALevel) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAA(aaskillid); XSprePUSH; PUSHu((UV)RETVAL); @@ -4967,8 +4967,8 @@ XS(XS_Client_MarkCompassLoc) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->MarkSingleCompassLoc(x,y,z); } @@ -4990,8 +4990,8 @@ XS(XS_Client_ClearCompassMark) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->MarkSingleCompassLoc(0,0,0,0); } @@ -5016,8 +5016,8 @@ XS(XS_Client_GetFreeSpellBookSlot) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 1) start_slot = SvUV(ST(1)); @@ -5046,8 +5046,8 @@ XS(XS_Client_GetSpellBookSlotBySpellID) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->FindSpellBookSlotBySpellID(spell_id); XSprePUSH; PUSHi((IV)RETVAL); @@ -5073,8 +5073,8 @@ XS(XS_Client_UpdateTaskActivity) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UpdateTaskActivity(TaskID, ActivityID, Count); } @@ -5098,8 +5098,8 @@ XS(XS_Client_AssignTask) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AssignTask(TaskID, NPCID); } @@ -5122,8 +5122,8 @@ XS(XS_Client_FailTask) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->FailTask(TaskID); } @@ -5147,8 +5147,8 @@ XS(XS_Client_IsTaskCompleted) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTaskCompleted(TaskID); ST(0) = boolSV(RETVAL); @@ -5174,8 +5174,8 @@ XS(XS_Client_IsTaskActive) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTaskActive(TaskID); ST(0) = boolSV(RETVAL); @@ -5202,8 +5202,8 @@ XS(XS_Client_IsTaskActivityActive) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTaskActivityActive(TaskID, ActivityID); ST(0) = boolSV(RETVAL); @@ -5229,8 +5229,8 @@ XS(XS_Client_GetCorpseCount) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = database.GetPlayerCorpseCount(THIS->CharacterID()); XSprePUSH; PUSHi((IV)RETVAL); @@ -5256,8 +5256,8 @@ XS(XS_Client_GetCorpseID) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = database.GetPlayerCorpseID(THIS->CharacterID(), corpse); XSprePUSH; PUSHi((IV)RETVAL); @@ -5284,8 +5284,8 @@ XS(XS_Client_GetCorpseItemAt) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = database.GetPlayerCorpseItemAt(corpse_id, slotid); XSprePUSH; PUSHi((IV)RETVAL); @@ -5309,8 +5309,8 @@ XS(XS_Client_AssignToInstance) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AssignToInstance(instance_id); } @@ -5332,8 +5332,8 @@ XS(XS_Client_Freeze) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendAppearancePacket(AT_Anim, ANIM_FREEZE); } @@ -5355,8 +5355,8 @@ XS(XS_Client_UnFreeze) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendAppearancePacket(AT_Anim, ANIM_STAND); } @@ -5381,8 +5381,8 @@ XS(XS_Client_GetAggroCount) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAggroCount(); XSprePUSH; PUSHi((IV)RETVAL); @@ -5408,8 +5408,8 @@ XS(XS_Client_GetCarriedMoney) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCarriedMoney(); XSprePUSH; PUSHi((IV)RETVAL); @@ -5435,8 +5435,8 @@ XS(XS_Client_GetAllMoney) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAllMoney(); XSprePUSH; PUSHi((IV)RETVAL); @@ -5454,7 +5454,7 @@ XS(XS_Client_GetItemInInventory) { Client * THIS; int16 slot_id = (int16)SvIV(ST(1)); - ItemInst *RETVAL = NULL; + ItemInst *RETVAL = nullptr; if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -5462,8 +5462,8 @@ XS(XS_Client_GetItemInInventory) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInv().GetItem(slot_id); ST(0) = sv_newmortal(); @@ -5490,8 +5490,8 @@ XS(XS_Client_SetCustomItemData) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GetInv().SetCustomItemData(THIS->CharacterID(), slot_id, std::string(identifier), std::string(value)); } @@ -5517,8 +5517,8 @@ XS(XS_Client_GetCustomItemData) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::string ret_val = THIS->GetInv().GetCustomItemData(slot_id, std::string(identifier)); RETVAL = ret_val.c_str(); @@ -5542,8 +5542,8 @@ XS(XS_Client_OpenLFGuildWindow) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->OpenLFGuildWindow(); } @@ -5566,8 +5566,8 @@ XS(XS_Client_SignalClient) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Signal(data); } @@ -5591,8 +5591,8 @@ XS(XS_Client_AddAlternateCurrencyValue) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddAlternateCurrencyValue(currency_id, amount); } @@ -5607,7 +5607,7 @@ XS(XS_Client_SendWebLink) Perl_croak(aTHX_ "Usage: Client::SendWebLink(THIS, website)"); { Client * THIS; - char * website = NULL; + char * website = nullptr; if (sv_derived_from(ST(0), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -5615,8 +5615,8 @@ XS(XS_Client_SendWebLink) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 1) { website = (char *)SvPV_nolen(ST(1)); } @@ -5642,8 +5642,8 @@ XS(XS_Client_GetInstanceID) } else Perl_croak(aTHX_ "THIS is not of type Client"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInstanceID(); XSprePUSH; PUSHu((UV)RETVAL); diff --git a/zone/perl_doors.cpp b/zone/perl_doors.cpp index 7b4b23d50..aab945af7 100644 --- a/zone/perl_doors.cpp +++ b/zone/perl_doors.cpp @@ -57,8 +57,8 @@ XS(XS_Doors_GetDoorDBID) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorDBID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -83,8 +83,8 @@ XS(XS_Doors_GetDoorID) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -109,8 +109,8 @@ XS(XS_Doors_GetID) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEntityID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -135,8 +135,8 @@ XS(XS_Doors_GetX) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetX(); XSprePUSH; PUSHn((double)RETVAL); @@ -161,8 +161,8 @@ XS(XS_Doors_GetY) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetY(); XSprePUSH; PUSHn((double)RETVAL); @@ -187,8 +187,8 @@ XS(XS_Doors_GetZ) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetZ(); XSprePUSH; PUSHn((double)RETVAL); @@ -213,8 +213,8 @@ XS(XS_Doors_GetHeading) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHeading(); XSprePUSH; PUSHn((double)RETVAL); @@ -239,8 +239,8 @@ XS(XS_Doors_GetOpenType) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetOpenType(); XSprePUSH; PUSHu((UV)RETVAL); @@ -265,8 +265,8 @@ XS(XS_Doors_GetLockpick) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLockpick(); XSprePUSH; PUSHu((UV)RETVAL); @@ -291,8 +291,8 @@ XS(XS_Doors_GetKeyItem) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetKeyItem(); XSprePUSH; PUSHu((UV)RETVAL); @@ -316,8 +316,8 @@ XS(XS_Doors_GetNoKeyring) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GetNoKeyring(); } @@ -341,8 +341,8 @@ XS(XS_Doors_GetIncline) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetIncline(); XSprePUSH; PUSHu((UV)RETVAL); @@ -367,8 +367,8 @@ XS(XS_Doors_GetSize) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSize(); XSprePUSH; PUSHu((UV)RETVAL); @@ -394,8 +394,8 @@ XS(XS_Doors_SetOpenType) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetOpenType(type); } @@ -418,8 +418,8 @@ XS(XS_Doors_SetLockpick) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetLockpick(type); } @@ -442,8 +442,8 @@ XS(XS_Doors_SetKeyItem) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetKeyItem(type); } @@ -466,8 +466,8 @@ XS(XS_Doors_SetNoKeyring) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetNoKeyring(type); } @@ -490,8 +490,8 @@ XS(XS_Doors_SetIncline) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetIncline(type); } @@ -514,8 +514,8 @@ XS(XS_Doors_SetSize) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSize(type); } @@ -540,8 +540,8 @@ XS(XS_Doors_SetLocation) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetLocation(x, y, z); } @@ -564,8 +564,8 @@ XS(XS_Doors_SetX) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetX(pos); } @@ -588,8 +588,8 @@ XS(XS_Doors_SetY) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetY(pos); } @@ -612,8 +612,8 @@ XS(XS_Doors_SetZ) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetZ(pos); } @@ -636,8 +636,8 @@ XS(XS_Doors_SetHeading) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetHeading(heading); } @@ -652,7 +652,7 @@ XS(XS_Doors_SetModelName) Perl_croak(aTHX_ "Usage: Doors::SetModelName(THIS, name)"); { Doors * THIS; - char * name = NULL; + char * name = nullptr; if (sv_derived_from(ST(0), "Doors")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -660,8 +660,8 @@ XS(XS_Doors_SetModelName) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 1) { name = (char *)SvPV_nolen(ST(1)); } @@ -686,8 +686,8 @@ XS(XS_Doors_GetModelName) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorName(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -710,8 +710,8 @@ XS(XS_Doors_CreateDatabaseEntry) } else Perl_croak(aTHX_ "THIS is not of type Doors"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->CreateDatabaseEntry(); } diff --git a/zone/perl_entity.cpp b/zone/perl_entity.cpp index 6ee394f3b..eb24384ce 100644 --- a/zone/perl_entity.cpp +++ b/zone/perl_entity.cpp @@ -59,8 +59,8 @@ XS(XS_EntityList_GetMobID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMobID(id); ST(0) = sv_newmortal(); @@ -86,8 +86,8 @@ XS(XS_EntityList_GetMob) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMob(name); ST(0) = sv_newmortal(); @@ -113,8 +113,8 @@ XS(XS_EntityList_GetMobByID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMob(id); ST(0) = sv_newmortal(); @@ -140,8 +140,8 @@ XS(XS_EntityList_GetMobByNpcTypeID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMobByNpcTypeID(get_id); ST(0) = sv_newmortal(); @@ -167,8 +167,8 @@ XS(XS_EntityList_GetNPCByID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCByID(id); ST(0) = sv_newmortal(); @@ -194,8 +194,8 @@ XS(XS_EntityList_GetNPCByNPCTypeID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCByNPCTypeID(npc_id); ST(0) = sv_newmortal(); @@ -221,8 +221,8 @@ XS(XS_EntityList_GetClientByName) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByName(name); ST(0) = sv_newmortal(); @@ -248,8 +248,8 @@ XS(XS_EntityList_GetClientByAccID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByAccID(accid); ST(0) = sv_newmortal(); @@ -275,8 +275,8 @@ XS(XS_EntityList_GetClientByID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByID(id); ST(0) = sv_newmortal(); @@ -302,8 +302,8 @@ XS(XS_EntityList_GetClientByCharID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByCharID(iCharID); ST(0) = sv_newmortal(); @@ -329,8 +329,8 @@ XS(XS_EntityList_GetClientByWID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByWID(iWID); ST(0) = sv_newmortal(); @@ -356,8 +356,8 @@ XS(XS_EntityList_GetObjectByDBID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetObjectByDBID(id); ST(0) = sv_newmortal(); @@ -383,8 +383,8 @@ XS(XS_EntityList_GetObjectByID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetObjectByID(id); ST(0) = sv_newmortal(); @@ -410,8 +410,8 @@ XS(XS_EntityList_GetDoorsByDBID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorsByDBID(id); ST(0) = sv_newmortal(); @@ -437,8 +437,8 @@ XS(XS_EntityList_GetDoorsByDoorID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorsByDoorID(id); ST(0) = sv_newmortal(); @@ -464,8 +464,8 @@ XS(XS_EntityList_GetDoorsByID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDoorsByID(id); ST(0) = sv_newmortal(); @@ -491,8 +491,8 @@ XS(XS_EntityList_FindDoor) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->FindDoor(id); ST(0) = sv_newmortal(); @@ -518,8 +518,8 @@ XS(XS_EntityList_GetGroupByMob) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -527,8 +527,8 @@ XS(XS_EntityList_GetGroupByMob) } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == NULL) - Perl_croak(aTHX_ "mob is NULL, avoiding crash."); + if(mob == nullptr) + Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); RETVAL = THIS->GetGroupByMob(mob); ST(0) = sv_newmortal(); @@ -554,8 +554,8 @@ XS(XS_EntityList_GetGroupByClient) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -563,8 +563,8 @@ XS(XS_EntityList_GetGroupByClient) } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == NULL) - Perl_croak(aTHX_ "client is NULL, avoiding crash."); + if(client == nullptr) + Perl_croak(aTHX_ "client is nullptr, avoiding crash."); RETVAL = THIS->GetGroupByClient(client); ST(0) = sv_newmortal(); @@ -590,8 +590,8 @@ XS(XS_EntityList_GetGroupByID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroupByID(id); ST(0) = sv_newmortal(); @@ -617,8 +617,8 @@ XS(XS_EntityList_GetGroupByLeaderName) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroupByLeaderName(leader); ST(0) = sv_newmortal(); @@ -644,8 +644,8 @@ XS(XS_EntityList_GetRaidByID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRaidByID(id); ST(0) = sv_newmortal(); @@ -671,8 +671,8 @@ XS(XS_EntityList_GetRaidByClient) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -680,8 +680,8 @@ XS(XS_EntityList_GetRaidByClient) } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == NULL) - Perl_croak(aTHX_ "client is NULL, avoiding crash."); + if(client == nullptr) + Perl_croak(aTHX_ "client is nullptr, avoiding crash."); RETVAL = THIS->GetRaidByClient(client); ST(0) = sv_newmortal(); @@ -707,8 +707,8 @@ XS(XS_EntityList_GetCorpseByOwner) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -716,8 +716,8 @@ XS(XS_EntityList_GetCorpseByOwner) } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == NULL) - Perl_croak(aTHX_ "client is NULL, avoiding crash."); + if(client == nullptr) + Perl_croak(aTHX_ "client is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseByOwner(client); ST(0) = sv_newmortal(); @@ -743,8 +743,8 @@ XS(XS_EntityList_GetCorpseByID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseByID(id); ST(0) = sv_newmortal(); @@ -770,8 +770,8 @@ XS(XS_EntityList_GetCorpseByName) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorpseByName(name); ST(0) = sv_newmortal(); @@ -795,8 +795,8 @@ XS(XS_EntityList_ClearClientPetitionQueue) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearClientPetitionQueue(); } @@ -820,8 +820,8 @@ XS(XS_EntityList_CanAddHateForMob) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -829,8 +829,8 @@ XS(XS_EntityList_CanAddHateForMob) } else Perl_croak(aTHX_ "p is not of type Mob"); - if(p == NULL) - Perl_croak(aTHX_ "p is NULL, avoiding crash."); + if(p == nullptr) + Perl_croak(aTHX_ "p is nullptr, avoiding crash."); RETVAL = THIS->CanAddHateForMob(p); ST(0) = boolSV(RETVAL); @@ -854,8 +854,8 @@ XS(XS_EntityList_Clear) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Clear(); } @@ -879,8 +879,8 @@ XS(XS_EntityList_RemoveMob) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveMob(delete_id); ST(0) = boolSV(RETVAL); @@ -906,8 +906,8 @@ XS(XS_EntityList_RemoveClient) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveClient(delete_id); ST(0) = boolSV(RETVAL); @@ -933,8 +933,8 @@ XS(XS_EntityList_RemoveNPC) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveNPC(delete_id); ST(0) = boolSV(RETVAL); @@ -960,8 +960,8 @@ XS(XS_EntityList_RemoveGroup) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveGroup(delete_id); ST(0) = boolSV(RETVAL); @@ -987,8 +987,8 @@ XS(XS_EntityList_RemoveCorpse) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveCorpse(delete_id); ST(0) = boolSV(RETVAL); @@ -1014,8 +1014,8 @@ XS(XS_EntityList_RemoveDoor) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveDoor(delete_id); ST(0) = boolSV(RETVAL); @@ -1041,8 +1041,8 @@ XS(XS_EntityList_RemoveTrap) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveTrap(delete_id); ST(0) = boolSV(RETVAL); @@ -1068,8 +1068,8 @@ XS(XS_EntityList_RemoveObject) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RemoveObject(delete_id); ST(0) = boolSV(RETVAL); @@ -1093,8 +1093,8 @@ XS(XS_EntityList_RemoveAllMobs) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllMobs(); } @@ -1116,8 +1116,8 @@ XS(XS_EntityList_RemoveAllClients) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllClients(); } @@ -1139,8 +1139,8 @@ XS(XS_EntityList_RemoveAllNPCs) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllNPCs(); } @@ -1162,8 +1162,8 @@ XS(XS_EntityList_RemoveAllGroups) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllGroups(); } @@ -1185,8 +1185,8 @@ XS(XS_EntityList_RemoveAllCorpses) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllCorpses(); } @@ -1208,8 +1208,8 @@ XS(XS_EntityList_RemoveAllDoors) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllDoors(); } @@ -1231,8 +1231,8 @@ XS(XS_EntityList_RemoveAllTraps) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllTraps(); } @@ -1254,8 +1254,8 @@ XS(XS_EntityList_RemoveAllObjects) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveAllObjects(); } @@ -1280,8 +1280,8 @@ XS(XS_EntityList_Message) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Message(to_guilddbid, type, message); } @@ -1307,8 +1307,8 @@ XS(XS_EntityList_MessageStatus) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->MessageStatus(to_guilddbid, to_minstatus, type, message); } @@ -1335,8 +1335,8 @@ XS(XS_EntityList_MessageClose) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1344,8 +1344,8 @@ XS(XS_EntityList_MessageClose) } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == NULL) - Perl_croak(aTHX_ "sender is NULL, avoiding crash."); + if(sender == nullptr) + Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->MessageClose(sender, skipsender, dist, type, message); } @@ -1368,8 +1368,8 @@ XS(XS_EntityList_RemoveFromTargets) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1377,8 +1377,8 @@ XS(XS_EntityList_RemoveFromTargets) } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == NULL) - Perl_croak(aTHX_ "mob is NULL, avoiding crash."); + if(mob == nullptr) + Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); THIS->RemoveFromTargets(mob); } @@ -1402,8 +1402,8 @@ XS(XS_EntityList_ReplaceWithTarget) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1411,8 +1411,8 @@ XS(XS_EntityList_ReplaceWithTarget) } else Perl_croak(aTHX_ "pOldMob is not of type Mob"); - if(pOldMob == NULL) - Perl_croak(aTHX_ "pOldMob is NULL, avoiding crash."); + if(pOldMob == nullptr) + Perl_croak(aTHX_ "pOldMob is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(2))); @@ -1420,8 +1420,8 @@ XS(XS_EntityList_ReplaceWithTarget) } else Perl_croak(aTHX_ "pNewTarget is not of type Mob"); - if(pNewTarget == NULL) - Perl_croak(aTHX_ "pNewTarget is NULL, avoiding crash."); + if(pNewTarget == nullptr) + Perl_croak(aTHX_ "pNewTarget is nullptr, avoiding crash."); THIS->ReplaceWithTarget(pOldMob, pNewTarget); } @@ -1444,8 +1444,8 @@ XS(XS_EntityList_OpenDoorsNear) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "NPC")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1453,8 +1453,8 @@ XS(XS_EntityList_OpenDoorsNear) } else Perl_croak(aTHX_ "opener is not of type NPC"); - if(opener == NULL) - Perl_croak(aTHX_ "opener is NULL, avoiding crash."); + if(opener == nullptr) + Perl_croak(aTHX_ "opener is nullptr, avoiding crash."); THIS->OpenDoorsNear(opener); } @@ -1479,8 +1479,8 @@ XS(XS_EntityList_MakeNameUnique) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->MakeNameUnique(name); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -1522,8 +1522,8 @@ XS(XS_EntityList_SignalMobsByNPCID) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SignalMobsByNPCID(npc_type, signal_id); } @@ -1546,8 +1546,8 @@ XS(XS_EntityList_RemoveEntity) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveEntity(id); } @@ -1571,8 +1571,8 @@ XS(XS_EntityList_DeleteNPCCorpses) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DeleteNPCCorpses(); XSprePUSH; PUSHi((IV)RETVAL); @@ -1597,8 +1597,8 @@ XS(XS_EntityList_DeletePlayerCorpses) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DeletePlayerCorpses(); XSprePUSH; PUSHi((IV)RETVAL); @@ -1622,8 +1622,8 @@ XS(XS_EntityList_HalveAggro) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1631,8 +1631,8 @@ XS(XS_EntityList_HalveAggro) } else Perl_croak(aTHX_ "who is not of type Mob"); - if(who == NULL) - Perl_croak(aTHX_ "who is NULL, avoiding crash."); + if(who == nullptr) + Perl_croak(aTHX_ "who is nullptr, avoiding crash."); THIS->HalveAggro(who); } @@ -1655,8 +1655,8 @@ XS(XS_EntityList_DoubleAggro) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1664,8 +1664,8 @@ XS(XS_EntityList_DoubleAggro) } else Perl_croak(aTHX_ "who is not of type Mob"); - if(who == NULL) - Perl_croak(aTHX_ "who is NULL, avoiding crash."); + if(who == nullptr) + Perl_croak(aTHX_ "who is nullptr, avoiding crash."); THIS->DoubleAggro(who); } @@ -1688,8 +1688,8 @@ XS(XS_EntityList_ClearFeignAggro) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1697,8 +1697,8 @@ XS(XS_EntityList_ClearFeignAggro) } else Perl_croak(aTHX_ "targ is not of type Mob"); - if(targ == NULL) - Perl_croak(aTHX_ "targ is NULL, avoiding crash."); + if(targ == nullptr) + Perl_croak(aTHX_ "targ is nullptr, avoiding crash."); THIS->ClearFeignAggro(targ); } @@ -1722,8 +1722,8 @@ XS(XS_EntityList_Fighting) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1731,8 +1731,8 @@ XS(XS_EntityList_Fighting) } else Perl_croak(aTHX_ "targ is not of type Mob"); - if(targ == NULL) - Perl_croak(aTHX_ "targ is NULL, avoiding crash."); + if(targ == nullptr) + Perl_croak(aTHX_ "targ is nullptr, avoiding crash."); RETVAL = THIS->Fighting(targ); ST(0) = boolSV(RETVAL); @@ -1758,8 +1758,8 @@ XS(XS_EntityList_RemoveFromHateLists) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1767,8 +1767,8 @@ XS(XS_EntityList_RemoveFromHateLists) } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == NULL) - Perl_croak(aTHX_ "mob is NULL, avoiding crash."); + if(mob == nullptr) + Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); if (items < 3) settoone = false; @@ -1800,8 +1800,8 @@ XS(XS_EntityList_MessageGroup) } else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1809,8 +1809,8 @@ XS(XS_EntityList_MessageGroup) } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == NULL) - Perl_croak(aTHX_ "sender is NULL, avoiding crash."); + if(sender == nullptr) + Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->MessageGroup(sender, skipclose, type, message); } @@ -1822,10 +1822,10 @@ XS(XS_EntityList_GetRandomClient) { dXSARGS; if ((items < 5) || (items > 6)) - Perl_croak(aTHX_ "Usage: EntityList::GetRandomClient(THIS, x, y, z, distance, excludeclient = NULL)"); + Perl_croak(aTHX_ "Usage: EntityList::GetRandomClient(THIS, x, y, z, distance, excludeclient = nullptr)"); { EntityList *THIS; - Client *RETVAL, *c = NULL; + Client *RETVAL, *c = nullptr; float x = (float)SvNV(ST(1)); float y = (float)SvNV(ST(2)); float z = (float)SvNV(ST(3)); @@ -1838,8 +1838,8 @@ XS(XS_EntityList_GetRandomClient) else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(items == 6) { @@ -1872,8 +1872,8 @@ XS(XS_EntityList_GetMobList) else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::list mob_list; entity_list.GetMobList(mob_list); @@ -1909,8 +1909,8 @@ XS(XS_EntityList_GetClientList) else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::list client_list; entity_list.GetClientList(client_list); @@ -1946,8 +1946,8 @@ XS(XS_EntityList_GetNPCList) else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::list npc_list; entity_list.GetNPCList(npc_list); @@ -1983,8 +1983,8 @@ XS(XS_EntityList_GetCorpseList) else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::list corpse_list; entity_list.GetCorpseList(corpse_list); @@ -2020,8 +2020,8 @@ XS(XS_EntityList_GetObjectList) else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::list object_list; entity_list.GetObjectList(object_list); @@ -2057,8 +2057,8 @@ XS(XS_EntityList_GetDoorsList) else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::list door_list; entity_list.GetDoorsList(door_list); @@ -2094,8 +2094,8 @@ XS(XS_EntityList_SignalAllClients) else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); entity_list.SignalAllClients(data); } diff --git a/zone/perl_groups.cpp b/zone/perl_groups.cpp index 3a15f2c81..9a7f52336 100644 --- a/zone/perl_groups.cpp +++ b/zone/perl_groups.cpp @@ -56,8 +56,8 @@ XS(XS_Group_DisbandGroup) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->DisbandGroup(); } @@ -81,8 +81,8 @@ XS(XS_Group_IsGroupMember) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -90,8 +90,8 @@ XS(XS_Group_IsGroupMember) } else Perl_croak(aTHX_ "client is not of type Mob"); - if(client == NULL) - Perl_croak(aTHX_ "client is NULL, avoiding crash."); + if(client == nullptr) + Perl_croak(aTHX_ "client is nullptr, avoiding crash."); RETVAL = THIS->IsGroupMember(client); ST(0) = boolSV(RETVAL); @@ -117,8 +117,8 @@ XS(XS_Group_CastGroupSpell) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -126,8 +126,8 @@ XS(XS_Group_CastGroupSpell) } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == NULL) - Perl_croak(aTHX_ "caster is NULL, avoiding crash."); + if(caster == nullptr) + Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); THIS->CastGroupSpell(caster, spellid); } @@ -151,8 +151,8 @@ XS(XS_Group_SplitExp) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(2))); @@ -160,8 +160,8 @@ XS(XS_Group_SplitExp) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->SplitExp(exp, other); } @@ -186,8 +186,8 @@ XS(XS_Group_GroupMessage) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -195,8 +195,8 @@ XS(XS_Group_GroupMessage) } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == NULL) - Perl_croak(aTHX_ "sender is NULL, avoiding crash."); + if(sender == nullptr) + Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); if (items == 4) { language = (uint8)SvUV(ST(2)); @@ -231,8 +231,8 @@ XS(XS_Group_GetTotalGroupDamage) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -240,8 +240,8 @@ XS(XS_Group_GetTotalGroupDamage) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); RETVAL = THIS->GetTotalGroupDamage(other); XSprePUSH; PUSHu((UV)RETVAL); @@ -268,8 +268,8 @@ XS(XS_Group_SplitMoney) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SplitMoney(copper, silver, gold, platinum); } @@ -292,8 +292,8 @@ XS(XS_Group_SetLeader) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -301,8 +301,8 @@ XS(XS_Group_SetLeader) } else Perl_croak(aTHX_ "newleader is not of type Mob"); - if(newleader == NULL) - Perl_croak(aTHX_ "newleader is NULL, avoiding crash."); + if(newleader == nullptr) + Perl_croak(aTHX_ "newleader is nullptr, avoiding crash."); THIS->SetLeader(newleader); } @@ -325,8 +325,8 @@ XS(XS_Group_GetLeader) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLeader(); ST(0) = sv_newmortal(); @@ -352,8 +352,8 @@ XS(XS_Group_GetLeaderName) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLeaderName(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -377,8 +377,8 @@ XS(XS_Group_SendHPPacketsTo) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -386,8 +386,8 @@ XS(XS_Group_SendHPPacketsTo) } else Perl_croak(aTHX_ "newmember is not of type Mob"); - if(newmember == NULL) - Perl_croak(aTHX_ "newmember is NULL, avoiding crash."); + if(newmember == nullptr) + Perl_croak(aTHX_ "newmember is nullptr, avoiding crash."); THIS->SendHPPacketsTo(newmember); } @@ -410,8 +410,8 @@ XS(XS_Group_SendHPPacketsFrom) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -419,8 +419,8 @@ XS(XS_Group_SendHPPacketsFrom) } else Perl_croak(aTHX_ "newmember is not of type Mob"); - if(newmember == NULL) - Perl_croak(aTHX_ "newmember is NULL, avoiding crash."); + if(newmember == nullptr) + Perl_croak(aTHX_ "newmember is nullptr, avoiding crash."); THIS->SendHPPacketsFrom(newmember); } @@ -444,8 +444,8 @@ XS(XS_Group_IsLeader) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -453,8 +453,8 @@ XS(XS_Group_IsLeader) } else Perl_croak(aTHX_ "leadertest is not of type Mob"); - if(leadertest == NULL) - Perl_croak(aTHX_ "leadertest is NULL, avoiding crash."); + if(leadertest == nullptr) + Perl_croak(aTHX_ "leadertest is nullptr, avoiding crash."); RETVAL = THIS->IsLeader(leadertest); ST(0) = boolSV(RETVAL); @@ -480,8 +480,8 @@ XS(XS_Group_GroupCount) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GroupCount(); XSprePUSH; PUSHu((UV)RETVAL); @@ -506,8 +506,8 @@ XS(XS_Group_GetHighestLevel) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHighestLevel(); XSprePUSH; PUSHu((UV)RETVAL); @@ -536,8 +536,8 @@ XS(XS_Group_TeleportGroup) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -545,8 +545,8 @@ XS(XS_Group_TeleportGroup) } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == NULL) - Perl_croak(aTHX_ "sender is NULL, avoiding crash."); + if(sender == nullptr) + Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->TeleportGroup(sender, zoneID, 0, x, y, z, heading); } @@ -570,8 +570,8 @@ XS(XS_Group_GetID) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -588,7 +588,7 @@ XS(XS_Group_GetMember) { Group * THIS; Mob* member; - Client* RETVAL = NULL; + Client* RETVAL = nullptr; dXSTARG; if (sv_derived_from(ST(0), "Group")) { @@ -597,15 +597,15 @@ XS(XS_Group_GetMember) } else Perl_croak(aTHX_ "THIS is not of type Group"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); int index = (int)SvUV(ST(1)); if (index < 0 || index > 5) - RETVAL = NULL; + RETVAL = nullptr; else { member = THIS->members[index]; - if (member != NULL) + if (member != nullptr) RETVAL = member->CastToClient(); } diff --git a/zone/perl_hateentry.cpp b/zone/perl_hateentry.cpp index 1520c106e..070c615e8 100644 --- a/zone/perl_hateentry.cpp +++ b/zone/perl_hateentry.cpp @@ -49,8 +49,8 @@ XS(XS_HateEntry_GetEnt) } else Perl_croak(aTHX_ "THIS is not of type tHateEntry"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->ent; ST(0) = sv_newmortal(); @@ -76,8 +76,8 @@ XS(XS_HateEntry_GetHate) } else Perl_croak(aTHX_ "THIS is not of type tHateEntry"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->hate; XSprePUSH; PUSHi((IV)RETVAL); @@ -102,8 +102,8 @@ XS(XS_HateEntry_GetDamage) } else Perl_croak(aTHX_ "THIS is not of type tHateEntry"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->damage; XSprePUSH; PUSHi((IV)RETVAL); @@ -138,4 +138,4 @@ XS(boot_HateEntry) XSRETURN_YES; } -#endif //EMBPERL_XS_CLASSES \ No newline at end of file +#endif //EMBPERL_XS_CLASSES diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 94d09ed16..b7d697679 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -61,8 +61,8 @@ XS(XS_Mob_IsClient) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsClient(); ST(0) = boolSV(RETVAL); @@ -87,8 +87,8 @@ XS(XS_Mob_IsNPC) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsNPC(); ST(0) = boolSV(RETVAL); @@ -113,8 +113,8 @@ XS(XS_Mob_IsMob) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMob(); ST(0) = boolSV(RETVAL); @@ -139,8 +139,8 @@ XS(XS_Mob_IsCorpse) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsCorpse(); ST(0) = boolSV(RETVAL); @@ -165,8 +165,8 @@ XS(XS_Mob_IsPlayerCorpse) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsPlayerCorpse(); ST(0) = boolSV(RETVAL); @@ -191,8 +191,8 @@ XS(XS_Mob_IsNPCCorpse) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsNPCCorpse(); ST(0) = boolSV(RETVAL); @@ -217,8 +217,8 @@ XS(XS_Mob_IsObject) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsObject(); ST(0) = boolSV(RETVAL); @@ -243,8 +243,8 @@ XS(XS_Mob_IsDoor) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsDoor(); ST(0) = boolSV(RETVAL); @@ -269,8 +269,8 @@ XS(XS_Mob_IsTrap) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTrap(); ST(0) = boolSV(RETVAL); @@ -295,8 +295,8 @@ XS(XS_Mob_IsBeacon) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsBeacon(); ST(0) = boolSV(RETVAL); @@ -321,8 +321,8 @@ XS(XS_Mob_CastToClient) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastToClient(); ST(0) = sv_newmortal(); @@ -347,8 +347,8 @@ XS(XS_Mob_CastToNPC) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastToNPC(); ST(0) = sv_newmortal(); @@ -373,8 +373,8 @@ XS(XS_Mob_CastToMob) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastToMob(); ST(0) = sv_newmortal(); @@ -399,8 +399,8 @@ XS(XS_Mob_CastToCorpse) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastToCorpse(); ST(0) = sv_newmortal(); @@ -426,8 +426,8 @@ XS(XS_Mob_GetID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -452,8 +452,8 @@ XS(XS_Mob_GetName) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetName(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -477,8 +477,8 @@ XS(XS_Mob_Depop) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) StartSpawnTimer = true; @@ -507,8 +507,8 @@ XS(XS_Mob_RogueAssassinate) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -516,8 +516,8 @@ XS(XS_Mob_RogueAssassinate) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->RogueAssassinate(other); } @@ -543,8 +543,8 @@ XS(XS_Mob_BehindMob) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) other = 0; @@ -555,8 +555,8 @@ XS(XS_Mob_BehindMob) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); } if (items < 3) @@ -595,8 +595,8 @@ XS(XS_Mob_SetLevel) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) command = false; @@ -627,8 +627,8 @@ XS(XS_Mob_GetSkill) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSkill(skill_num); XSprePUSH; PUSHu((UV)RETVAL); @@ -652,8 +652,8 @@ XS(XS_Mob_SendWearChange) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendWearChange(material_slot); } @@ -678,8 +678,8 @@ XS(XS_Mob_GetEquipment) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEquipment(material_slot); XSprePUSH; PUSHi((IV)RETVAL); @@ -705,8 +705,8 @@ XS(XS_Mob_GetEquipmentMaterial) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEquipmentMaterial(material_slot); XSprePUSH; PUSHi((IV)RETVAL); @@ -732,8 +732,8 @@ XS(XS_Mob_GetEquipmentColor) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEquipmentColor(material_slot); XSprePUSH; PUSHi((IV)RETVAL); @@ -759,8 +759,8 @@ XS(XS_Mob_GetArmorTint) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetArmorTint(material_slot); XSprePUSH; PUSHi((IV)RETVAL); @@ -784,8 +784,8 @@ XS(XS_Mob_IsMoving) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMoving(); ST(0) = boolSV(RETVAL); @@ -809,8 +809,8 @@ XS(XS_Mob_GoToBind) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->GoToBind(); } @@ -832,8 +832,8 @@ XS(XS_Mob_Gate) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Gate(); } @@ -859,8 +859,8 @@ XS(XS_Mob_Attack) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -868,8 +868,8 @@ XS(XS_Mob_Attack) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); if (items < 3) Hand = 13; @@ -912,8 +912,8 @@ XS(XS_Mob_Damage) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -921,8 +921,8 @@ XS(XS_Mob_Damage) } else Perl_croak(aTHX_ "from is not of type Mob"); - if(from == NULL) - Perl_croak(aTHX_ "from is NULL, avoiding crash."); + if(from == nullptr) + Perl_croak(aTHX_ "from is nullptr, avoiding crash."); if (items < 6) avoidable = true; @@ -963,8 +963,8 @@ XS(XS_Mob_RangedAttack) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -972,8 +972,8 @@ XS(XS_Mob_RangedAttack) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->RangedAttack(other); } @@ -996,8 +996,8 @@ XS(XS_Mob_ThrowingAttack) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1005,8 +1005,8 @@ XS(XS_Mob_ThrowingAttack) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->ThrowingAttack(other); } @@ -1028,8 +1028,8 @@ XS(XS_Mob_Heal) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Heal(); } @@ -1046,7 +1046,7 @@ XS(XS_Mob_HealDamage) { Mob * THIS; int32 heal_amt = (int32)SvIV(ST(1)); - Mob * caster = NULL; + Mob * caster = nullptr; if (sv_derived_from(ST(0), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -1054,8 +1054,8 @@ XS(XS_Mob_HealDamage) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(items == 3) { @@ -1065,8 +1065,8 @@ XS(XS_Mob_HealDamage) } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == NULL) - Perl_croak(aTHX_ "caster is NULL, avoiding crash."); + if(caster == nullptr) + Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); } THIS->HealDamage(heal_amt, caster); @@ -1089,8 +1089,8 @@ XS(XS_Mob_SetMaxHP) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetMaxHP(); } @@ -1115,8 +1115,8 @@ XS(XS_Mob_GetLevelCon) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLevelCon(iOtherLevel); XSprePUSH; PUSHu((UV)RETVAL); @@ -1140,8 +1140,8 @@ XS(XS_Mob_SetHP) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetHP(hp); } @@ -1165,8 +1165,8 @@ XS(XS_Mob_DoAnim) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) type = 0; @@ -1196,8 +1196,8 @@ XS(XS_Mob_ChangeSize) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) bNoRestriction = false; @@ -1229,8 +1229,8 @@ XS(XS_Mob_GMMove) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 5) heading = 0.01; @@ -1259,8 +1259,8 @@ XS(XS_Mob_SendPosUpdate) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) iSendToSelf = 0; @@ -1288,8 +1288,8 @@ XS(XS_Mob_SendPosition) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendPosition(); } @@ -1312,8 +1312,8 @@ XS(XS_Mob_HasProcs) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HasProcs(); ST(0) = boolSV(RETVAL); @@ -1339,8 +1339,8 @@ XS(XS_Mob_IsInvisible) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) other = 0; @@ -1351,8 +1351,8 @@ XS(XS_Mob_IsInvisible) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); } RETVAL = THIS->IsInvisible(other); @@ -1378,8 +1378,8 @@ XS(XS_Mob_SetInvisible) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetInvisible(state); } @@ -1403,8 +1403,8 @@ XS(XS_Mob_FindBuff) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->FindBuff(spellid); ST(0) = boolSV(RETVAL); @@ -1432,8 +1432,8 @@ XS(XS_Mob_FindType) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) bOffensive = false; @@ -1472,8 +1472,8 @@ XS(XS_Mob_GetBuffSlotFromType) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBuffSlotFromType(type); XSprePUSH; PUSHi((IV)RETVAL); @@ -1486,7 +1486,7 @@ XS(XS_Mob_MakePet) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::MakePet(THIS, spell_id, pettype, name=NULL)"); + Perl_croak(aTHX_ "Usage: Mob::MakePet(THIS, spell_id, pettype, name=nullptr)"); { Mob * THIS; uint16 spell_id = (uint16)SvUV(ST(1)); @@ -1499,11 +1499,11 @@ XS(XS_Mob_MakePet) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) - name = NULL; + name = nullptr; else { name = (char *)SvPV_nolen(ST(3)); } @@ -1518,7 +1518,7 @@ XS(XS_Mob_MakeTempPet) { dXSARGS; if (items < 2 || items > 5) - Perl_croak(aTHX_ "Usage: Mob::MakeTempPet(THIS, spell_id, name=NULL, duration=0, target=NULL)"); + Perl_croak(aTHX_ "Usage: Mob::MakeTempPet(THIS, spell_id, name=nullptr, duration=0, target=nullptr)"); { Mob * THIS; uint16 spell_id = (uint16)SvUV(ST(1)); @@ -1532,11 +1532,11 @@ XS(XS_Mob_MakeTempPet) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) - name = NULL; + name = nullptr; else name = (char *)SvPV_nolen(ST(2)); @@ -1546,7 +1546,7 @@ XS(XS_Mob_MakeTempPet) duration = (uint32)SvUV(ST(3)); if (items < 5) - target = NULL; + target = nullptr; else if (sv_derived_from(ST(4), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(4))); target = INT2PTR(Mob *,tmp); @@ -1564,7 +1564,7 @@ XS(XS_Mob_TypesTempPet) { dXSARGS; if (items < 2 || items > 6) - Perl_croak(aTHX_ "Usage: Mob::TypesTempPet(THIS, typesid, name=NULL, duration=0, target=NULL, follow=0)"); + Perl_croak(aTHX_ "Usage: Mob::TypesTempPet(THIS, typesid, name=nullptr, duration=0, target=nullptr, follow=0)"); { Mob * THIS; uint32 typesid = (uint32)SvUV(ST(1)); @@ -1579,11 +1579,11 @@ XS(XS_Mob_TypesTempPet) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) - name = NULL; + name = nullptr; else name = (char *)SvPV_nolen(ST(2)); @@ -1593,7 +1593,7 @@ XS(XS_Mob_TypesTempPet) duration = (uint32)SvUV(ST(3)); if (items < 5) - target = NULL; + target = nullptr; else if (sv_derived_from(ST(4), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(4))); target = INT2PTR(Mob *,tmp); @@ -1629,8 +1629,8 @@ XS(XS_Mob_GetBaseRace) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseRace(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1655,8 +1655,8 @@ XS(XS_Mob_GetBaseGender) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBaseGender(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1681,8 +1681,8 @@ XS(XS_Mob_GetDeity) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDeity(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1707,8 +1707,8 @@ XS(XS_Mob_GetRace) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRace(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1733,8 +1733,8 @@ XS(XS_Mob_GetGender) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGender(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1759,8 +1759,8 @@ XS(XS_Mob_GetTexture) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTexture(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1785,8 +1785,8 @@ XS(XS_Mob_GetHelmTexture) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHelmTexture(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1811,8 +1811,8 @@ XS(XS_Mob_GetHairColor) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHairColor(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1837,8 +1837,8 @@ XS(XS_Mob_GetBeardColor) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBeardColor(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1863,8 +1863,8 @@ XS(XS_Mob_GetEyeColor1) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEyeColor1(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1889,8 +1889,8 @@ XS(XS_Mob_GetEyeColor2) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEyeColor2(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1915,8 +1915,8 @@ XS(XS_Mob_GetHairStyle) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHairStyle(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1941,8 +1941,8 @@ XS(XS_Mob_GetLuclinFace) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLuclinFace(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1967,8 +1967,8 @@ XS(XS_Mob_GetBeard) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBeard(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1993,8 +1993,8 @@ XS(XS_Mob_GetDrakkinHeritage) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDrakkinHeritage(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2019,8 +2019,8 @@ XS(XS_Mob_GetDrakkinTattoo) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDrakkinTattoo(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2045,8 +2045,8 @@ XS(XS_Mob_GetDrakkinDetails) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDrakkinDetails(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2071,8 +2071,8 @@ XS(XS_Mob_GetClass) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClass(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2097,8 +2097,8 @@ XS(XS_Mob_GetLevel) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLevel(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2123,8 +2123,8 @@ XS(XS_Mob_GetCleanName) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCleanName(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -2148,8 +2148,8 @@ XS(XS_Mob_GetTarget) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetTarget(); ST(0) = sv_newmortal(); @@ -2174,8 +2174,8 @@ XS(XS_Mob_SetTarget) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -2183,8 +2183,8 @@ XS(XS_Mob_SetTarget) } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == NULL) - Perl_croak(aTHX_ "mob is NULL, avoiding crash."); + if(mob == nullptr) + Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); THIS->SetTarget(mob); } @@ -2208,8 +2208,8 @@ XS(XS_Mob_GetHPRatio) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHPRatio(); XSprePUSH; PUSHn((double)RETVAL); @@ -2233,8 +2233,8 @@ XS(XS_Mob_IsWarriorClass) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsWarriorClass(); ST(0) = boolSV(RETVAL); @@ -2260,8 +2260,8 @@ XS(XS_Mob_GetHP) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHP(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2286,8 +2286,8 @@ XS(XS_Mob_GetMaxHP) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxHP(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2312,8 +2312,8 @@ XS(XS_Mob_GetItemHPBonuses) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItemHPBonuses(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2338,8 +2338,8 @@ XS(XS_Mob_GetSpellHPBonuses) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpellHPBonuses(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2364,8 +2364,8 @@ XS(XS_Mob_GetWalkspeed) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWalkspeed(); XSprePUSH; PUSHn((double)RETVAL); @@ -2390,8 +2390,8 @@ XS(XS_Mob_GetRunspeed) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRunspeed(); XSprePUSH; PUSHn((double)RETVAL); @@ -2417,8 +2417,8 @@ XS(XS_Mob_GetCasterLevel) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCasterLevel(spell_id); XSprePUSH; PUSHi((IV)RETVAL); @@ -2443,8 +2443,8 @@ XS(XS_Mob_GetMaxMana) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxMana(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2469,8 +2469,8 @@ XS(XS_Mob_GetMana) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMana(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2494,8 +2494,8 @@ XS(XS_Mob_SetMana) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetMana(amount); } @@ -2519,8 +2519,8 @@ XS(XS_Mob_GetManaRatio) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetManaRatio(); XSprePUSH; PUSHn((double)RETVAL); @@ -2545,8 +2545,8 @@ XS(XS_Mob_GetAC) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAC(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2571,8 +2571,8 @@ XS(XS_Mob_GetATK) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetATK(); XSprePUSH; PUSHu((UV)RETVAL); @@ -2597,8 +2597,8 @@ XS(XS_Mob_GetSTR) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSTR(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2623,8 +2623,8 @@ XS(XS_Mob_GetSTA) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSTA(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2649,8 +2649,8 @@ XS(XS_Mob_GetDEX) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDEX(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2675,8 +2675,8 @@ XS(XS_Mob_GetAGI) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAGI(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2701,8 +2701,8 @@ XS(XS_Mob_GetINT) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetINT(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2727,8 +2727,8 @@ XS(XS_Mob_GetWIS) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWIS(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2753,8 +2753,8 @@ XS(XS_Mob_GetCHA) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCHA(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2779,8 +2779,8 @@ XS(XS_Mob_GetMR) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMR(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2805,8 +2805,8 @@ XS(XS_Mob_GetFR) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFR(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2831,8 +2831,8 @@ XS(XS_Mob_GetDR) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDR(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2857,8 +2857,8 @@ XS(XS_Mob_GetPR) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPR(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2883,8 +2883,8 @@ XS(XS_Mob_GetCR) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCR(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2909,8 +2909,8 @@ XS(XS_Mob_GetCorruption) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCorrup(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2935,8 +2935,8 @@ XS(XS_Mob_GetMaxSTR) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxSTR(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2961,8 +2961,8 @@ XS(XS_Mob_GetMaxSTA) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxSTA(); XSprePUSH; PUSHi((IV)RETVAL); @@ -2987,8 +2987,8 @@ XS(XS_Mob_GetMaxDEX) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxDEX(); XSprePUSH; PUSHi((IV)RETVAL); @@ -3013,8 +3013,8 @@ XS(XS_Mob_GetMaxAGI) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxAGI(); XSprePUSH; PUSHi((IV)RETVAL); @@ -3039,8 +3039,8 @@ XS(XS_Mob_GetMaxINT) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxINT(); XSprePUSH; PUSHi((IV)RETVAL); @@ -3065,8 +3065,8 @@ XS(XS_Mob_GetMaxWIS) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxWIS(); XSprePUSH; PUSHi((IV)RETVAL); @@ -3091,8 +3091,8 @@ XS(XS_Mob_GetMaxCHA) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxCHA(); XSprePUSH; PUSHi((IV)RETVAL); @@ -3119,8 +3119,8 @@ XS(XS_Mob_GetActSpellRange) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellRange(spell_id, range); XSprePUSH; PUSHn((double)RETVAL); @@ -3147,8 +3147,8 @@ XS(XS_Mob_GetActSpellDamage) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellDamage(spell_id, value); XSprePUSH; PUSHi((IV)RETVAL); @@ -3175,8 +3175,8 @@ XS(XS_Mob_GetActSpellHealing) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellHealing(spell_id, value); XSprePUSH; PUSHi((IV)RETVAL); @@ -3203,8 +3203,8 @@ XS(XS_Mob_GetActSpellCost) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellCost(spell_id, cost); XSprePUSH; PUSHi((IV)RETVAL); @@ -3231,8 +3231,8 @@ XS(XS_Mob_GetActSpellDuration) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellDuration(spell_id, duration); XSprePUSH; PUSHi((IV)RETVAL); @@ -3259,8 +3259,8 @@ XS(XS_Mob_GetActSpellCasttime) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetActSpellCasttime(spell_id, casttime); XSprePUSH; PUSHi((IV)RETVAL); @@ -3288,8 +3288,8 @@ XS(XS_Mob_ResistSpell) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(3), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(3))); @@ -3297,8 +3297,8 @@ XS(XS_Mob_ResistSpell) } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == NULL) - Perl_croak(aTHX_ "caster is NULL, avoiding crash."); + if(caster == nullptr) + Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); RETVAL = THIS->ResistSpell(ressit_type, spell_id, caster); XSprePUSH; PUSHn((double)RETVAL); @@ -3324,8 +3324,8 @@ XS(XS_Mob_GetSpecializeSkillValue) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpecializeSkillValue(spell_id); XSprePUSH; PUSHu((UV)RETVAL); @@ -3350,8 +3350,8 @@ XS(XS_Mob_GetNPCTypeID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCTypeID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -3375,8 +3375,8 @@ XS(XS_Mob_IsTargeted) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsTargeted(); ST(0) = boolSV(RETVAL); @@ -3402,8 +3402,8 @@ XS(XS_Mob_GetX) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetX(); XSprePUSH; PUSHn((double)RETVAL); @@ -3428,8 +3428,8 @@ XS(XS_Mob_GetY) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetY(); XSprePUSH; PUSHn((double)RETVAL); @@ -3454,8 +3454,8 @@ XS(XS_Mob_GetZ) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetZ(); XSprePUSH; PUSHn((double)RETVAL); @@ -3480,8 +3480,8 @@ XS(XS_Mob_GetHeading) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHeading(); XSprePUSH; PUSHn((double)RETVAL); @@ -3507,8 +3507,8 @@ XS(XS_Mob_GetWaypointX) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCWPX(); XSprePUSH; PUSHn((double)RETVAL); @@ -3533,8 +3533,8 @@ XS(XS_Mob_GetWaypointY) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCWPY(); XSprePUSH; PUSHn((double)RETVAL); @@ -3559,8 +3559,8 @@ XS(XS_Mob_GetWaypointZ) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCWPZ(); XSprePUSH; PUSHn((double)RETVAL); @@ -3585,8 +3585,8 @@ XS(XS_Mob_GetWaypointH) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCWPH(); XSprePUSH; PUSHn((double)RETVAL); @@ -3611,8 +3611,8 @@ XS(XS_Mob_GetWaypointPause) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCWPP(); XSprePUSH; PUSHu((UV)RETVAL); @@ -3637,8 +3637,8 @@ XS(XS_Mob_GetWaypointID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCWP(); XSprePUSH; PUSHu((UV)RETVAL); @@ -3662,8 +3662,8 @@ XS(XS_Mob_SetCurrentWP) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetCurrentWP(waypoint); } @@ -3687,8 +3687,8 @@ XS(XS_Mob_GetSize) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSize(); XSprePUSH; PUSHn((double)RETVAL); @@ -3712,8 +3712,8 @@ XS(XS_Mob_SetFollowID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFollowID(id); } @@ -3737,8 +3737,8 @@ XS(XS_Mob_GetFollowID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFollowID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -3763,8 +3763,8 @@ XS(XS_Mob_Message) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Message(type, message); } @@ -3789,8 +3789,8 @@ XS(XS_Mob_Message_StringID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) distance = 0; @@ -3819,8 +3819,8 @@ XS(XS_Mob_Say) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Say(format); } @@ -3843,8 +3843,8 @@ XS(XS_Mob_Shout) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Shout(format); } @@ -3867,8 +3867,8 @@ XS(XS_Mob_Emote) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Emote(format); } @@ -3891,8 +3891,8 @@ XS(XS_Mob_InterruptSpell) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) spellid = 0xFFFF; @@ -3925,8 +3925,8 @@ XS(XS_Mob_CastSpell) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) slot = 10; @@ -3969,8 +3969,8 @@ XS(XS_Mob_SpellFinished) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); spell_target = THIS; @@ -3982,8 +3982,8 @@ XS(XS_Mob_SpellFinished) } else Perl_croak(aTHX_ "spell_target is not of type Mob"); - if(spell_target == NULL) - Perl_croak(aTHX_ "spell_target is NULL, avoiding crash."); + if(spell_target == nullptr) + Perl_croak(aTHX_ "spell_target is nullptr, avoiding crash."); } @@ -4013,8 +4013,8 @@ XS(XS_Mob_IsImmuneToSpell) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(2))); @@ -4022,8 +4022,8 @@ XS(XS_Mob_IsImmuneToSpell) } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == NULL) - Perl_croak(aTHX_ "caster is NULL, avoiding crash."); + if(caster == nullptr) + Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); RETVAL = THIS->IsImmuneToSpell(spell_id, caster); ST(0) = boolSV(RETVAL); @@ -4048,8 +4048,8 @@ XS(XS_Mob_BuffFadeBySpellID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->BuffFadeBySpellID(spell_id); } @@ -4073,8 +4073,8 @@ XS(XS_Mob_BuffFadeByEffect) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) skipslot = -1; @@ -4102,8 +4102,8 @@ XS(XS_Mob_BuffFadeAll) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->BuffFadeAll(); } @@ -4127,8 +4127,8 @@ XS(XS_Mob_BuffFadeBySlot) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) iRecalcBonuses = true; @@ -4161,8 +4161,8 @@ XS(XS_Mob_CanBuffStack) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 4) iFailIfOverwrite = false; @@ -4192,8 +4192,8 @@ XS(XS_Mob_IsCasting) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsCasting(); ST(0) = boolSV(RETVAL); @@ -4219,8 +4219,8 @@ XS(XS_Mob_CastingSpellID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CastingSpellID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4245,8 +4245,8 @@ XS(XS_Mob_SetAppearance) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) iIgnoreSelf = true; @@ -4276,8 +4276,8 @@ XS(XS_Mob_GetAppearance) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAppearance(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4302,8 +4302,8 @@ XS(XS_Mob_GetRunAnimSpeed) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetRunAnimSpeed(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4327,8 +4327,8 @@ XS(XS_Mob_SetRunAnimSpeed) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetRunAnimSpeed(in); } @@ -4351,8 +4351,8 @@ XS(XS_Mob_SetPetID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPetID(NewPetID); } @@ -4376,8 +4376,8 @@ XS(XS_Mob_GetPetID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPetID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4401,8 +4401,8 @@ XS(XS_Mob_SetOwnerID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetOwnerID(NewOwnerID); } @@ -4426,8 +4426,8 @@ XS(XS_Mob_GetOwnerID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetOwnerID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4452,8 +4452,8 @@ XS(XS_Mob_GetPetType) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPetType(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4478,8 +4478,8 @@ XS(XS_Mob_GetBodyType) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetBodyType(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4503,8 +4503,8 @@ XS(XS_Mob_Stun) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Stun(duration); } @@ -4526,8 +4526,8 @@ XS(XS_Mob_Spin) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Spin(); } @@ -4549,8 +4549,8 @@ XS(XS_Mob_Kill) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Kill(); } @@ -4573,8 +4573,8 @@ XS(XS_Mob_SetInvul) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetInvul(invul); } @@ -4597,8 +4597,8 @@ XS(XS_Mob_GetInvul) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetInvul(); ST(0) = boolSV(RETVAL); @@ -4623,8 +4623,8 @@ XS(XS_Mob_SetExtraHaste) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetExtraHaste(Haste); } @@ -4648,8 +4648,8 @@ XS(XS_Mob_GetHaste) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHaste(); XSprePUSH; PUSHi((IV)RETVAL); @@ -4674,8 +4674,8 @@ XS(XS_Mob_GetMonkHandToHandDamage) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMonkHandToHandDamage(); XSprePUSH; PUSHi((IV)RETVAL); @@ -4699,8 +4699,8 @@ XS(XS_Mob_CanThisClassDoubleAttack) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassDoubleAttack(); ST(0) = boolSV(RETVAL); @@ -4725,8 +4725,8 @@ XS(XS_Mob_CanThisClassDualWield) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassDualWield(); ST(0) = boolSV(RETVAL); @@ -4751,8 +4751,8 @@ XS(XS_Mob_CanThisClassRiposte) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassRiposte(); ST(0) = boolSV(RETVAL); @@ -4777,8 +4777,8 @@ XS(XS_Mob_CanThisClassDodge) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassDodge(); ST(0) = boolSV(RETVAL); @@ -4803,8 +4803,8 @@ XS(XS_Mob_CanThisClassParry) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CanThisClassParry(); ST(0) = boolSV(RETVAL); @@ -4830,8 +4830,8 @@ XS(XS_Mob_GetMonkHandToHandDelay) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMonkHandToHandDelay(); XSprePUSH; PUSHi((IV)RETVAL); @@ -4856,8 +4856,8 @@ XS(XS_Mob_GetClassLevelFactor) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClassLevelFactor(); XSprePUSH; PUSHu((UV)RETVAL); @@ -4880,8 +4880,8 @@ XS(XS_Mob_Mesmerize) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Mesmerize(); } @@ -4904,8 +4904,8 @@ XS(XS_Mob_IsMezzed) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMezzed(); ST(0) = boolSV(RETVAL); @@ -4930,8 +4930,8 @@ XS(XS_Mob_IsStunned) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsStunned(); ST(0) = boolSV(RETVAL); @@ -4956,8 +4956,8 @@ XS(XS_Mob_StartEnrage) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StartEnrage(); } @@ -4980,8 +4980,8 @@ XS(XS_Mob_IsEnraged) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsEnraged(); ST(0) = boolSV(RETVAL); @@ -5008,8 +5008,8 @@ XS(XS_Mob_GetReverseFactionCon) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -5017,8 +5017,8 @@ XS(XS_Mob_GetReverseFactionCon) } else Perl_croak(aTHX_ "iOther is not of type Mob"); - if(iOther == NULL) - Perl_croak(aTHX_ "iOther is NULL, avoiding crash."); + if(iOther == nullptr) + Perl_croak(aTHX_ "iOther is nullptr, avoiding crash."); RETVAL = THIS->GetReverseFactionCon(iOther); XSprePUSH; PUSHi((IV)RETVAL); @@ -5042,8 +5042,8 @@ XS(XS_Mob_IsAIControlled) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsAIControlled(); ST(0) = boolSV(RETVAL); @@ -5069,8 +5069,8 @@ XS(XS_Mob_GetAggroRange) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAggroRange(); XSprePUSH; PUSHn((double)RETVAL); @@ -5095,8 +5095,8 @@ XS(XS_Mob_GetAssistRange) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAssistRange(); XSprePUSH; PUSHn((double)RETVAL); @@ -5120,8 +5120,8 @@ XS(XS_Mob_SetPetOrder) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPetOrder(i); } @@ -5145,8 +5145,8 @@ XS(XS_Mob_GetPetOrder) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPetOrder(); XSprePUSH; PUSHi((IV)RETVAL); @@ -5170,8 +5170,8 @@ XS(XS_Mob_IsRoamer) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRoamer(); ST(0) = boolSV(RETVAL); @@ -5196,8 +5196,8 @@ XS(XS_Mob_IsRooted) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRooted(); ST(0) = boolSV(RETVAL); @@ -5227,8 +5227,8 @@ XS(XS_Mob_AddToHateList) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -5236,8 +5236,8 @@ XS(XS_Mob_AddToHateList) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); if (items < 3) hate = 0; @@ -5292,8 +5292,8 @@ XS(XS_Mob_SetHate) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -5301,8 +5301,8 @@ XS(XS_Mob_SetHate) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); if (items < 3) hate = 0; @@ -5340,8 +5340,8 @@ XS(XS_Mob_GetHateAmount) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -5349,8 +5349,8 @@ XS(XS_Mob_GetHateAmount) } else Perl_croak(aTHX_ "tmob is not of type Mob"); - if(tmob == NULL) - Perl_croak(aTHX_ "tmob is NULL, avoiding crash."); + if(tmob == nullptr) + Perl_croak(aTHX_ "tmob is nullptr, avoiding crash."); if (items < 3) is_dam = false; @@ -5382,8 +5382,8 @@ XS(XS_Mob_GetDamageAmount) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -5391,8 +5391,8 @@ XS(XS_Mob_GetDamageAmount) } else Perl_croak(aTHX_ "tmob is not of type Mob"); - if(tmob == NULL) - Perl_croak(aTHX_ "tmob is NULL, avoiding crash."); + if(tmob == nullptr) + Perl_croak(aTHX_ "tmob is nullptr, avoiding crash."); RETVAL = THIS->GetDamageAmount(tmob); XSprePUSH; PUSHu((UV)RETVAL); @@ -5416,8 +5416,8 @@ XS(XS_Mob_GetHateTop) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHateTop(); ST(0) = sv_newmortal(); @@ -5443,8 +5443,8 @@ XS(XS_Mob_GetHateDamageTop) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -5452,8 +5452,8 @@ XS(XS_Mob_GetHateDamageTop) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); RETVAL = THIS->GetHateDamageTop(other); ST(0) = sv_newmortal(); @@ -5478,8 +5478,8 @@ XS(XS_Mob_GetHateRandom) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHateRandom(); ST(0) = sv_newmortal(); @@ -5504,8 +5504,8 @@ XS(XS_Mob_IsEngaged) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsEngaged(); ST(0) = boolSV(RETVAL); @@ -5530,8 +5530,8 @@ XS(XS_Mob_HateSummon) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HateSummon(); ST(0) = boolSV(RETVAL); @@ -5556,8 +5556,8 @@ XS(XS_Mob_FaceTarget) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) MobToFace = 0; @@ -5568,8 +5568,8 @@ XS(XS_Mob_FaceTarget) } else Perl_croak(aTHX_ "MobToFace is not of type Mob"); - if(MobToFace == NULL) - Perl_croak(aTHX_ "MobToFace is NULL, avoiding crash."); + if(MobToFace == nullptr) + Perl_croak(aTHX_ "MobToFace is nullptr, avoiding crash."); } THIS->FaceTarget(MobToFace); @@ -5593,8 +5593,8 @@ XS(XS_Mob_SetHeading) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetHeading(iHeading); } @@ -5616,8 +5616,8 @@ XS(XS_Mob_WipeHateList) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->WipeHateList(); } @@ -5641,8 +5641,8 @@ XS(XS_Mob_CheckAggro) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -5650,8 +5650,8 @@ XS(XS_Mob_CheckAggro) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); RETVAL = THIS->CheckAggro(other); ST(0) = boolSV(RETVAL); @@ -5679,8 +5679,8 @@ XS(XS_Mob_CalculateHeadingToTarget) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CalculateHeadingToTarget(in_x, in_y); XSprePUSH; PUSHi((IV)RETVAL); @@ -5709,8 +5709,8 @@ XS(XS_Mob_CalculateNewPosition) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 6) checkZ = false; @@ -5746,8 +5746,8 @@ XS(XS_Mob_CalculateNewPosition2) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 6) checkZ = false; @@ -5782,8 +5782,8 @@ XS(XS_Mob_CalculateDistance) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CalculateDistance(x, y, z); XSprePUSH; PUSHn((double)RETVAL); @@ -5809,8 +5809,8 @@ XS(XS_Mob_SendTo) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendTo(new_x, new_y, new_z); } @@ -5835,8 +5835,8 @@ XS(XS_Mob_SendToFixZ) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendToFixZ(new_x, new_y, new_z); } @@ -5862,8 +5862,8 @@ XS(XS_Mob_NPCSpecialAttacks) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->NPCSpecialAttacks(parse, permtag, reset, remove); } @@ -5887,8 +5887,8 @@ XS(XS_Mob_DontHealMeBefore) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontHealMeBefore(); XSprePUSH; PUSHu((UV)RETVAL); @@ -5913,8 +5913,8 @@ XS(XS_Mob_DontBuffMeBefore) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontBuffMeBefore(); XSprePUSH; PUSHu((UV)RETVAL); @@ -5939,8 +5939,8 @@ XS(XS_Mob_DontDotMeBefore) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontDotMeBefore(); XSprePUSH; PUSHu((UV)RETVAL); @@ -5965,8 +5965,8 @@ XS(XS_Mob_DontRootMeBefore) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontRootMeBefore(); XSprePUSH; PUSHu((UV)RETVAL); @@ -5991,8 +5991,8 @@ XS(XS_Mob_DontSnareMeBefore) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DontSnareMeBefore(); XSprePUSH; PUSHu((UV)RETVAL); @@ -6018,8 +6018,8 @@ XS(XS_Mob_GetResist) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetResist(type); XSprePUSH; PUSHi((IV)RETVAL); @@ -6043,8 +6043,8 @@ XS(XS_Mob_GetShieldTarget) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetShieldTarget(); ST(0) = sv_newmortal(); @@ -6069,8 +6069,8 @@ XS(XS_Mob_SetShieldTarget) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -6078,8 +6078,8 @@ XS(XS_Mob_SetShieldTarget) } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == NULL) - Perl_croak(aTHX_ "mob is NULL, avoiding crash."); + if(mob == nullptr) + Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); THIS->SetShieldTarget(mob); } @@ -6102,8 +6102,8 @@ XS(XS_Mob_Charmed) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Charmed(); ST(0) = boolSV(RETVAL); @@ -6130,8 +6130,8 @@ XS(XS_Mob_GetLevelHP) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLevelHP(tlevel); XSprePUSH; PUSHu((UV)RETVAL); @@ -6156,8 +6156,8 @@ XS(XS_Mob_GetZoneID) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetZoneID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -6183,8 +6183,8 @@ XS(XS_Mob_CheckAggroAmount) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CheckAggroAmount(spellid); XSprePUSH; PUSHu((UV)RETVAL); @@ -6211,8 +6211,8 @@ XS(XS_Mob_CheckHealAggroAmount) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(items == 3) { @@ -6243,8 +6243,8 @@ XS(XS_Mob_GetAA) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAA(aa_id); XSprePUSH; PUSHu((UV)RETVAL); @@ -6268,8 +6268,8 @@ XS(XS_Mob_DivineAura) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->DivineAura(); ST(0) = boolSV(RETVAL); @@ -6294,8 +6294,8 @@ XS(XS_Mob_AddFeignMemory) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -6303,8 +6303,8 @@ XS(XS_Mob_AddFeignMemory) } else Perl_croak(aTHX_ "attacker is not of type Client"); - if(attacker == NULL) - Perl_croak(aTHX_ "attacker is NULL, avoiding crash."); + if(attacker == nullptr) + Perl_croak(aTHX_ "attacker is nullptr, avoiding crash."); THIS->AddFeignMemory(attacker); } @@ -6327,8 +6327,8 @@ XS(XS_Mob_RemoveFromFeignMemory) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -6336,8 +6336,8 @@ XS(XS_Mob_RemoveFromFeignMemory) } else Perl_croak(aTHX_ "attacker is not of type Client"); - if(attacker == NULL) - Perl_croak(aTHX_ "attacker is NULL, avoiding crash."); + if(attacker == nullptr) + Perl_croak(aTHX_ "attacker is nullptr, avoiding crash."); THIS->RemoveFromFeignMemory(attacker); } @@ -6359,8 +6359,8 @@ XS(XS_Mob_ClearFeignMemory) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearFeignMemory(); } @@ -6383,8 +6383,8 @@ XS(XS_Mob_SetOOCRegen) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetOOCRegen(newoocregen); } @@ -6409,8 +6409,8 @@ XS(XS_Mob_GetEntityVariable) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEntityVariable(id); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -6435,8 +6435,8 @@ XS(XS_Mob_EntityVariableExists) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->EntityVariableExists(id); ST(0) = boolSV(RETVAL); @@ -6462,8 +6462,8 @@ XS(XS_Mob_SetEntityVariable) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetEntityVariable(id, var); } @@ -6487,8 +6487,8 @@ XS(XS_Mob_GetHateList) else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::list hate_list; THIS->GetHateList(hate_list); @@ -6522,8 +6522,8 @@ XS(XS_Mob_GetHateList) else Perl_croak(aTHX_ "THIS is not of type EntityList"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); std::list corpse_list = entity_list.GetCorpseList(); std::list::iterator iter = corpse_list.begin(); @@ -6549,7 +6549,7 @@ XS(XS_Mob_SignalClient) Perl_croak(aTHX_ "Usage: Mob::SignalClient(THIS, client, data)"); { Mob * THIS; - Client* client = NULL; + Client* client = nullptr; uint32 data = (uint32)SvUV(ST(2)); if (sv_derived_from(ST(0), "Mob")) { @@ -6558,8 +6558,8 @@ XS(XS_Mob_SignalClient) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -6567,8 +6567,8 @@ XS(XS_Mob_SignalClient) } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == NULL) - Perl_croak(aTHX_ "client is NULL, avoiding crash."); + if(client == nullptr) + Perl_croak(aTHX_ "client is nullptr, avoiding crash."); client->Signal(data); } @@ -6583,7 +6583,7 @@ XS(XS_Mob_CombatRange) Perl_croak(aTHX_ "Usage: Mob::CombatRange(THIS, target)"); { Mob * THIS; - Mob * target = NULL; + Mob * target = nullptr; bool RETVAL; if (sv_derived_from(ST(0), "Mob")) { @@ -6592,8 +6592,8 @@ XS(XS_Mob_CombatRange) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -6601,8 +6601,8 @@ XS(XS_Mob_CombatRange) } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == NULL) - Perl_croak(aTHX_ "target is NULL, avoiding crash."); + if(target == nullptr) + Perl_croak(aTHX_ "target is nullptr, avoiding crash."); RETVAL = THIS->CombatRange(target); ST(0) = boolSV(RETVAL); @@ -6631,8 +6631,8 @@ XS(XS_Mob_DoSpecialAttackDamage) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -6640,8 +6640,8 @@ XS(XS_Mob_DoSpecialAttackDamage) } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == NULL) - Perl_croak(aTHX_ "target is NULL, avoiding crash."); + if(target == nullptr) + Perl_croak(aTHX_ "target is nullptr, avoiding crash."); if (items > 4) { @@ -6675,8 +6675,8 @@ XS(XS_Mob_CheckLoS) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -6684,8 +6684,8 @@ XS(XS_Mob_CheckLoS) } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == NULL) - Perl_croak(aTHX_ "mob is NULL, avoiding crash."); + if(mob == nullptr) + Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); RETVAL = THIS->CheckLosFN(mob); ST(0) = boolSV(RETVAL); @@ -6721,8 +6721,8 @@ XS(XS_Mob_CheckLoSToLoc) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CheckLosFN(loc_x, loc_y, loc_z, mob_size); ST(0) = boolSV(RETVAL); @@ -6758,8 +6758,8 @@ XS(XS_Mob_FindGroundZ) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroundZ(new_x, new_y, z_offset); XSprePUSH; PUSHn((double)RETVAL); @@ -6790,8 +6790,8 @@ XS(XS_Mob_ProjectileAnim) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -6799,8 +6799,8 @@ XS(XS_Mob_ProjectileAnim) } else Perl_croak(aTHX_ "mob is not of type Mob"); - if(mob == NULL) - Perl_croak(aTHX_ "mob is NULL, avoiding crash."); + if(mob == nullptr) + Perl_croak(aTHX_ "mob is nullptr, avoiding crash."); if(items > 3){ IsArrow = (bool)SvTRUE(ST(3)); @@ -6841,8 +6841,8 @@ XS(XS_Mob_HasNPCSpecialAtk) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->HasNPCSpecialAtk(parse); ST(0) = boolSV(RETVAL); @@ -6864,7 +6864,7 @@ XS(XS_Mob_SendAppearanceEffect) int32 parm3 = 0; int32 parm4 = 0; int32 parm5 = 0; - Client* client = NULL; + Client* client = nullptr; if (sv_derived_from(ST(0), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -6872,8 +6872,8 @@ XS(XS_Mob_SendAppearanceEffect) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) { parm2 = (int32)SvIV(ST(2)); } if (items > 3) { parm3 = (int32)SvIV(ST(3)); } @@ -6886,8 +6886,8 @@ XS(XS_Mob_SendAppearanceEffect) } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == NULL) - Perl_croak(aTHX_ "client is NULL, avoiding crash."); + if(client == nullptr) + Perl_croak(aTHX_ "client is nullptr, avoiding crash."); } THIS->SendAppearanceEffect(parm1, parm2, parm3, parm4, parm5, client); @@ -6903,7 +6903,7 @@ XS(XS_Mob_QuestReward) Perl_croak(aTHX_ "Usage: Mob::QuestReward(THIS, client, silver, gold, platinum)"); { Mob * THIS; - Client* client = NULL; + Client* client = nullptr; int32 silver = 0; int32 gold = 0; int32 platinum = 0; @@ -6914,8 +6914,8 @@ XS(XS_Mob_QuestReward) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 1) { if (sv_derived_from(ST(1), "Client")) { @@ -6924,8 +6924,8 @@ XS(XS_Mob_QuestReward) } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == NULL) - Perl_croak(aTHX_ "client is NULL, avoiding crash."); + if(client == nullptr) + Perl_croak(aTHX_ "client is nullptr, avoiding crash."); } if (items > 2) { silver = (int32)SvIV(ST(2)); } if (items > 3) { gold = (int32)SvIV(ST(3)); } @@ -6952,8 +6952,8 @@ XS(XS_Mob_SetFlyMode) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFlyMode(flymode); } @@ -6976,8 +6976,8 @@ XS(XS_Mob_SetTexture) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendIllusionPacket(THIS->GetRace(), 0xFF, texture); } @@ -7000,8 +7000,8 @@ XS(XS_Mob_SetRace) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendIllusionPacket(race); } @@ -7024,8 +7024,8 @@ XS(XS_Mob_SetGender) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendIllusionPacket(THIS->GetRace(),gender); } @@ -7060,8 +7060,8 @@ XS(XS_Mob_SendIllusion) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(items > 2) {gender = (uint8)SvIV(ST(2));} if(items > 3) {texture = (uint8)SvIV(ST(3));} @@ -7092,7 +7092,7 @@ XS(XS_Mob_CameraEffect) Mob * THIS; uint32 duration = (uint32)SvUV(ST(1)); uint32 intensity = 0; - Client* client = NULL; + Client* client = nullptr; bool global = false; bool nullcli = false; @@ -7102,8 +7102,8 @@ XS(XS_Mob_CameraEffect) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) { intensity = (uint32)SvUV(ST(2)); } if (items > 3) { @@ -7113,9 +7113,9 @@ XS(XS_Mob_CameraEffect) } else nullcli = true; - if(client == NULL) + if(client == nullptr) nullcli = true; - //Perl_croak(aTHX_ "client is NULL, avoiding crash."); + //Perl_croak(aTHX_ "client is nullptr, avoiding crash."); } if (items > 4) { global = (bool)SvTRUE(ST(4)); } @@ -7141,7 +7141,7 @@ XS(XS_Mob_SpellEffect) bool zone_wide = true; uint32 unk20 = 3000; bool perm_effect = false; - Client* client = NULL; + Client* client = nullptr; if (sv_derived_from(ST(0), "Mob")) { @@ -7150,8 +7150,8 @@ XS(XS_Mob_SpellEffect) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) { duration = (uint32)SvUV(ST(2)); } if (items > 3) { finish_delay = (uint32)SvUV(ST(3)); } @@ -7165,8 +7165,8 @@ XS(XS_Mob_SpellEffect) } else Perl_croak(aTHX_ "client is not of type Client"); - if(client == NULL) - Perl_croak(aTHX_ "client is NULL, avoiding crash."); + if(client == nullptr) + Perl_croak(aTHX_ "client is nullptr, avoiding crash."); } @@ -7184,7 +7184,7 @@ XS(XS_Mob_TempName) Perl_croak(aTHX_ "Usage: Mob::TempName(THIS, name)"); { Mob * THIS; - char * name = NULL; + char * name = nullptr; if (sv_derived_from(ST(0), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -7192,8 +7192,8 @@ XS(XS_Mob_TempName) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 1) { name = (char *)SvPV_nolen(ST(1)); } @@ -7221,8 +7221,8 @@ XS(XS_Mob_GetItemStat) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItemStat(itemid, stat); XSprePUSH; PUSHu((UV)RETVAL); @@ -7235,14 +7235,14 @@ XS(XS_Mob_SetGlobal) { dXSARGS; if (items < 5 || items > 6) - Perl_croak(aTHX_ "Usage: SetGlobal(THIS, varname, newvalue, options, duration, other=NULL)"); + Perl_croak(aTHX_ "Usage: SetGlobal(THIS, varname, newvalue, options, duration, other=nullptr)"); { Mob * THIS; char * varname = (char *)SvPV_nolen(ST(1)); char * newvalue = (char *)SvPV_nolen(ST(2)); int options = (int)SvIV(ST(3)); char * duration = (char *)SvPV_nolen(ST(4)); - Mob * other = NULL; + Mob * other = nullptr; if (sv_derived_from(ST(0), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -7250,8 +7250,8 @@ XS(XS_Mob_SetGlobal) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 5) { if (sv_derived_from(ST(5), "Mob")) { @@ -7260,8 +7260,8 @@ XS(XS_Mob_SetGlobal) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); } THIS->SetGlobal(varname, newvalue, options, duration, other); @@ -7290,8 +7290,8 @@ XS(XS_Mob_TarGlobal) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->TarGlobal(varname, value, duration, npcid, charid, zoneid); } @@ -7314,8 +7314,8 @@ XS(XS_Mob_DelGlobal) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->DelGlobal(varname); } @@ -7341,8 +7341,8 @@ XS(XS_Mob_SetSlotTint) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSlotTint(material_slot, red_tint, green_tint, blue_tint); } @@ -7367,8 +7367,8 @@ XS(XS_Mob_WearChange) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 3) { color = (uint32)SvUV(ST(3)); @@ -7397,8 +7397,8 @@ XS(XS_Mob_DoKnockback) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -7406,8 +7406,8 @@ XS(XS_Mob_DoKnockback) } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == NULL) - Perl_croak(aTHX_ "caster is NULL, avoiding crash."); + if(caster == nullptr) + Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); THIS->DoKnockback(caster, pushback, pushup); } @@ -7430,8 +7430,8 @@ XS(XS_Mob_RemoveNimbusEffect) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveNimbusEffect(effectid); } @@ -7454,8 +7454,8 @@ XS(XS_Mob_SetRunning) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetRunning(value); } @@ -7479,8 +7479,8 @@ XS(XS_Mob_IsRunning) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRunning(); ST(0) = boolSV(RETVAL); @@ -7506,8 +7506,8 @@ XS(XS_Mob_SetBodyType) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if(items == 3) { overwrite_orig = (bool)SvTRUE(ST(2)); @@ -7537,8 +7537,8 @@ XS(XS_Mob_SetDeltas) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDeltas(delta_x, delta_y, delta_z, delta_h); } @@ -7561,8 +7561,8 @@ XS(XS_Mob_SetLD) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendAppearancePacket(AT_Linkdead, value); } @@ -7585,8 +7585,8 @@ XS(XS_Mob_SetTargetDestSteps) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTargetDestSteps(target_steps); } @@ -7609,8 +7609,8 @@ XS(XS_Mob_SetTargetable) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTargetable(on); } @@ -7634,8 +7634,8 @@ XS(XS_Mob_ModSkillDmgTaken) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ModSkillDmgTaken(skill_num,value); } @@ -7660,8 +7660,8 @@ XS(XS_Mob_GetModSkillDmgTaken) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetModSkillDmgTaken(skill_num); XSprePUSH; PUSHu((UV)RETVAL); @@ -7687,8 +7687,8 @@ XS(XS_Mob_GetSkillDmgTaken) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSkillDmgTaken(skill_num); XSprePUSH; PUSHu((UV)RETVAL); @@ -7712,8 +7712,8 @@ XS(XS_Mob_SetAllowBeneficial) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetAllowBeneficial(value); } @@ -7736,8 +7736,8 @@ XS(XS_Mob_GetAllowBeneficial) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAllowBeneficial(); ST(0) = boolSV(RETVAL); @@ -7764,8 +7764,8 @@ XS(XS_Mob_IsBeneficialAllowed) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -7773,8 +7773,8 @@ XS(XS_Mob_IsBeneficialAllowed) } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == NULL) - Perl_croak(aTHX_ "target is NULL, avoiding crash."); + if(target == nullptr) + Perl_croak(aTHX_ "target is nullptr, avoiding crash."); RETVAL = THIS->IsBeneficialAllowed(target); ST(0) = boolSV(RETVAL); @@ -7800,8 +7800,8 @@ XS(XS_Mob_ModVulnerability) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ModVulnerability(resist, value); } @@ -7826,8 +7826,8 @@ XS(XS_Mob_GetModVulnerability) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetModVulnerability(resist); XSprePUSH; PUSHi((IV)RETVAL); @@ -7856,8 +7856,8 @@ XS(XS_Mob_DoMeleeSkillAttackDmg) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -7865,8 +7865,8 @@ XS(XS_Mob_DoMeleeSkillAttackDmg) } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == NULL) - Perl_croak(aTHX_ "target is NULL, avoiding crash."); + if(target == nullptr) + Perl_croak(aTHX_ "target is nullptr, avoiding crash."); THIS->DoMeleeSkillAttackDmg(target, weapon_damage, skill, chance_mod, focus, CanRiposte); } @@ -7878,12 +7878,12 @@ XS(XS_Mob_DoArcheryAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Mob::DoArcheryAttackDmg(THIS, target, RangeWeapon=NULL, Ammo=NULL, weapon_damage, chance_mod, focus)"); + Perl_croak(aTHX_ "Usage: Mob::DoArcheryAttackDmg(THIS, target, RangeWeapon=nullptr, Ammo=nullptr, weapon_damage, chance_mod, focus)"); { Mob * THIS; Mob* target; - ItemInst* RangeWeapon = NULL; - ItemInst* Ammo = NULL; + ItemInst* RangeWeapon = nullptr; + ItemInst* Ammo = nullptr; uint16 weapon_damage = (uint16)SvIV(ST(4)); int16 chance_mod = (int16)SvIV(ST(5)); int16 focus = (int16)SvIV(ST(6)); @@ -7894,8 +7894,8 @@ XS(XS_Mob_DoArcheryAttackDmg) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -7903,8 +7903,8 @@ XS(XS_Mob_DoArcheryAttackDmg) } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == NULL) - Perl_croak(aTHX_ "target is NULL, avoiding crash."); + if(target == nullptr) + Perl_croak(aTHX_ "target is nullptr, avoiding crash."); THIS->DoArcheryAttackDmg(target, RangeWeapon, Ammo, weapon_damage, chance_mod, focus); } @@ -7916,12 +7916,12 @@ XS(XS_Mob_DoThrowingAttackDmg) { dXSARGS; if (items != 7) - Perl_croak(aTHX_ "Usage: Mob::DoThrowingAttackDmg(THIS, target, RangeWeapon=NULL,item=NULL,weapon_damage, chance_mod, focus)"); + Perl_croak(aTHX_ "Usage: Mob::DoThrowingAttackDmg(THIS, target, RangeWeapon=nullptr,item=nullptr,weapon_damage, chance_mod, focus)"); { Mob * THIS; Mob* target; - ItemInst* RangeWeapon = NULL; - Item_Struct* item = NULL; + ItemInst* RangeWeapon = nullptr; + Item_Struct* item = nullptr; uint16 weapon_damage = (uint16)SvIV(ST(4)); int16 chance_mod = (int16)SvIV(ST(5)); int16 focus = (int16)SvIV(ST(6)); @@ -7932,8 +7932,8 @@ XS(XS_Mob_DoThrowingAttackDmg) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -7941,8 +7941,8 @@ XS(XS_Mob_DoThrowingAttackDmg) } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == NULL) - Perl_croak(aTHX_ "target is NULL, avoiding crash."); + if(target == nullptr) + Perl_croak(aTHX_ "target is nullptr, avoiding crash."); THIS->DoThrowingAttackDmg(target, RangeWeapon, item, weapon_damage, chance_mod, focus); } @@ -7965,8 +7965,8 @@ XS(XS_Mob_SetDisableMelee) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetDisableMelee(value); } @@ -7989,8 +7989,8 @@ XS(XS_Mob_IsMeleeDisabled) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsMeleeDisabled(); ST(0) = boolSV(RETVAL); @@ -8015,8 +8015,8 @@ XS(XS_Mob_SetFlurryChance) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFlurryChance(value); } @@ -8040,8 +8040,8 @@ XS(XS_Mob_GetFlurryChance) } else Perl_croak(aTHX_ "THIS is not of type Mob"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFlurryChance(); XSprePUSH; PUSHu((UV)RETVAL); @@ -8352,4 +8352,4 @@ XS(boot_Mob) XSRETURN_YES; } -#endif //EMBPERL_XS_CLASSES \ No newline at end of file +#endif //EMBPERL_XS_CLASSES diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index fc0177cd4..aa78fe535 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -59,8 +59,8 @@ XS(XS_NPC_SignalNPC) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SignalNPC(_signal_id); } @@ -85,8 +85,8 @@ XS(XS_NPC_CheckNPCFactionAlly) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CheckNPCFactionAlly(other_faction); XSprePUSH; PUSHi((IV)RETVAL); @@ -112,8 +112,8 @@ XS(XS_NPC_AddItem) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 2) charges = (uint16)SvUV(ST(2)); @@ -140,8 +140,8 @@ XS(XS_NPC_AddLootTable) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddLootTable(); } @@ -166,8 +166,8 @@ XS(XS_NPC_RemoveItem) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 3) quantity = 0; @@ -201,8 +201,8 @@ XS(XS_NPC_ClearItemList) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearItemList(); } @@ -228,8 +228,8 @@ XS(XS_NPC_AddCash) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddCash(in_copper, in_silver, in_gold, in_platinum); } @@ -251,8 +251,8 @@ XS(XS_NPC_RemoveCash) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveCash(); } @@ -276,8 +276,8 @@ XS(XS_NPC_CountLoot) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->CountLoot(); XSprePUSH; PUSHu((UV)RETVAL); @@ -302,8 +302,8 @@ XS(XS_NPC_GetLoottableID) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLoottableID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -328,8 +328,8 @@ XS(XS_NPC_GetCopper) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCopper(); XSprePUSH; PUSHu((UV)RETVAL); @@ -354,8 +354,8 @@ XS(XS_NPC_GetSilver) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSilver(); XSprePUSH; PUSHu((UV)RETVAL); @@ -380,8 +380,8 @@ XS(XS_NPC_GetGold) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGold(); XSprePUSH; PUSHu((UV)RETVAL); @@ -406,8 +406,8 @@ XS(XS_NPC_GetPlatinum) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPlatinum(); XSprePUSH; PUSHu((UV)RETVAL); @@ -431,8 +431,8 @@ XS(XS_NPC_SetCopper) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetCopper(amt); } @@ -455,8 +455,8 @@ XS(XS_NPC_SetSilver) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSilver(amt); } @@ -479,8 +479,8 @@ XS(XS_NPC_SetGold) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetGold(amt); } @@ -503,8 +503,8 @@ XS(XS_NPC_SetPlatinum) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPlatinum(amt); } @@ -527,8 +527,8 @@ XS(XS_NPC_SetGrid) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetGrid(grid_); } @@ -551,8 +551,8 @@ XS(XS_NPC_SetSaveWaypoint) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSaveWaypoint(waypoint); } @@ -575,8 +575,8 @@ XS(XS_NPC_SetSp2) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSp2(sg2); } @@ -600,8 +600,8 @@ XS(XS_NPC_GetWaypointMax) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetWaypointMax(); XSprePUSH; PUSHu((UV)RETVAL); @@ -626,8 +626,8 @@ XS(XS_NPC_GetGrid) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGrid(); XSprePUSH; PUSHi((IV)RETVAL); @@ -652,8 +652,8 @@ XS(XS_NPC_GetSp2) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSp2(); XSprePUSH; PUSHu((UV)RETVAL); @@ -678,8 +678,8 @@ XS(XS_NPC_GetNPCFactionID) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCFactionID(); XSprePUSH; PUSHi((IV)RETVAL); @@ -704,8 +704,8 @@ XS(XS_NPC_GetPrimaryFaction) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPrimaryFaction(); XSprePUSH; PUSHi((IV)RETVAL); @@ -731,8 +731,8 @@ XS(XS_NPC_GetNPCHate) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -740,8 +740,8 @@ XS(XS_NPC_GetNPCHate) } else Perl_croak(aTHX_ "in_ent is not of type Mob"); - if(in_ent == NULL) - Perl_croak(aTHX_ "in_ent is NULL, avoiding crash."); + if(in_ent == nullptr) + Perl_croak(aTHX_ "in_ent is nullptr, avoiding crash."); RETVAL = THIS->GetNPCHate(in_ent); XSprePUSH; PUSHi((IV)RETVAL); @@ -766,8 +766,8 @@ XS(XS_NPC_IsOnHatelist) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -775,8 +775,8 @@ XS(XS_NPC_IsOnHatelist) } else Perl_croak(aTHX_ "p is not of type Mob"); - if(p == NULL) - Perl_croak(aTHX_ "p is NULL, avoiding crash."); + if(p == nullptr) + Perl_croak(aTHX_ "p is nullptr, avoiding crash."); RETVAL = THIS->IsOnHatelist(p); ST(0) = boolSV(RETVAL); @@ -801,8 +801,8 @@ XS(XS_NPC_SetNPCFactionID) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetNPCFactionID(in); } @@ -826,8 +826,8 @@ XS(XS_NPC_GetMaxDMG) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxDMG(); XSprePUSH; PUSHu((UV)RETVAL); @@ -852,8 +852,8 @@ XS(XS_NPC_GetMinDMG) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMinDMG(); XSprePUSH; PUSHu((UV)RETVAL); @@ -878,8 +878,8 @@ XS(XS_NPC_IsAnimal) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsAnimal(); ST(0) = boolSV(RETVAL); @@ -905,8 +905,8 @@ XS(XS_NPC_GetPetSpellID) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPetSpellID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -930,8 +930,8 @@ XS(XS_NPC_SetPetSpellID) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPetSpellID(amt); } @@ -956,8 +956,8 @@ XS(XS_NPC_GetMaxDamage) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxDamage(tlevel); XSprePUSH; PUSHu((UV)RETVAL); @@ -981,8 +981,8 @@ XS(XS_NPC_SetTaunting) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetTaunting(tog); } @@ -1005,8 +1005,8 @@ XS(XS_NPC_PickPocket) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1014,8 +1014,8 @@ XS(XS_NPC_PickPocket) } else Perl_croak(aTHX_ "thief is not of type Client"); - if(thief == NULL) - Perl_croak(aTHX_ "thief is NULL, avoiding crash."); + if(thief == nullptr) + Perl_croak(aTHX_ "thief is nullptr, avoiding crash."); THIS->PickPocket(thief); } @@ -1038,8 +1038,8 @@ XS(XS_NPC_StartSwarmTimer) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StartSwarmTimer(duration); } @@ -1062,8 +1062,8 @@ XS(XS_NPC_DoClassAttacks) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1071,8 +1071,8 @@ XS(XS_NPC_DoClassAttacks) } else Perl_croak(aTHX_ "target is not of type Mob"); - if(target == NULL) - Perl_croak(aTHX_ "target is NULL, avoiding crash."); + if(target == nullptr) + Perl_croak(aTHX_ "target is nullptr, avoiding crash."); THIS->DoClassAttacks(target); } @@ -1096,8 +1096,8 @@ XS(XS_NPC_GetMaxWp) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetMaxWp(); XSprePUSH; PUSHi((IV)RETVAL); @@ -1121,8 +1121,8 @@ XS(XS_NPC_DisplayWaypointInfo) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -1130,8 +1130,8 @@ XS(XS_NPC_DisplayWaypointInfo) } else Perl_croak(aTHX_ "to is not of type Client"); - if(to == NULL) - Perl_croak(aTHX_ "to is NULL, avoiding crash."); + if(to == nullptr) + Perl_croak(aTHX_ "to is nullptr, avoiding crash."); THIS->DisplayWaypointInfo(to); } @@ -1153,8 +1153,8 @@ XS(XS_NPC_CalculateNewWaypoint) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->CalculateNewWaypoint(); } @@ -1177,8 +1177,8 @@ XS(XS_NPC_AssignWaypoints) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AssignWaypoints(grid); } @@ -1200,8 +1200,8 @@ XS(XS_NPC_SetWaypointPause) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetWaypointPause(); } @@ -1224,8 +1224,8 @@ XS(XS_NPC_UpdateWaypoint) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->UpdateWaypoint(wp_index); } @@ -1247,8 +1247,8 @@ XS(XS_NPC_StopWandering) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StopWandering(); } @@ -1270,8 +1270,8 @@ XS(XS_NPC_ResumeWandering) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ResumeWandering(); } @@ -1294,8 +1294,8 @@ XS(XS_NPC_PauseWandering) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->PauseWandering(pausetime); } @@ -1332,8 +1332,8 @@ XS(XS_NPC_MoveTo) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->MoveTo(mtx, mty, mtz, mth, saveguard); } @@ -1355,8 +1355,8 @@ XS(XS_NPC_NextGuardPosition) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->NextGuardPosition(); } @@ -1379,8 +1379,8 @@ XS(XS_NPC_SaveGuardSpot) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) iClearGuardSpot = false; @@ -1409,8 +1409,8 @@ XS(XS_NPC_IsGuarding) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsGuarding(); ST(0) = boolSV(RETVAL); @@ -1440,8 +1440,8 @@ XS(XS_NPC_AI_SetRoambox) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 7) iDelay = 2500; @@ -1471,8 +1471,8 @@ XS(XS_NPC_GetNPCSpellsID) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetNPCSpellsID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1497,8 +1497,8 @@ XS(XS_NPC_GetSpawnPointID) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPointID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1523,8 +1523,8 @@ XS(XS_NPC_GetSpawnPointX) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPointX(); @@ -1550,8 +1550,8 @@ XS(XS_NPC_GetSpawnPointY) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPointY(); @@ -1577,8 +1577,8 @@ XS(XS_NPC_GetSpawnPointZ) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPointZ(); @@ -1604,8 +1604,8 @@ XS(XS_NPC_GetSpawnPointH) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSpawnPointH(); @@ -1631,8 +1631,8 @@ XS(XS_NPC_GetGuardPointX) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGuardPointX(); @@ -1658,8 +1658,8 @@ XS(XS_NPC_GetGuardPointY) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGuardPointY(); @@ -1685,8 +1685,8 @@ XS(XS_NPC_GetGuardPointZ) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGuardPointZ(); @@ -1711,8 +1711,8 @@ XS(XS_NPC_SetPrimSkill) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetPrimSkill(skill_id); } @@ -1735,8 +1735,8 @@ XS(XS_NPC_SetSecSkill) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSecSkill(skill_id); } @@ -1760,8 +1760,8 @@ XS(XS_NPC_GetPrimSkill) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetPrimSkill(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1786,8 +1786,8 @@ XS(XS_NPC_GetSecSkill) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSecSkill(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1812,8 +1812,8 @@ XS(XS_NPC_GetSwarmOwner) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSwarmOwner(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1838,8 +1838,8 @@ XS(XS_NPC_GetSwarmTarget) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSwarmTarget(); XSprePUSH; PUSHu((UV)RETVAL); @@ -1863,8 +1863,8 @@ XS(XS_NPC_SetSwarmTarget) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSwarmTarget(target_id); } @@ -1888,8 +1888,8 @@ XS(XS_NPC_ModifyNPCStat) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ModifyNPCStat(identifier, newValue); } @@ -1917,8 +1917,8 @@ XS(XS_NPC_AddSpellToNPCList) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust); } @@ -1941,8 +1941,8 @@ XS(XS_NPC_RemoveSpellFromNPCList) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->RemoveSpellFromNPCList(spell_id); } @@ -1965,8 +1965,8 @@ XS(XS_NPC_SetSpellFocusDMG) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSpellFocusDMG(NewSpellFocusDMG); } @@ -1989,8 +1989,8 @@ XS(XS_NPC_SetSpellFocusHeal) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetSpellFocusHeal(NewSpellFocusHeal); } @@ -2014,8 +2014,8 @@ XS(XS_NPC_GetSlowMitigation) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetSlowMitigation(); XSprePUSH; PUSHn((double)RETVAL); @@ -2040,8 +2040,8 @@ XS(XS_NPC_GetAttackSpeed) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAttackSpeed(); XSprePUSH; PUSHn((double)RETVAL); @@ -2066,8 +2066,8 @@ XS(XS_NPC_GetAccuracyRating) } else Perl_croak(aTHX_ "THIS is not of type NPC"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAccuracyRating(); XSprePUSH; PUSHu((UV)RETVAL); diff --git a/zone/perl_object.cpp b/zone/perl_object.cpp index ba0fe8b2b..e6c6272ae 100644 --- a/zone/perl_object.cpp +++ b/zone/perl_object.cpp @@ -56,8 +56,8 @@ XS(XS_Object_IsGroundSpawn) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsGroundSpawn(); ST(0) = boolSV(RETVAL); @@ -83,8 +83,8 @@ XS(XS_Object_Close) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Close(); } @@ -108,8 +108,8 @@ XS(XS_Object_Delete) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items < 2) reset_state = false; @@ -136,8 +136,8 @@ XS(XS_Object_StartDecay) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->StartDecay(); } @@ -161,8 +161,8 @@ XS(XS_Object_DeleteItem) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->DeleteItem(index); } @@ -185,8 +185,8 @@ XS(XS_Object_IsObject) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsObject(); ST(0) = boolSV(RETVAL); @@ -212,8 +212,8 @@ XS(XS_Object_Save) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->Save(); ST(0) = boolSV(RETVAL); @@ -239,8 +239,8 @@ XS(XS_Object_SetID) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetID(set_id); } @@ -263,8 +263,8 @@ XS(XS_Object_ClearUser) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->ClearUser(); } @@ -289,8 +289,8 @@ XS(XS_Object_GetDBID) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetDBID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -315,8 +315,8 @@ XS(XS_Object_GetID) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -341,8 +341,8 @@ XS(XS_Object_GetX) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetX(); XSprePUSH; PUSHn((double)RETVAL); @@ -367,8 +367,8 @@ XS(XS_Object_GetY) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetY(); XSprePUSH; PUSHn((double)RETVAL); @@ -393,8 +393,8 @@ XS(XS_Object_GetZ) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetZ(); XSprePUSH; PUSHn((double)RETVAL); @@ -419,8 +419,8 @@ XS(XS_Object_GetHeading) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHeadingData(); XSprePUSH; PUSHn((double)RETVAL); @@ -445,8 +445,8 @@ XS(XS_Object_VarSave) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->VarSave(); XSprePUSH; PUSHu((UV)RETVAL); @@ -472,8 +472,8 @@ XS(XS_Object_GetType) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetType(); XSprePUSH; PUSHu((UV)RETVAL); @@ -498,8 +498,8 @@ XS(XS_Object_SetType) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetType(type); } @@ -524,8 +524,8 @@ XS(XS_Object_GetIcon) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetIcon(); XSprePUSH; PUSHu((UV)RETVAL); @@ -550,8 +550,8 @@ XS(XS_Object_SetIcon) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetIcon(icon); } @@ -576,8 +576,8 @@ XS(XS_Object_GetItemID) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItemID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -602,8 +602,8 @@ XS(XS_Object_SetItemID) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetItemID(itemid); } @@ -628,8 +628,8 @@ XS(XS_Object_SetLocation) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetLocation(x, y, z); } @@ -652,8 +652,8 @@ XS(XS_Object_SetX) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetX(pos); } @@ -676,8 +676,8 @@ XS(XS_Object_SetY) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetY(pos); } @@ -700,8 +700,8 @@ XS(XS_Object_SetZ) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetZ(pos); } @@ -724,8 +724,8 @@ XS(XS_Object_SetHeading) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetHeading(heading); } @@ -740,7 +740,7 @@ XS(XS_Object_SetModelName) Perl_croak(aTHX_ "Usage: Object::SetModelName(THIS, name)"); { Object * THIS; - char * name = NULL; + char * name = nullptr; if (sv_derived_from(ST(0), "Object")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -748,8 +748,8 @@ XS(XS_Object_SetModelName) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (items > 1) { name = (char *)SvPV_nolen(ST(1)); } @@ -774,8 +774,8 @@ XS(XS_Object_GetModelName) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetModelName(); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -799,8 +799,8 @@ XS(XS_Object_Repop) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Repop(); } XSRETURN_EMPTY; @@ -822,8 +822,8 @@ XS(XS_Object_Depop) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Depop(); } XSRETURN_EMPTY; @@ -848,8 +848,8 @@ XS(XS_Object_GetEntityVariable) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetEntityVariable(id); sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -874,8 +874,8 @@ XS(XS_Object_EntityVariableExists) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->EntityVariableExists(id); ST(0) = boolSV(RETVAL); @@ -901,8 +901,8 @@ XS(XS_Object_SetEntityVariable) } else Perl_croak(aTHX_ "THIS is not of type Object"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetEntityVariable(id, var); } diff --git a/zone/perl_perlpacket.cpp b/zone/perl_perlpacket.cpp index 63142c68a..703595b40 100644 --- a/zone/perl_perlpacket.cpp +++ b/zone/perl_perlpacket.cpp @@ -86,8 +86,8 @@ XS(XS_PerlPacket_DESTROY) } else Perl_croak(aTHX_ "THIS is not a reference"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); delete THIS; } @@ -111,8 +111,8 @@ XS(XS_PerlPacket_SetOpcode) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->SetOpcode(opcode); ST(0) = boolSV(RETVAL); @@ -137,8 +137,8 @@ XS(XS_PerlPacket_Resize) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Resize(len); } @@ -161,8 +161,8 @@ XS(XS_PerlPacket_SendTo) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Client")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -170,8 +170,8 @@ XS(XS_PerlPacket_SendTo) } else Perl_croak(aTHX_ "who is not of type Client"); - if(who == NULL) - Perl_croak(aTHX_ "who is NULL, avoiding crash."); + if(who == nullptr) + Perl_croak(aTHX_ "who is nullptr, avoiding crash."); THIS->SendTo(who); } @@ -193,8 +193,8 @@ XS(XS_PerlPacket_SendToAll) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SendToAll(); } @@ -216,8 +216,8 @@ XS(XS_PerlPacket_Zero) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->Zero(); } @@ -241,8 +241,8 @@ XS(XS_PerlPacket_FromArray) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); AV *av_numbers; if (SvROK(ST(1)) && SvTYPE(SvRV(ST(1)))==SVt_PVAV) @@ -254,7 +254,7 @@ XS(XS_PerlPacket_FromArray) numbers = new int[len_numbers]; for(ix_numbers = 0; ix_numbers < len_numbers; ix_numbers ++) { SV **tmp = av_fetch(av_numbers, ix_numbers, 0); - if(tmp == NULL || *tmp == NULL) { + if(tmp == nullptr || *tmp == nullptr) { numbers[ix_numbers] = 0; continue; } @@ -283,8 +283,8 @@ XS(XS_PerlPacket_SetByte) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetByte(pos, val); } @@ -308,8 +308,8 @@ XS(XS_PerlPacket_SetShort) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetShort(pos, val); } @@ -333,8 +333,8 @@ XS(XS_PerlPacket_SetLong) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetLong(pos, val); } @@ -358,8 +358,8 @@ XS(XS_PerlPacket_SetFloat) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetFloat(pos, val); } @@ -383,8 +383,8 @@ XS(XS_PerlPacket_SetString) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetString(pos, str); } @@ -409,8 +409,8 @@ XS(XS_PerlPacket_SetEQ1319) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetEQ1319(pos, part13, part19); } @@ -435,8 +435,8 @@ XS(XS_PerlPacket_SetEQ1913) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SetEQ1913(pos, part19, part13); } @@ -461,8 +461,8 @@ XS(XS_PerlPacket_GetByte) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetByte(pos); XSprePUSH; PUSHu((UV)RETVAL); @@ -488,8 +488,8 @@ XS(XS_PerlPacket_GetShort) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetShort(pos); XSprePUSH; PUSHu((UV)RETVAL); @@ -515,8 +515,8 @@ XS(XS_PerlPacket_GetLong) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLong(pos); XSprePUSH; PUSHu((UV)RETVAL); @@ -542,8 +542,8 @@ XS(XS_PerlPacket_GetFloat) } else Perl_croak(aTHX_ "THIS is not of type PerlPacket"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetFloat(pos); XSprePUSH; PUSHn((double)RETVAL); diff --git a/zone/perl_questitem.cpp b/zone/perl_questitem.cpp index 8dccc117e..976638390 100644 --- a/zone/perl_questitem.cpp +++ b/zone/perl_questitem.cpp @@ -48,8 +48,8 @@ XS(XS_QuestItem_GetName) { } else Perl_croak(aTHX_ "THIS is not of type ItemInst"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItem()->Name; sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; @@ -73,8 +73,8 @@ XS(XS_QuestItem_SetScale) } else Perl_croak(aTHX_ "THIS is not of type ItemInst"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Mult = (float)SvNV(ST(1)); @@ -102,8 +102,8 @@ XS(XS_QuestItem_ItemSay) } else Perl_croak(aTHX_ "THIS is not of type ItemInst"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); text = SvPV_nolen(ST(1)); if(items == 3) @@ -131,8 +131,8 @@ XS(XS_QuestItem_IsType) } else Perl_croak(aTHX_ "THIS is not of type ItemInst"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsType((ItemClass)type); ST(0) = boolSV(RETVAL); @@ -157,8 +157,8 @@ XS(XS_QuestItem_IsAttuned) } else Perl_croak(aTHX_ "THIS is not of type ItemInst"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsInstNoDrop(); ST(0) = boolSV(RETVAL); @@ -184,8 +184,8 @@ XS(XS_QuestItem_GetCharges) } else Perl_croak(aTHX_ "THIS is not of type ItemInst"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetCharges(); XSprePUSH; PUSHi((IV)RETVAL); @@ -210,8 +210,8 @@ XS(XS_QuestItem_GetAugment) } else Perl_croak(aTHX_ "THIS is not of type ItemInst"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetAugment(slot_id); ST(0) = sv_newmortal(); @@ -237,8 +237,8 @@ XS(XS_QuestItem_GetID) } else Perl_croak(aTHX_ "THIS is not of type ItemInst"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetItem()->ID; XSprePUSH; PUSHi((IV)RETVAL); diff --git a/zone/perl_raids.cpp b/zone/perl_raids.cpp index 65ce7c132..6e656dd64 100644 --- a/zone/perl_raids.cpp +++ b/zone/perl_raids.cpp @@ -59,8 +59,8 @@ XS(XS_Raid_IsRaidMember) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsRaidMember(name); ST(0) = boolSV(RETVAL); @@ -87,8 +87,8 @@ XS(XS_Raid_CastGroupSpell) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -96,8 +96,8 @@ XS(XS_Raid_CastGroupSpell) } else Perl_croak(aTHX_ "caster is not of type Mob"); - if(caster == NULL) - Perl_croak(aTHX_ "caster is NULL, avoiding crash."); + if(caster == nullptr) + Perl_croak(aTHX_ "caster is nullptr, avoiding crash."); THIS->CastGroupSpell(caster, spellid, gid); } @@ -122,8 +122,8 @@ XS(XS_Raid_GroupCount) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GroupCount(gid); XSprePUSH; PUSHu((UV)RETVAL); @@ -148,8 +148,8 @@ XS(XS_Raid_RaidCount) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->RaidCount(); XSprePUSH; PUSHu((UV)RETVAL); @@ -175,8 +175,8 @@ XS(XS_Raid_GetGroup) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetGroup(name); XSprePUSH; PUSHu((UV)RETVAL); @@ -201,8 +201,8 @@ XS(XS_Raid_SplitExp) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(2), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(2))); @@ -210,8 +210,8 @@ XS(XS_Raid_SplitExp) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); THIS->SplitExp(exp, other); } @@ -236,8 +236,8 @@ XS(XS_Raid_GetTotalRaidDamage) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -245,8 +245,8 @@ XS(XS_Raid_GetTotalRaidDamage) } else Perl_croak(aTHX_ "other is not of type Mob"); - if(other == NULL) - Perl_croak(aTHX_ "other is NULL, avoiding crash."); + if(other == nullptr) + Perl_croak(aTHX_ "other is nullptr, avoiding crash."); RETVAL = THIS->GetTotalRaidDamage(other); XSprePUSH; PUSHu((UV)RETVAL); @@ -273,8 +273,8 @@ XS(XS_Raid_SplitMoney) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->SplitMoney(copper, silver, gold, platinum); } @@ -298,8 +298,8 @@ XS(XS_Raid_BalanceHP) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); THIS->BalanceHP(penalty, gid); } @@ -323,8 +323,8 @@ XS(XS_Raid_IsLeader) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsLeader(name); ST(0) = boolSV(RETVAL); @@ -350,8 +350,8 @@ XS(XS_Raid_IsGroupLeader) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->IsGroupLeader(who); ST(0) = boolSV(RETVAL); @@ -377,8 +377,8 @@ XS(XS_Raid_GetHighestLevel) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetHighestLevel(); XSprePUSH; PUSHu((UV)RETVAL); @@ -403,8 +403,8 @@ XS(XS_Raid_GetLowestLevel) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetLowestLevel(); XSprePUSH; PUSHu((UV)RETVAL); @@ -429,8 +429,8 @@ XS(XS_Raid_GetClientByIndex) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetClientByIndex(index); ST(0) = sv_newmortal(); @@ -461,8 +461,8 @@ XS(XS_Raid_TeleportGroup) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -470,8 +470,8 @@ XS(XS_Raid_TeleportGroup) } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == NULL) - Perl_croak(aTHX_ "sender is NULL, avoiding crash."); + if(sender == nullptr) + Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->TeleportGroup(sender, zoneID, 0, x, y, z, heading, gid); } @@ -499,8 +499,8 @@ XS(XS_Raid_TeleportRaid) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); if (sv_derived_from(ST(1), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(1))); @@ -508,8 +508,8 @@ XS(XS_Raid_TeleportRaid) } else Perl_croak(aTHX_ "sender is not of type Mob"); - if(sender == NULL) - Perl_croak(aTHX_ "sender is NULL, avoiding crash."); + if(sender == nullptr) + Perl_croak(aTHX_ "sender is nullptr, avoiding crash."); THIS->TeleportRaid(sender, zoneID, 0, x, y, z, heading); } @@ -533,8 +533,8 @@ XS(XS_Raid_GetID) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); RETVAL = THIS->GetID(); XSprePUSH; PUSHu((UV)RETVAL); @@ -550,7 +550,7 @@ XS(XS_Raid_GetMember) Perl_croak(aTHX_ "Usage: Raid::GetMember(THIS, index)"); { Raid * THIS; - Client* RETVAL = NULL; + Client* RETVAL = nullptr; dXSTARG; if (sv_derived_from(ST(0), "Raid")) { @@ -559,14 +559,14 @@ XS(XS_Raid_GetMember) } else Perl_croak(aTHX_ "THIS is not of type Raid"); - if(THIS == NULL) - Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); int index = (int)SvUV(ST(1)); if (index < 0 || index > 71) - RETVAL = NULL; + RETVAL = nullptr; else { - if(THIS->members[index].member != NULL) + if(THIS->members[index].member != nullptr) RETVAL = THIS->members[index].member->CastToClient(); } diff --git a/zone/perlpacket.cpp b/zone/perlpacket.cpp index 86fcbd06b..c8eb55d8c 100644 --- a/zone/perlpacket.cpp +++ b/zone/perlpacket.cpp @@ -26,13 +26,13 @@ PerlPacket::PerlPacket(const char *opcode, uint32 length) { SetOpcode(opcode); - packet = NULL; + packet = nullptr; len = 0; Resize(length); } PerlPacket::~PerlPacket() { - if(packet != NULL) + if(packet != nullptr) safe_delete_array(packet); } @@ -46,11 +46,11 @@ void PerlPacket::Resize(uint32 length) { Zero(); if(len == length) return; - if(packet != NULL) + if(packet != nullptr) safe_delete_array(packet); len = length; if(len == 0) - packet = NULL; + packet = nullptr; else { packet = new unsigned char[len]; Zero(); @@ -59,7 +59,7 @@ void PerlPacket::Resize(uint32 length) { //sending functions void PerlPacket::SendTo(Client *who) { - if(!who || op == OP_Unknown || (len > 0 && packet == NULL)) + if(!who || op == OP_Unknown || (len > 0 && packet == nullptr)) return; EQApplicationPacket *outapp = new EQApplicationPacket(op, len); @@ -73,19 +73,19 @@ void PerlPacket::SendTo(Client *who) { } void PerlPacket::SendToAll() { - if(op == OP_Unknown || (len > 0 && packet == NULL)) + if(op == OP_Unknown || (len > 0 && packet == nullptr)) return; EQApplicationPacket *outapp = new EQApplicationPacket(op, len); if(len > 0) memcpy(outapp->pBuffer, packet, len); - entity_list.QueueClients(NULL, outapp, false); + entity_list.QueueClients(nullptr, outapp, false); safe_delete(outapp); } //editing void PerlPacket::Zero() { - if(len == 0 || packet == NULL) + if(len == 0 || packet == nullptr) return; memset(packet, 0, len); } @@ -101,28 +101,28 @@ void PerlPacket::FromArray(int numbers[], uint32 length) { } void PerlPacket::SetByte(uint32 pos, uint8 val) { - if(pos + sizeof(val) > len || packet == NULL) + if(pos + sizeof(val) > len || packet == nullptr) return; uint8 *p = (uint8 *) (packet + pos); *p = val; } void PerlPacket::SetShort(uint32 pos, uint16 val) { - if(pos + sizeof(val) > len || packet == NULL) + if(pos + sizeof(val) > len || packet == nullptr) return; uint16 *p = (uint16 *) (packet + pos); *p = val; } void PerlPacket::SetLong(uint32 pos, uint32 val) { - if(pos + sizeof(val) > len || packet == NULL) + if(pos + sizeof(val) > len || packet == nullptr) return; uint32 *p = (uint32 *) (packet + pos); *p = val; } void PerlPacket::SetFloat(uint32 pos, float val) { - if(pos + sizeof(val) > len || packet == NULL) + if(pos + sizeof(val) > len || packet == nullptr) return; float *p = (float *) (packet + pos); *p = val; @@ -130,7 +130,7 @@ void PerlPacket::SetFloat(uint32 pos, float val) { void PerlPacket::SetString(uint32 pos, char *str) { int slen = strlen(str); - if(pos + slen > len || packet == NULL) + if(pos + slen > len || packet == nullptr) return; strcpy((char *)(packet+pos), str); } @@ -147,7 +147,7 @@ struct EQ1913 { #pragma pack() void PerlPacket::SetEQ1319(uint32 pos, float part13, float part19) { - if(pos + sizeof(EQ1319) > len || packet == NULL) + if(pos + sizeof(EQ1319) > len || packet == nullptr) return; EQ1319 *p = (EQ1319 *) (packet + pos); p->part19 = FloatToEQ19(part19); @@ -155,7 +155,7 @@ void PerlPacket::SetEQ1319(uint32 pos, float part13, float part19) { } void PerlPacket::SetEQ1913(uint32 pos, float part19, float part13) { - if(pos + sizeof(EQ1913) > len || packet == NULL) + if(pos + sizeof(EQ1913) > len || packet == nullptr) return; EQ1913 *p = (EQ1913 *) (packet + pos); p->part19 = FloatToEQ19(part19); @@ -164,28 +164,28 @@ void PerlPacket::SetEQ1913(uint32 pos, float part19, float part13) { //reading uint8 PerlPacket::GetByte(uint32 pos) { - if(pos + sizeof(uint8) > len || packet == NULL) + if(pos + sizeof(uint8) > len || packet == nullptr) return(0); uint8 *p = (uint8 *) (packet + pos); return(*p); } uint16 PerlPacket::GetShort(uint32 pos) { - if(pos + sizeof(uint16) > len || packet == NULL) + if(pos + sizeof(uint16) > len || packet == nullptr) return(0); uint16 *p = (uint16 *) (packet + pos); return(*p); } uint32 PerlPacket::GetLong(uint32 pos) { - if(pos + sizeof(uint32) > len || packet == NULL) + if(pos + sizeof(uint32) > len || packet == nullptr) return(0); uint32 *p = (uint32 *) (packet + pos); return(*p); } float PerlPacket::GetFloat(uint32 pos) { - if(pos + sizeof(float) > len || packet == NULL) + if(pos + sizeof(float) > len || packet == nullptr) return(0); float *p = (float *) (packet + pos); return(*p); diff --git a/zone/perlparser.cpp b/zone/perlparser.cpp index 871551b10..c1fe55dbc 100644 --- a/zone/perlparser.cpp +++ b/zone/perlparser.cpp @@ -113,7 +113,7 @@ void PerlXSParser::SendCommands(const char * pkgprefix, const char *event, uint3 if(mob && mob->IsClient()) quest_manager.StartQuest(other, mob->CastToClient(), iteminst); else - quest_manager.StartQuest(other, NULL, NULL); + quest_manager.StartQuest(other, nullptr, nullptr); try { @@ -127,7 +127,7 @@ void PerlXSParser::SendCommands(const char * pkgprefix, const char *event, uint3 Client *curc = quest_manager.GetInitiator(); snprintf(namebuf, 64, "%s::client", pkgprefix); SV *client = get_sv(namebuf, true); - if(curc != NULL) { + if(curc != nullptr) { sv_setref_pv(client, "Client", curc); } else { //clear out the value, mainly to get rid of blessedness @@ -262,7 +262,7 @@ XS(XS_MobList_new) ListElement* RETVAL; - RETVAL = NULL; + RETVAL = nullptr; ST(0) = sv_newmortal(); if(RETVAL) sv_setref_pv(ST(0), "MobList", (void*)RETVAL); diff --git a/zone/pets.cpp b/zone/pets.cpp index 531704588..93b534107 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -227,7 +227,7 @@ void Mob::MakePet(uint16 spell_id, const char* pettype, const char *petname) { // of a client is searched for and used instead. void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const char *petname) { // Sanity and early out checking first. - if(HasPet() || pettype == NULL) + if(HasPet() || pettype == nullptr) return; int16 act_power = 0; // The actual pet power we'll use. @@ -252,7 +252,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, c //find the NPC data for the specified NPC type const NPCType *base = database.GetNPCType(record.npc_type); - if(base == NULL) { + if(base == nullptr) { Message(13, "Unable to load NPC data for pet %s", pettype); LogFile->write(EQEMuLog::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); return; @@ -297,7 +297,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, c // 4 - Keep DB name - if (petname != NULL) { + if (petname != nullptr) { // Name was provided, use it. strn0cpy(npc_type->name, petname, 64); } else if (record.petnaming == 0) { @@ -361,8 +361,8 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, c if(record.monsterflag) { char errbuf[MYSQL_ERRMSG_SIZE]; char* query = 0; - MYSQL_RES *result = NULL; - MYSQL_ROW row = NULL; + MYSQL_RES *result = nullptr; + MYSQL_ROW row = nullptr; uint32 monsterid; // get a random npc id from the spawngroups assigned to this zone @@ -486,17 +486,17 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR Mob* Mob::GetPet() { if(GetPetID() == 0) - return(NULL); + return(nullptr); Mob* tmp = entity_list.GetMob(GetPetID()); - if(tmp == NULL) { + if(tmp == nullptr) { SetPetID(0); - return(NULL); + return(nullptr); } if(tmp->GetOwnerID() != GetID()) { SetPetID(0); - return(NULL); + return(nullptr); } return(tmp); @@ -507,7 +507,7 @@ void Mob::SetPet(Mob* newpet) { if (oldpet) { oldpet->SetOwnerID(0); } - if (newpet == NULL) { + if (newpet == nullptr) { SetPetID(0); } else { SetPetID(newpet->GetID()); @@ -639,7 +639,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) { // shared memory at some point due to the number of queries needed to load a // nested set. bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { - if (equipmentset < 0 || items == NULL) + if (equipmentset < 0 || items == nullptr) return false; // Equipment sets can be nested. We start with the top-most one and diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index b93a3102f..f847fd6e1 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -109,7 +109,7 @@ void QuestManager::Process() { //make sure the mob is still in zone. if(entity_list.IsMobInZone(cur->mob)){ if(cur->mob->IsNPC()) { - parse->EventNPC(EVENT_TIMER, cur->mob->CastToNPC(), NULL, cur->name, 0); + parse->EventNPC(EVENT_TIMER, cur->mob->CastToNPC(), nullptr, cur->name, 0); } else { //this is inheriently unsafe if we ever make it so more than npc/client start timers @@ -184,7 +184,7 @@ void QuestManager::EndQuest() { } owner->Depop(); - owner = NULL; //just to be safe + owner = nullptr; //just to be safe } } @@ -209,7 +209,7 @@ void QuestManager::echo(int colour, const char *str) { void QuestManager::say(const char *str) { if (!owner) { - LogFile->write(EQEMuLog::Quest, "QuestManager::say called with NULL owner. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -224,7 +224,7 @@ void QuestManager::say(const char *str) { void QuestManager::say(const char *str, uint8 language) { if (!owner) { - LogFile->write(EQEMuLog::Quest, "QuestManager::say called with NULL owner. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -276,7 +276,7 @@ uint16 QuestManager::spawn2(int npc_type, int grid, int unused, float x, float y uint16 QuestManager::unique_spawn(int npc_type, int grid, int unused, float x, float y, float z, float heading) { Mob *other = entity_list.GetMobByNpcTypeID(npc_type); - if(other != NULL) { + if(other != nullptr) { return(other->GetID()); } @@ -304,7 +304,7 @@ uint16 QuestManager::spawn_from_spawn2(uint32 spawn2_id) { LinkedListIterator iterator(zone->spawn2_list); iterator.Reset(); - Spawn2 *found_spawn = NULL; + Spawn2 *found_spawn = nullptr; while(iterator.MoreElements()) { @@ -416,7 +416,7 @@ void QuestManager::incstat(int stat, int value) { //old setstat command aza void QuestManager::castspell(int spell_id, int target_id) { if (owner) { Mob *tgt = entity_list.GetMob(target_id); - if(tgt != NULL) + if(tgt != nullptr) owner->SpellFinished(spell_id, tgt, 10, 0, -1, spells[spell_id].ResistDiff); } } @@ -528,7 +528,7 @@ void QuestManager::stopalltimers() { void QuestManager::emote(const char *str) { if (!owner) { - LogFile->write(EQEMuLog::Quest, "QuestManager::emote called with NULL owner. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -538,7 +538,7 @@ void QuestManager::emote(const char *str) { void QuestManager::shout(const char *str) { if (!owner) { - LogFile->write(EQEMuLog::Quest, "QuestManager::shout called with NULL owner. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -548,7 +548,7 @@ void QuestManager::shout(const char *str) { void QuestManager::shout2(const char *str) { if (!owner) { - LogFile->write(EQEMuLog::Quest, "QuestManager::shout2 called with NULL owner. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -565,7 +565,7 @@ void QuestManager::gmsay(const char *str, uint32 color, bool send_to_world, uint void QuestManager::depop(int npc_type) { // depop NPC and don't start spawn timer if (!owner || !owner->IsNPC()) { - LogFile->write(EQEMuLog::Quest, "QuestManager::depop called with NULL owner or non-NPC owner. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -588,7 +588,7 @@ void QuestManager::depop(int npc_type) { // depop NPC and don't start spawn time void QuestManager::depop_withtimer(int npc_type) { // depop NPC and start spawn timer if (!owner || !owner->IsNPC()) { - LogFile->write(EQEMuLog::Quest, "QuestManager::depop_withtimer called with NULL owner or non-NPC owner. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -614,7 +614,7 @@ void QuestManager::depopall(int npc_type) { entity_list.DepopAll(npc_type); } else { - LogFile->write(EQEMuLog::Quest, "QuestManager::depopall called with NULL owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); } } @@ -623,7 +623,7 @@ void QuestManager::depopzone(bool StartSpawnTimer) { zone->Depop(StartSpawnTimer); } else { - LogFile->write(EQEMuLog::Quest, "QuestManager::depopzone called with NULL zone. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -632,21 +632,21 @@ void QuestManager::repopzone() { zone->Repop(); } else { - LogFile->write(EQEMuLog::Quest, "QuestManager::repopzone called with NULL zone. Probably syntax error in quest file."); + LogFile->write(EQEMuLog::Quest, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); } } void QuestManager::settarget(const char *type, int target_id) { if(!owner->IsNPC()) return; - Mob* tmp = NULL; + Mob* tmp = nullptr; if (!strcasecmp(type,"npctype")) { tmp = entity_list.GetMobByNpcTypeID(target_id); } else if (!strcasecmp(type, "entity")) { tmp = entity_list.GetMob(target_id); } - if(tmp != NULL) { + if(tmp != nullptr) { owner->SetTarget(tmp); } } @@ -700,7 +700,7 @@ void QuestManager::traindisc(int discipline_tome_item_id) { bool QuestManager::isdisctome(int item_id) { //get the item info const Item_Struct *item = database.GetItem(item_id); - if(item == NULL) { + if(item == nullptr) { return(false); } @@ -990,11 +990,11 @@ void QuestManager::movegrp(int zoneid, float x, float y, float z) { if (initiator && initiator->IsClient()) { Group *g = entity_list.GetGroupByClient(initiator); - if (g != NULL){ + if (g != nullptr){ g->TeleportGroup(owner, zoneid, 0, x, y, z, 0.0f); } else { Raid *r = entity_list.GetRaidByClient(initiator); - if (r != NULL){ + if (r != nullptr){ uint32 gid = r->GetGroup(initiator); if (gid >= 0 && gid < 12) { r->TeleportGroup(owner, zoneid, 0, x, y, z, 0.0f, gid); @@ -1239,11 +1239,11 @@ int QuestManager::InsertQuestGlobal( char *query = 0; char errbuf[MYSQL_ERRMSG_SIZE]; - // Make duration string either "unix_timestamp(now()) + xxx" or "NULL" + // Make duration string either "unix_timestamp(now()) + xxx" or "nullptr" stringstream duration_ss; if (duration == INT_MAX) { - duration_ss << "NULL"; + duration_ss << "nullptr"; } else { @@ -1257,7 +1257,7 @@ int QuestManager::InsertQuestGlobal( "REPLACE INTO quest_globals (charid, npcid, zoneid, name, value, expdate)" "VALUES (%i, %i, %i, '%s', '%s', %s)", charid, npcid, zoneid, varname, varvalue, duration_ss.str().c_str() - ), errbuf, NULL, NULL, &last_id)) + ), errbuf, nullptr, nullptr, &last_id)) { cerr << "setglobal error inserting " << varname << " : " << errbuf << endl; } @@ -1555,7 +1555,7 @@ void QuestManager::setanim(int npc_type, int animnum) { //displays an in game path based on a waypoint grid void QuestManager::showgrid(int grid) { - if(initiator == NULL) + if(initiator == nullptr) return; char errbuf[MYSQL_ERRMSG_SIZE]; @@ -2157,7 +2157,7 @@ int QuestManager::getlevel(uint8 type) else if(type == 1) { Group *g = entity_list.GetGroupByClient(initiator); - if (g != NULL) + if (g != nullptr) return (g->GetAvgLevel()); else return 0; @@ -2165,7 +2165,7 @@ int QuestManager::getlevel(uint8 type) else if(type == 2) { Raid *r = entity_list.GetRaidByClient(initiator); - if (r != NULL) + if (r != nullptr) return (r->GetAvgLevel()); else return 0; @@ -2173,12 +2173,12 @@ int QuestManager::getlevel(uint8 type) else if(type == 3) { Raid *r = entity_list.GetRaidByClient(initiator); - if(r != NULL) + if(r != nullptr) { return (r->GetAvgLevel()); } Group *g = entity_list.GetGroupByClient(initiator); - if(g != NULL) + if(g != nullptr) { return (g->GetAvgLevel()); } @@ -2309,7 +2309,7 @@ void QuestManager::MerchantSetItem(uint32 NPCid, uint32 itemid, uint32 quantity) if (merchant == 0 || !merchant->IsNPC() || (merchant->GetClass() != MERCHANT)) return; // don't do anything if NPCid isn't a merchant - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; item = database.GetItem(itemid); if (!item) return; // if the item id doesn't correspond to a real item, do nothing @@ -2322,7 +2322,7 @@ uint32 QuestManager::MerchantCountItem(uint32 NPCid, uint32 itemid) { if (merchant == 0 || !merchant->IsNPC() || (merchant->GetClass() != MERCHANT)) return 0; // if it isn't a merchant, it doesn't have any items - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; item = database.GetItem(itemid); if (!item) return 0; // likewise, if it isn't a valid item, the merchant doesn't have any @@ -2688,7 +2688,7 @@ void QuestManager::LearnRecipe(uint32 recipe_id) { } void QuestManager::SendMail(const char *to, const char *from, const char *subject, const char *message) { - if(to == NULL || from == NULL || subject == NULL || message == NULL) { + if(to == nullptr || from == nullptr || subject == nullptr || message == nullptr) { return; } diff --git a/zone/questmgr.h b/zone/questmgr.h index 96174abc6..eeec0d759 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -34,7 +34,7 @@ public: QuestManager(); virtual ~QuestManager(); - void StartQuest(Mob *_owner, Client *_initiator = NULL, ItemInst* _questitem = NULL); + void StartQuest(Mob *_owner, Client *_initiator = nullptr, ItemInst* _questitem = nullptr); void EndQuest(); void Process(); @@ -237,7 +237,7 @@ public: //thing ChooseRandom(array_of_things) inline Client *GetInitiator() const { return(initiator); } - inline NPC *GetNPC() const { return(owner->IsNPC()?owner->CastToNPC():NULL); } + inline NPC *GetNPC() const { return(owner->IsNPC()?owner->CastToNPC():nullptr); } inline Mob *GetOwner() const { return(owner); } inline ItemInst *GetQuestItem() const {return questitem; } inline bool ProximitySayInUse() { return HaveProximitySays; } @@ -258,9 +258,9 @@ public: #endif protected: - Mob *owner; //NPC is never NULL when functions are called. + Mob *owner; //NPC is never nullptr when functions are called. Client *initiator; //this can be null. - ItemInst* questitem; // this is usually NULL. + ItemInst* questitem; // this is usually nullptr. bool depop_npc; //true if EndQuest should depop the NPC diff --git a/zone/raids.cpp b/zone/raids.cpp index 5f87d11c3..b1518701b 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -29,7 +29,7 @@ Raid::Raid(uint32 raidID) : GroupIDConsumer(raidID) { memset(members ,0, (sizeof(RaidMember)*MAX_RAID_MEMBERS)); - leader = NULL; + leader = nullptr; memset(leadername, 0, 64); locked = false; LootType = 4; @@ -403,7 +403,7 @@ uint32 Raid::GetPlayerIndex(const char *name){ Client *Raid::GetClientByIndex(uint16 index) { if(index > MAX_RAID_MEMBERS) - return NULL; + return nullptr; return members[index].member; } @@ -428,7 +428,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) caster->SpellOnTarget(spellid, caster->GetPet()); #endif } - else if(members[x].member != NULL) + else if(members[x].member != nullptr) { if(members[x].GroupNumber == gid){ distance = caster->DistNoRoot(*members[x].member); @@ -573,7 +573,7 @@ void Raid::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum uint32 i; uint8 membercount = 0; for (i = 0; i < MAX_RAID_MEMBERS; i++) { - if (members[i].member != NULL) { + if (members[i].member != nullptr) { membercount++; } @@ -647,7 +647,7 @@ void Raid::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum msg += " as your split"; for (i = 0; i < MAX_RAID_MEMBERS; i++) { - if (members[i].member != NULL) { // If Group Member is Client + if (members[i].member != nullptr) { // If Group Member is Client //I could not get MoneyOnCorpse to work, so we use this members[i].member->AddMoneyToPP(cpsplit, spsplit, gpsplit, ppsplit, true); @@ -675,7 +675,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){ caster->BardPulse(spellid, caster->GetPet()); #endif } - else if(members[z].member != NULL) + else if(members[z].member != nullptr) { if(members[z].GroupNumber == gid){ distance = caster->DistNoRoot(*members[z].member); @@ -1303,7 +1303,7 @@ bool Raid::LearnMembers() while((row = mysql_fetch_row(result))) { if(!row[0]) continue; - members[i].member = NULL; + members[i].member = nullptr; strn0cpy(members[i].membername, row[0], 64); int GroupNum = atoi(row[1]); if(GroupNum > 11) @@ -1327,7 +1327,7 @@ void Raid::VerifyRaid() for(int x = 0; x < MAX_RAID_MEMBERS; x++) { if(strlen(members[x].membername) == 0){ - members[x].member = NULL; + members[x].member = nullptr; } else{ Client *c = entity_list.GetClientByName(members[x].membername); @@ -1335,7 +1335,7 @@ void Raid::VerifyRaid() members[x].member = c; } else{ - members[x].member = NULL; + members[x].member = nullptr; } } if(members[x].IsRaidLeader){ @@ -1356,7 +1356,7 @@ void Raid::MemberZoned(Client *c) { if(members[x].member == c) { - members[x].member = NULL; + members[x].member = nullptr; } } } diff --git a/zone/raids.h b/zone/raids.h index dd34c0a4d..45735fc23 100644 --- a/zone/raids.h +++ b/zone/raids.h @@ -154,7 +154,7 @@ public: void BalanceHP(int32 penalty, uint32 gid); void BalanceMana(int32 penalty, uint32 gid); void HealGroup(uint32 heal_amt, Mob* caster, uint32 gid); - void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = NULL); + void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = nullptr); void GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid); void TeleportGroup(Mob* sender, uint32 zoneID, uint16 instance_id, float x, float y, float z, float heading, uint32 gid); diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index e08bc572a..1dab8b9b0 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -33,33 +33,33 @@ extern WorldServer worldserver; /* CREATE TABLE spawn_conditions ( - zone VARCHAR(16) NOT NULL, - id MEDIUMINT UNSIGNED NOT NULL DEFAULT '1', - value MEDIUMINT NOT NULL DEFAULT '0', - onchange TINYINT UNSIGNED NOT NULL DEFAULT '0', - name VARCHAR(255) NOT NULL DEFAULT '', + zone VARCHAR(16) NOT nullptr, + id MEDIUMINT UNSIGNED NOT nullptr DEFAULT '1', + value MEDIUMINT NOT nullptr DEFAULT '0', + onchange TINYINT UNSIGNED NOT nullptr DEFAULT '0', + name VARCHAR(255) NOT nullptr DEFAULT '', PRIMARY KEY(zone,id) ); CREATE TABLE spawn_events ( #identifiers id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - zone VARCHAR(16) NOT NULL, - cond_id MEDIUMINT UNSIGNED NOT NULL, - name VARCHAR(255) NOT NULL DEFAULT '', + zone VARCHAR(16) NOT nullptr, + cond_id MEDIUMINT UNSIGNED NOT nullptr, + name VARCHAR(255) NOT nullptr DEFAULT '', #timing information - period INT UNSIGNED NOT NULL, - next_minute TINYINT UNSIGNED NOT NULL, - next_hour TINYINT UNSIGNED NOT NULL, - next_day TINYINT UNSIGNED NOT NULL, - next_month TINYINT UNSIGNED NOT NULL, - next_year INT UNSIGNED NOT NULL, - enabled TINYINT NOT NULL DEFAULT '1', + period INT UNSIGNED NOT nullptr, + next_minute TINYINT UNSIGNED NOT nullptr, + next_hour TINYINT UNSIGNED NOT nullptr, + next_day TINYINT UNSIGNED NOT nullptr, + next_month TINYINT UNSIGNED NOT nullptr, + next_year INT UNSIGNED NOT nullptr, + enabled TINYINT NOT nullptr DEFAULT '1', #action: - action TINYINT UNSIGNED NOT NULL DEFAULT '0', - argument MEDIUMINT NOT NULL DEFAULT '0' + action TINYINT UNSIGNED NOT nullptr DEFAULT '0', + argument MEDIUMINT NOT nullptr DEFAULT '0' ); */ @@ -81,7 +81,7 @@ Spawn2::Spawn2(uint32 in_spawn2_id, uint32 spawngroup_id, grid_ = grid; condition_id = in_cond_id; condition_min_value = in_min_value; - npcthis = NULL; + npcthis = nullptr; enabled = in_enabled; this->anim = anim; @@ -164,12 +164,12 @@ bool Spawn2::Process() { return(true); } - if (sg == NULL) { + if (sg == nullptr) { database.LoadSpawnGroupsByID(spawngroup_id_,&zone->spawn_group_list); sg = zone->spawn_group_list.GetSpawnGroup(spawngroup_id_); } - if (sg == NULL) { + if (sg == nullptr) { _log(SPAWNS__MAIN, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); return false; } @@ -184,7 +184,7 @@ bool Spawn2::Process() { //try to find our NPC type. const NPCType* tmp = database.GetNPCType(npcid); - if (tmp == NULL) { + if (tmp == nullptr) { _log(SPAWNS__MAIN, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); Reset(); //try again later return(true); @@ -268,14 +268,14 @@ void Spawn2::LoadGrid() { */ void Spawn2::Reset() { timer.Start(resetTimer()); - npcthis = NULL; + npcthis = nullptr; _log(SPAWNS__MAIN, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); } void Spawn2::Depop() { timer.Disable(); _log(SPAWNS__MAIN, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); - npcthis = NULL; + npcthis = nullptr; } void Spawn2::Repop(uint32 delay) { @@ -286,14 +286,14 @@ void Spawn2::Repop(uint32 delay) { _log(SPAWNS__MAIN, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); timer.Start(delay); } - npcthis = NULL; + npcthis = nullptr; } void Spawn2::ForceDespawn() { SpawnGroup* sg = zone->spawn_group_list.GetSpawnGroup(spawngroup_id_); - if(npcthis != NULL) + if(npcthis != nullptr) { if(!npcthis->IsEngaged()) { @@ -336,7 +336,7 @@ void Spawn2::DeathReset() timer.Start(cur); //zero out our NPC since he is now gone - npcthis = NULL; + npcthis = nullptr; //if we have a valid spawn id if(spawn2_id) @@ -520,13 +520,13 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { break; case SpawnCondition::DoDepop: _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabed":"disabled"); - if(npcthis != NULL) + if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Reset(); //reset our spawn timer break; case SpawnCondition::DoRepop: _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Preforming a repop.", spawn2_id, new_state?"enabed":"disabled"); - if(npcthis != NULL) + if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Repop(); //repop break; @@ -537,7 +537,7 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { } int signal_id = c.on_change - SpawnCondition::DoSignalMin; _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabed":"disabled", signal_id); - if(npcthis != NULL) + if(npcthis != nullptr) npcthis->SignalNPC(signal_id); } } diff --git a/zone/spawn2.h b/zone/spawn2.h index 4956e13d0..0a2310899 100644 --- a/zone/spawn2.h +++ b/zone/spawn2.h @@ -68,7 +68,7 @@ public: uint32 spawn2_id; uint32 respawn_; - bool NPCPointerValid() { return (npcthis!=NULL); } + bool NPCPointerValid() { return (npcthis!=nullptr); } void SetNPCPointer(NPC* n) { npcthis = n; } void SetTimer(uint32 duration) { timer.Start(duration); } protected: diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index e6adf29b5..4af61d9a1 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -123,7 +123,7 @@ SpawnGroupList::~SpawnGroupList() { } void SpawnGroupList::AddSpawnGroup(SpawnGroup* newGroup) { - if(newGroup == NULL) + if(newGroup == nullptr) return; groups[newGroup->id] = newGroup; } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 1560e5592..6ecf97715 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -96,7 +96,7 @@ void Mob::ApplySpecialAttackMod(SkillType skill, int32 &dmg, int32 &mindmg) { } if (item_slot >= 0){ - const ItemInst* itm = NULL; + const ItemInst* itm = nullptr; itm = CastToClient()->GetInv().GetItem(item_slot); if(itm) dmg += itm->GetItem()->AC * (RuleI(Combat, SpecialAttackACBonus))/100; @@ -472,7 +472,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) } } else{ - if(GetWeaponDamage(other, (const Item_Struct*)NULL) <= 0){ + if(GetWeaponDamage(other, (const Item_Struct*)nullptr) <= 0){ ndamage = -5; } } @@ -600,7 +600,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) int32 backstab_dmg = 0; if(IsClient()){ - const ItemInst *wpn = NULL; + const ItemInst *wpn = nullptr; wpn = CastToClient()->GetInv().GetItem(SLOT_PRIMARY); primaryweapondamage = GetWeaponDamage(other, wpn); backstab_dmg = wpn->GetItem()->BackstabDmg; @@ -672,7 +672,7 @@ void Mob::RogueAssassinate(Mob* other) { //can you dodge, parry, etc.. an assassinate?? //if so, use DoSpecialAttackDamage(other, BACKSTAB, 32000); instead - if(GetWeaponDamage(other, IsClient()?CastToClient()->GetInv().GetItem(SLOT_PRIMARY):(const ItemInst*)NULL) > 0){ + if(GetWeaponDamage(other, IsClient()?CastToClient()->GetInv().GetItem(SLOT_PRIMARY):(const ItemInst*)nullptr) > 0){ other->Damage(this, 32000, SPELL_UNKNOWN, BACKSTAB); }else{ other->Damage(this, -5, SPELL_UNKNOWN, BACKSTAB); @@ -731,7 +731,7 @@ void Client::RangedAttack(Mob* other) { bool found = false; for(r = SLOT_PERSONAL_BEGIN; r <= SLOT_PERSONAL_END; r++) { const ItemInst *pi = m_inv[r]; - if(pi == NULL || !pi->IsType(ItemClassContainer)) + if(pi == nullptr || !pi->IsType(ItemClassContainer)) continue; const Item_Struct* bagitem = pi->GetItem(); if(!bagitem || bagitem->BagType != bagTypeQuiver) @@ -937,7 +937,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Item } //try proc on hits and misses - if((RangeWeapon != NULL) && GetTarget() && other && (other->GetHP() > -10)) + if((RangeWeapon != nullptr) && GetTarget() && other && (other->GetHP() > -10)) { TryWeaponProc(RangeWeapon, other, 11); } @@ -954,8 +954,8 @@ void NPC::RangedAttack(Mob* other) } //if we have SPECATK_RANGED_ATK set then we range attack without weapon or ammo - const Item_Struct* weapon = NULL; - const Item_Struct* ammo = NULL; + const Item_Struct* weapon = nullptr; + const Item_Struct* ammo = nullptr; if(!SpecAttacks[SPECATK_RANGED_ATK]) { //find our bow and ammo return if we can't find them... @@ -1124,7 +1124,7 @@ void Client::ThrowingAttack(Mob* other) { //old was 51 if(RangeWeapon->GetCharges() == 1) { //first check ammo const ItemInst* AmmoItem = m_inv[SLOT_AMMO]; - if(AmmoItem != NULL && AmmoItem->GetID() == RangeWeapon->GetID()) { + if(AmmoItem != nullptr && AmmoItem->GetID() == RangeWeapon->GetID()) { //more in the ammo slot, use it RangeWeapon = AmmoItem; ammo_slot = SLOT_AMMO; @@ -1217,7 +1217,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite int16 WDmg = 0; - if (!weapon_damage && item != NULL) + if (!weapon_damage && item != nullptr) WDmg = GetWeaponDamage(other, item); else WDmg = weapon_damage; @@ -1250,7 +1250,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite other->Damage(this, TotalDmg, SPELL_UNKNOWN, THROWING); } - if((RangeWeapon != NULL) && GetTarget() && other && (other->GetHP() > -10)) + if((RangeWeapon != nullptr) && GetTarget() && other && (other->GetHP() > -10)) TryWeaponProc(RangeWeapon, other, 11); } @@ -1302,7 +1302,7 @@ void Mob::SendItemAnimation(Mob *to, const Item_Struct *item, SkillType skillInU void Mob::ProjectileAnimation(Mob* to, uint16 item_id, bool IsArrow, float speed, float angle, float tilt, float arc) { - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; uint8 item_type = 0; if(!item_id) { @@ -1362,7 +1362,7 @@ void Mob::ProjectileAnimation(Mob* to, uint16 item_id, bool IsArrow, float speed void NPC::DoClassAttacks(Mob *target) { - if(target == NULL) + if(target == nullptr) return; //gotta have a target for all these bool taunt_time = taunt_timer.Check(); @@ -1450,7 +1450,7 @@ void NPC::DoClassAttacks(Mob *target) { DoAnim(animKick); int32 dmg = 0; - if(GetWeaponDamage(target, (const Item_Struct*)NULL) <= 0){ + if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ dmg = -5; } else{ @@ -1472,7 +1472,7 @@ void NPC::DoClassAttacks(Mob *target) { DoAnim(animTailRake); int32 dmg = 0; - if(GetWeaponDamage(target, (const Item_Struct*)NULL) <= 0){ + if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ dmg = -5; } else{ @@ -1527,7 +1527,7 @@ void NPC::DoClassAttacks(Mob *target) { DoAnim(animKick); int32 dmg = 0; - if(GetWeaponDamage(target, (const Item_Struct*)NULL) <= 0){ + if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ dmg = -5; } else{ @@ -1553,7 +1553,7 @@ void NPC::DoClassAttacks(Mob *target) { DoAnim(animTailRake); int32 dmg = 0; - if(GetWeaponDamage(target, (const Item_Struct*)NULL) <= 0){ + if(GetWeaponDamage(target, (const Item_Struct*)nullptr) <= 0){ dmg = -5; } else{ @@ -1813,7 +1813,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte) /* void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) { - if (who == NULL) + if (who == nullptr) return; if(DivineAura()) @@ -1832,7 +1832,7 @@ void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) { // a mob will not be taunted if its target's health is below 20% if ((hate_top != this) && (who->GetLevel() < level) - && (hate_top == NULL || hate_top->GetHPRatio() >= 20) ) { + && (hate_top == nullptr || hate_top->GetHPRatio() >= 20) ) { int32 newhate, tauntvalue; float tauntchance; @@ -1898,7 +1898,7 @@ void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) { void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) { - if (who == NULL) + if (who == nullptr) return; if(DivineAura()) @@ -1921,7 +1921,7 @@ void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) { } //All values used based on live parses after taunt was updated in 2006. - if ((hate_top && hate_top->GetHPRatio() >= 20) || hate_top == NULL) { + if ((hate_top && hate_top->GetHPRatio() >= 20) || hate_top == nullptr) { int32 newhate = 0; float tauntchance = 50.0f; @@ -2083,7 +2083,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillType skil if(GetLevel() >= 28 && IsWarriorClass() ) { - int ucDamageBonus = GetWeaponDamageBonus((const Item_Struct*) NULL ); + int ucDamageBonus = GetWeaponDamageBonus((const Item_Struct*) nullptr ); min_hit += (int) ucDamageBonus; max_hit += (int) ucDamageBonus; @@ -2170,14 +2170,14 @@ bool Mob::CanDoSpecialAttack(Mob *other) { //Make sure everything is valid before doing any attacks. if (!other) { - SetTarget(NULL); + SetTarget(nullptr); return false; } if(!GetTarget()) SetTarget(other); - if ((other == NULL || ((IsClient() && CastToClient()->dead) || (other->IsClient() && other->CastToClient()->dead)) + if ((other == nullptr || ((IsClient() && CastToClient()->dead) || (other->IsClient() && other->CastToClient()->dead)) || HasDied() || (!IsAttackAllowed(other)))) { return false; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 4c7d4cb98..adaf0cd50 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -48,7 +48,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) _ZP(Mob_SpellEffect); int caster_level, buffslot, effect, effect_value, i; - ItemInst *SummonedItem=NULL; + ItemInst *SummonedItem=nullptr; #ifdef SPELL_EFFECT_SPAM #define _EDLEN 200 char effect_desc[_EDLEN]; @@ -143,7 +143,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) { if(parse->SpellHasQuestSub(spell_id, "EVENT_SPELL_EFFECT_NPC")) { - parse->EventSpell(EVENT_SPELL_EFFECT_NPC, CastToNPC(), NULL, spell_id, caster ? caster->GetID() : 0); + parse->EventSpell(EVENT_SPELL_EFFECT_NPC, CastToNPC(), nullptr, spell_id, caster ? caster->GetID() : 0); CalcBonuses(); return true; } @@ -152,7 +152,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) { if(parse->SpellHasQuestSub(spell_id, "EVENT_SPELL_EFFECT_CLIENT")) { - parse->EventSpell(EVENT_SPELL_EFFECT_CLIENT, NULL, CastToClient(), spell_id, caster ? caster->GetID() : 0); + parse->EventSpell(EVENT_SPELL_EFFECT_CLIENT, nullptr, CastToClient(), spell_id, caster ? caster->GetID() : 0); CalcBonuses(); return true; } @@ -697,7 +697,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) caster->Message(0, "Unable to cast charm on a corpse."); BuffFadeByEffect(SE_Charm); break; - } else if(caster->GetPet() != NULL && caster->IsClient()) { + } else if(caster->GetPet() != nullptr && caster->IsClient()) { caster->Message(0, "You cannot charm something when you already have a pet."); BuffFadeByEffect(SE_Charm); break; @@ -1128,7 +1128,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } charges = charges < 1 ? 1 : (charges > 20 ? 20 : charges); ItemInst *SubItem=database.CreateItem(spell.base[i],charges); - if (SubItem!=NULL) { + if (SubItem!=nullptr) { SummonedItem->PutItem(slot,*SubItem); safe_delete(SubItem); } @@ -1403,7 +1403,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) char eye_name[64]; snprintf(eye_name, sizeof(eye_name), "Eye_of_%s", caster->GetCleanName()); int duration = CalcBuffDuration(caster, this, spell_id) * 6; - caster->TemporaryPets(spell_id, NULL, eye_name, duration); + caster->TemporaryPets(spell_id, nullptr, eye_name, duration); } break; } @@ -2030,7 +2030,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) caster->TemporaryPets(spell_id, this, pet_name); } else - caster->TemporaryPets(spell_id, this, NULL); + caster->TemporaryPets(spell_id, this, nullptr); break; } @@ -2114,11 +2114,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) switch(spells[spell_id].skill) { case THROWING: - caster->DoThrowingAttackDmg(this, NULL, NULL, spells[spell_id].base[i],spells[spell_id].base2[i], focus); + caster->DoThrowingAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i], focus); break; case ARCHERY: - caster->DoArcheryAttackDmg(this, NULL, NULL, spells[spell_id].base[i],spells[spell_id].base2[i],focus); + caster->DoArcheryAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i],focus); break; default: @@ -3070,7 +3070,7 @@ void Mob::DoBuffTic(uint16 spell_id, uint32 ticsremaining, uint8 caster_level, M { if(parse->SpellHasQuestSub(spell_id, "EVENT_SPELL_EFFECT_BUFF_TIC_NPC")) { - parse->EventSpell(EVENT_SPELL_EFFECT_BUFF_TIC_NPC, CastToNPC(), NULL, spell_id, caster ? caster->GetID() : 0); + parse->EventSpell(EVENT_SPELL_EFFECT_BUFF_TIC_NPC, CastToNPC(), nullptr, spell_id, caster ? caster->GetID() : 0); return; } } @@ -3078,7 +3078,7 @@ void Mob::DoBuffTic(uint16 spell_id, uint32 ticsremaining, uint8 caster_level, M { if(parse->SpellHasQuestSub(spell_id, "EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT")) { - parse->EventSpell(EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT, NULL, CastToClient(), spell_id, caster ? caster->GetID() : 0); + parse->EventSpell(EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT, nullptr, CastToClient(), spell_id, caster ? caster->GetID() : 0); return; } } @@ -3590,7 +3590,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) { if(IsClient()) { - CastToClient()->SetBindSightTarget(NULL); + CastToClient()->SetBindSightTarget(nullptr); } break; } @@ -3682,7 +3682,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) { EQApplicationPacket *outapp = MakeBuffsPacket(); - entity_list.QueueClientsByTarget(this, outapp, false, NULL, true, false, BIT_SoDAndLater); + entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater); if(GetTarget() == this) { CastToClient()->QueuePacket(outapp); } @@ -4654,7 +4654,7 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { if (SizeProcList > MAX_SYMPATHETIC) continue; - TempItem = NULL; + TempItem = nullptr; ItemInst* ins = GetInv().GetItem(x); if (!ins) continue; @@ -4675,7 +4675,7 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { if (SizeProcList > MAX_SYMPATHETIC) continue; - ItemInst *aug = NULL; + ItemInst *aug = nullptr; aug = ins->GetAugment(y); if(aug) { @@ -4761,7 +4761,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) { //item focus for(int x=0; x<=21; x++) { - TempItem = NULL; + TempItem = nullptr; ItemInst* ins = GetInv().GetItem(x); if (!ins) continue; @@ -4795,7 +4795,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) { for(int y = 0; y < MAX_AUGMENT_SLOTS; ++y) { - ItemInst *aug = NULL; + ItemInst *aug = nullptr; aug = ins->GetAugment(y); if(aug) { @@ -4833,7 +4833,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) { //Tribute Focus for(int x = TRIBUTE_SLOT_START; x < (TRIBUTE_SLOT_START + MAX_PLAYER_TRIBUTES); ++x) { - TempItem = NULL; + TempItem = nullptr; ItemInst* ins = GetInv().GetItem(x); if (!ins) continue; diff --git a/zone/spells.cpp b/zone/spells.cpp index 6ff8bb3b8..99cf37a69 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -320,9 +320,9 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, { _ZP(Mob_DoCastSpell); - Mob* pMob = NULL; + Mob* pMob = nullptr; int32 orgcasttime; - EQApplicationPacket *outapp = NULL; + EQApplicationPacket *outapp = nullptr; if(!IsValidSpell(spell_id)) { InterruptSpell(); @@ -463,7 +463,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, outapp->priority = 3; entity_list.QueueCloseClients(this, outapp, false, 200, 0, true); //IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS); safe_delete(outapp); - outapp = NULL; + outapp = nullptr; return(true); } @@ -489,19 +489,19 @@ uint16 Mob::GetSpecializeSkillValue(uint16 spell_id) const { void Client::CheckSpecializeIncrease(uint16 spell_id) { switch(spells[spell_id].skill) { case ABJURE: - CheckIncreaseSkill(SPECIALIZE_ABJURE, NULL); + CheckIncreaseSkill(SPECIALIZE_ABJURE, nullptr); break; case ALTERATION: - CheckIncreaseSkill(SPECIALIZE_ALTERATION, NULL); + CheckIncreaseSkill(SPECIALIZE_ALTERATION, nullptr); break; case CONJURATION: - CheckIncreaseSkill(SPECIALIZE_CONJURATION, NULL); + CheckIncreaseSkill(SPECIALIZE_CONJURATION, nullptr); break; case DIVINATION: - CheckIncreaseSkill(SPECIALIZE_DIVINATION, NULL); + CheckIncreaseSkill(SPECIALIZE_DIVINATION, nullptr); break; case EVOCATION: - CheckIncreaseSkill(SPECIALIZE_EVOCATION, NULL); + CheckIncreaseSkill(SPECIALIZE_EVOCATION, nullptr); break; default: //wtf... @@ -513,47 +513,47 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){ switch(spells[spell_id].skill) { case SINGING: - CheckIncreaseSkill(SINGING, NULL, -15); + CheckIncreaseSkill(SINGING, nullptr, -15); break; case PERCUSSION_INSTRUMENTS: if(this->itembonuses.percussionMod > 0) { if(GetRawSkill(PERCUSSION_INSTRUMENTS) > 0) // no skill increases if not trained in the instrument - CheckIncreaseSkill(PERCUSSION_INSTRUMENTS, NULL, -15); + CheckIncreaseSkill(PERCUSSION_INSTRUMENTS, nullptr, -15); else Message_StringID(13,NO_INSTRUMENT_SKILL); // tell the client that they need instrument training } else - CheckIncreaseSkill(SINGING, NULL, -15); + CheckIncreaseSkill(SINGING, nullptr, -15); break; case STRINGED_INSTRUMENTS: if(this->itembonuses.stringedMod > 0) { if(GetRawSkill(STRINGED_INSTRUMENTS) > 0) - CheckIncreaseSkill(STRINGED_INSTRUMENTS, NULL, -15); + CheckIncreaseSkill(STRINGED_INSTRUMENTS, nullptr, -15); else Message_StringID(13,NO_INSTRUMENT_SKILL); } else - CheckIncreaseSkill(SINGING, NULL, -15); + CheckIncreaseSkill(SINGING, nullptr, -15); break; case WIND_INSTRUMENTS: if(this->itembonuses.windMod > 0) { if(GetRawSkill(WIND_INSTRUMENTS) > 0) - CheckIncreaseSkill(WIND_INSTRUMENTS, NULL, -15); + CheckIncreaseSkill(WIND_INSTRUMENTS, nullptr, -15); else Message_StringID(13,NO_INSTRUMENT_SKILL); } else - CheckIncreaseSkill(SINGING, NULL, -15); + CheckIncreaseSkill(SINGING, nullptr, -15); break; case BRASS_INSTRUMENTS: if(this->itembonuses.brassMod > 0) { if(GetRawSkill(BRASS_INSTRUMENTS) > 0) - CheckIncreaseSkill(BRASS_INSTRUMENTS, NULL, -15); + CheckIncreaseSkill(BRASS_INSTRUMENTS, nullptr, -15); else Message_StringID(13,NO_INSTRUMENT_SKILL); } else - CheckIncreaseSkill(SINGING, NULL, -15); + CheckIncreaseSkill(SINGING, nullptr, -15); break; default: break; @@ -858,7 +858,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, bardsong = spell_id; bardsong_slot = slot; //NOTE: theres a lot more target types than this to think about... - if (spell_target == NULL || (spells[spell_id].targettype != ST_Target && spells[spell_id].targettype != ST_AETarget)) + if (spell_target == nullptr || (spells[spell_id].targettype != ST_Target && spells[spell_id].targettype != ST_AETarget)) bardsong_target_id = GetID(); else bardsong_target_id = spell_target->GetID(); @@ -1189,10 +1189,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // skills if(slot < MAX_PP_MEMSPELL) { - c->CheckIncreaseSkill(spells[spell_id].skill, NULL); + c->CheckIncreaseSkill(spells[spell_id].skill, nullptr); // increased chance of gaining channel skill if you regained concentration - c->CheckIncreaseSkill(CHANNELING, NULL, regain_conc ? 5 : 0); + c->CheckIncreaseSkill(CHANNELING, nullptr, regain_conc ? 5 : 0); c->CheckSpecializeIncrease(spell_id); } @@ -1247,7 +1247,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce bodyType mob_body = spell_target ? spell_target->GetBodyType() : BT_Humanoid; if(IsPlayerIllusionSpell(spell_id) - && spell_target != NULL // null ptr crash safeguard + && spell_target != nullptr // null ptr crash safeguard && !spell_target->IsNPC() // still self only if NPC targetted && IsClient() && (IsGrouped() // still self only if not grouped @@ -1418,7 +1418,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce case ST_AEBard: case ST_AECaster: { - spell_target = NULL; + spell_target = nullptr; ae_center = this; CastAction = AECaster; break; @@ -1426,7 +1426,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce case ST_HateList: { - spell_target = NULL; + spell_target = nullptr; ae_center = this; CastAction = CAHateList; break; @@ -1588,13 +1588,13 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce case ST_Directional: CastAction = DirectionalAE; - spell_target = NULL; - ae_center = NULL; + spell_target = nullptr; + ae_center = nullptr; break; case ST_TargetsTarget: { - Mob *spell_target_tot = spell_target ? spell_target->GetTarget() : NULL; + Mob *spell_target_tot = spell_target ? spell_target->GetTarget() : nullptr; if(!spell_target_tot) return false; //Verfied from live - Target's Target needs to be in combat range to recieve the effect @@ -1625,8 +1625,8 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 { _ZP(Mob_SpellFinished); - //EQApplicationPacket *outapp = NULL; - Mob *ae_center = NULL; + //EQApplicationPacket *outapp = nullptr; + Mob *ae_center = nullptr; if(!IsValidSpell(spell_id)) return false; @@ -1702,7 +1702,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 Beacon *beacon = new Beacon(beacon_loc, spells[spell_id].AEDuration); entity_list.AddBeacon(beacon); mlog(SPELLS__CASTING, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); - spell_target = NULL; + spell_target = nullptr; ae_center = beacon; CastAction = AECaster; } @@ -1734,7 +1734,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 && CastToClient()->CheckAAEffect(aaEffectProjectIllusion)){ range = 100; } - if(spell_target != NULL && spell_target != this) { + if(spell_target != nullptr && spell_target != this) { //casting a spell on somebody but ourself, make sure they are in range float dist2 = DistNoRoot(*spell_target); float range2 = range * range; @@ -1766,7 +1766,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 } #endif //BOTS - if(spell_target == NULL) { + if(spell_target == nullptr) { mlog(SPELLS__CASTING, "Spell %d: Targeted spell, but we have no target", spell_id); return(false); } @@ -1801,7 +1801,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 #endif //BOTS // we can't cast an AE spell without something to center it on - assert(ae_center != NULL); + assert(ae_center != nullptr); if(ae_center->IsBeacon()) { // special ae duration spell @@ -2026,14 +2026,14 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { } //determine the type of spell target we have - Mob *ae_center = NULL; + Mob *ae_center = nullptr; CastAction_type CastAction; if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) { mlog(SPELLS__BARDS, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); return(false); } - if(ae_center != NULL && ae_center->IsBeacon()) { + if(ae_center != nullptr && ae_center->IsBeacon()) { mlog(SPELLS__BARDS, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); return(false); } @@ -2064,7 +2064,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { float range = 0.00f; range = GetActSpellRange(spell_id, spells[spell_id].range, true); - if(spell_target != NULL && spell_target != this) { + if(spell_target != nullptr && spell_target != this) { //casting a spell on somebody but ourself, make sure they are in range float dist2 = DistNoRoot(*spell_target); float range2 = range * range; @@ -2085,7 +2085,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case CastActUnknown: case SingleTarget: { - if(spell_target == NULL) { + if(spell_target == nullptr) { mlog(SPELLS__BARDS, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); return(false); } @@ -2106,7 +2106,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case AETarget: { // we can't cast an AE spell without something to center it on - if(ae_center == NULL) { + if(ae_center == nullptr) { mlog(SPELLS__BARDS, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); return(false); } @@ -2422,7 +2422,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int blocked_effect, blocked_below_value, blocked_slot; int overwrite_effect, overwrite_below_value, overwrite_slot; - mlog(SPELLS__STACKING, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==NULL)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==NULL)?"Nobody":caster2->GetName()); + mlog(SPELLS__STACKING, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); if(((spellid1 == spellid2) && (spellid1 == 2751)) || //special case spells that will block each other no matter what ((spellid1 == spellid2) && (spellid1 == 2755)) //manaburn / lifeburn @@ -2833,7 +2833,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid { EQApplicationPacket *outapp = MakeBuffsPacket(); - entity_list.QueueClientsByTarget(this, outapp, false, NULL, true, false, BIT_SoDAndLater); + entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater); if(GetTarget() == this) { CastToClient()->QueuePacket(outapp); @@ -3692,7 +3692,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) _ZP(Mob_IsImmuneToSpell); int effect_index; - if(caster == NULL) + if(caster == nullptr) return(false); //TODO: this function loops through the effect list for @@ -4816,7 +4816,7 @@ uint16 Mob::FindSpell(uint16 classp, uint16 level, uint8 type, uint8 spelltype) uint16 bestsofar = 0; uint16 bestspellid = 0; for (int i = 0; i < SPDAT_RECORDS; i++) { - if ((IsLifetapSpell(i) && spelltype == 1) || (spells[i].targettype != ST_Group && spells[i].targettype != ST_Undead && spells[i].targettype != ST_Summoned && spells[i].targettype != ST_Pet && strstr(spells[i].name,"Summoning") == NULL)) { + if ((IsLifetapSpell(i) && spelltype == 1) || (spells[i].targettype != ST_Group && spells[i].targettype != ST_Undead && spells[i].targettype != ST_Summoned && spells[i].targettype != ST_Pet && strstr(spells[i].name,"Summoning") == nullptr)) { int Canuse = CanUseSpell(i, classp, level); if (Canuse != 0) { for (int z=0; z < 12; z++) { @@ -5277,7 +5277,7 @@ EQApplicationPacket *Mob::MakeBuffsPacket(bool for_target) } } - EQApplicationPacket* outapp = NULL; + EQApplicationPacket* outapp = nullptr; //Create it for a targeting window, else create it for a create buff packet. if(for_target) @@ -5392,7 +5392,7 @@ void Client::InitializeBuffSlots() buffs[x].spellid = SPELL_UNKNOWN; } current_buff_count = 0; - buff_tic_timer = NULL; + buff_tic_timer = nullptr; } void Client::UninitializeBuffSlots() @@ -5409,7 +5409,7 @@ void NPC::InitializeBuffSlots() buffs[x].spellid = SPELL_UNKNOWN; } current_buff_count = 0; - buff_tic_timer = NULL; + buff_tic_timer = nullptr; } void NPC::UninitializeBuffSlots() diff --git a/zone/tasks.cpp b/zone/tasks.cpp index efc45175f..dcd3aad57 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -37,7 +37,7 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net) TaskManager::TaskManager() { for(int i=0; iActivityCount; j++) { safe_delete_array(Tasks[i]->Activity[j].Text1); safe_delete_array(Tasks[i]->Activity[j].Text2); @@ -247,7 +247,7 @@ bool TaskManager::LoadTasks(int SingleTask) { LogFile->write(EQEMuLog::Error, ERR_TASK_OR_ACTIVITY_OOR, TaskID, ActivityID); continue; } - if(Tasks[TaskID]==NULL) { + if(Tasks[TaskID]==nullptr) { LogFile->write(EQEMuLog::Error, ERR_NOTASK, TaskID, ActivityID); continue; } @@ -259,12 +259,12 @@ bool TaskManager::LoadTasks(int SingleTask) { if(Step >Tasks[TaskID]->LastStep) Tasks[TaskID]->LastStep = Step; // Task Activities MUST be numbered sequentially from 0. If not, log an error - // and set the task to NULL. Subsequent activities for this task will raise + // and set the task to nullptr. Subsequent activities for this task will raise // ERR_NOTASK errors. // Change to (ActivityID != (Tasks[TaskID]->ActivityCount + 1)) to index from 1 if(ActivityID != Tasks[TaskID]->ActivityCount) { LogFile->write(EQEMuLog::Error, ERR_SEQERR, TaskID, ActivityID); - Tasks[TaskID] = NULL; + Tasks[TaskID] = nullptr; continue; } @@ -438,7 +438,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { _log(TASKS__CLIENTSAVE, "TaskManager::SaveClientState Saving Completed Task at slot %i", i); int TaskID = state->CompletedTasks[i].TaskID; - if((TaskID<=0) || (TaskID>=MAXTASKS) || (Tasks[TaskID]==NULL)) continue; + if((TaskID<=0) || (TaskID>=MAXTASKS) || (Tasks[TaskID]==nullptr)) continue; // First we save a record with an ActivityID of -1. // This indicates this task was completed at the given time. We infer that all @@ -716,7 +716,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // If ActivityID is -1, Mark all the non-optional tasks as completed. if(ActivityID < 0) { TaskInformation* Task = Tasks[TaskID]; - if(Task == NULL) continue; + if(Task == nullptr) continue; for(int i=0; iActivityCount; i++) if(!Task->Activity[i].Optional) @@ -1050,7 +1050,7 @@ int TaskManager::NextTaskInSet(int TaskSetID, int TaskID) { bool TaskManager::AppropriateLevel(int TaskID, int PlayerLevel) { - if(Tasks[TaskID] == NULL) return false; + if(Tasks[TaskID] == nullptr) return false; if(Tasks[TaskID]->MinLevel && (PlayerLevel < Tasks[TaskID]->MinLevel)) return false; @@ -1155,10 +1155,10 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task for(int i=0; iMessage(0, "Task does not exist."); return; } @@ -1459,7 +1459,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { TaskInformation* Task = taskmanager->Tasks[ActiveTasks[TaskIndex].TaskID]; - if(Task==NULL) return true; + if(Task==nullptr) return true; // On loading the client state, all activities that are not completed, are // marked as hidden. For Sequential (non-stepped) mode, we mark the first @@ -1508,7 +1508,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { CompletedTaskInformation cti; cti.TaskID = ActiveTasks[TaskIndex].TaskID; - cti.CompletedTime = time(NULL); + cti.CompletedTime = time(nullptr); for(int i=0; iActivityCount; i++) cti.ActivityDone[i] = (ActiveTasks[TaskIndex].Activity[i].State == ActivityCompleted); @@ -1580,7 +1580,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { } CompletedTaskInformation cti; cti.TaskID = ActiveTasks[TaskIndex].TaskID; - cti.CompletedTime = time(NULL); + cti.CompletedTime = time(nullptr); for(int i=0; iActivityCount; i++) cti.ActivityDone[i] = (ActiveTasks[TaskIndex].Activity[i].State == ActivityCompleted); @@ -1634,7 +1634,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID]; - if(Task == NULL) return false; + if(Task == nullptr) return false; for(int j=0; jActivityCount; j++) { // We are not interested in completed or hidden activities @@ -1685,7 +1685,7 @@ int ClientTaskState::ActiveSpeakTask(int NPCTypeID) { TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID]; - if(Task == NULL) continue; + if(Task == nullptr) continue; for(int j=0; jActivityCount; j++) { // We are not interested in completed or hidden activities @@ -1716,7 +1716,7 @@ int ClientTaskState::ActiveSpeakActivity(int NPCTypeID, int TaskID) { TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID]; - if(Task == NULL) continue; + if(Task == nullptr) continue; for(int j=0; jActivityCount; j++) { // We are not interested in completed or hidden activities @@ -1754,7 +1754,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID]; - if(Task == NULL) return; + if(Task == nullptr) return; for(int j=0; jActivityCount; j++) { // We are not interested in completed or hidden activities @@ -1806,7 +1806,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID]; - if(Task == NULL) return; + if(Task == nullptr) return; for(int j=0; jActivityCount; j++) { // We are not interested in completed or hidden activities @@ -1861,7 +1861,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID]; - if(Task == NULL) return false; + if(Task == nullptr) return false; for(int j=0; jActivityCount; j++) { // We are not interested in completed or hidden activities @@ -1929,7 +1929,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID]; - if(Task == NULL) return; + if(Task == nullptr) return; for(int j=0; jActivityCount; j++) { // We are not interested in completed or hidden activities @@ -2179,7 +2179,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) { TaskInformation* Task = taskmanager->Tasks[ActiveTasks[ActiveTaskIndex].TaskID]; // The task is invalid - if(Task==NULL) return false; + if(Task==nullptr) return false; // The ActivityID is out of range if(ActivityID >= Task->ActivityCount) return false; @@ -2214,7 +2214,7 @@ void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, TaskInformation* Task = taskmanager->Tasks[ActiveTasks[ActiveTaskIndex].TaskID]; // The task is invalid - if(Task==NULL) return; + if(Task==nullptr) return; // The ActivityID is out of range if(ActivityID >= Task->ActivityCount) return; @@ -2248,7 +2248,7 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { TaskInformation* Task = taskmanager->Tasks[ActiveTasks[ActiveTaskIndex].TaskID]; // The task is invalid - if(Task==NULL) return; + if(Task==nullptr) return; // The ActivityID is out of range if(ActivityID >= Task->ActivityCount) return; @@ -2295,11 +2295,11 @@ int ClientTaskState::TaskTimeLeft(int TaskID) { if(ActiveTasks[i].TaskID != TaskID) continue; - int Now = time(NULL); + int Now = time(nullptr); TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID]; - if(Task == NULL) return -1; + if(Task == nullptr) return -1; if(!Task->Duration) return -1; @@ -2335,7 +2335,7 @@ bool TaskManager::IsTaskRepeatable(int TaskID) { TaskInformation* Task = taskmanager->Tasks[TaskID]; - if(Task == NULL) return false; + if(Task == nullptr) return false; return Task->Repeatable; } @@ -2348,11 +2348,11 @@ bool ClientTaskState::TaskOutOfTime(int Index) { if((ActiveTasks[Index].TaskID <= 0) || (ActiveTasks[Index].TaskID >= MAXTASKS)) return false; - int Now = time(NULL); + int Now = time(nullptr); TaskInformation* Task = taskmanager->Tasks[ActiveTasks[Index].TaskID]; - if(Task == NULL) return false; + if(Task == nullptr) return false; return (Task->Duration && (ActiveTasks[Index].AcceptedTime + Task->Duration <= Now)); @@ -2441,7 +2441,7 @@ void ClientTaskState::SendTaskHistory(Client *c, int TaskIndex) { TaskInformation* Task = taskmanager->Tasks[TaskID]; - if(Task == NULL) return; + if(Task == nullptr) return; TaskHistoryReplyHeader_Struct* ths; TaskHistoryReplyData1_Struct* thd1; @@ -2585,13 +2585,13 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State) /* for(iterator=State->CompletedTasks.begin(); iterator!=State->CompletedTasks.end(); iterator++) { int TaskID = (*iterator).TaskID; - if(Tasks[TaskID] == NULL) continue; + if(Tasks[TaskID] == nullptr) continue; PacketLength = PacketLength + 8 + strlen(Tasks[TaskID]->Title) + 1; } */ for(int i = FirstTaskToSend; iCompletedTasks[i].TaskID; - if(Tasks[TaskID] == NULL) continue; + if(Tasks[TaskID] == nullptr) continue; PacketLength = PacketLength + 8 + strlen(Tasks[TaskID]->Title) + 1; } @@ -2605,7 +2605,7 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State) // int TaskID = (*iterator).TaskID; for(int i = FirstTaskToSend; iCompletedTasks[i].TaskID; - if(Tasks[TaskID] == NULL) continue; + if(Tasks[TaskID] == nullptr) continue; *(uint32 *)buf = TaskID; buf = buf + 4; @@ -3184,7 +3184,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) { } - if(taskmanager->Tasks[TaskID] == NULL) { + if(taskmanager->Tasks[TaskID] == nullptr) { c->Message(13, "Invalid TaskID %i", TaskID); return; } @@ -3226,7 +3226,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) { ActiveTasks[FreeSlot].TaskID = TaskID; - ActiveTasks[FreeSlot].AcceptedTime = time(NULL); + ActiveTasks[FreeSlot].AcceptedTime = time(nullptr); ActiveTasks[FreeSlot].Updated = true; ActiveTasks[FreeSlot].CurrentStep = -1; @@ -3280,7 +3280,7 @@ void ClientTaskState::ProcessTaskProximities(Client *c, float X, float Y, float TaskGoalListManager::TaskGoalListManager() { - TaskGoalLists = NULL; + TaskGoalLists = nullptr; NumberOfLists = 0; } diff --git a/zone/titles.cpp b/zone/titles.cpp index 0c339af42..e6a2e5f61 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -34,7 +34,7 @@ bool TitleManager::LoadTitles() TitleEntry Title; char errbuf[MYSQL_ERRMSG_SIZE]; - char *query = NULL; + char *query = nullptr; MYSQL_RES *result; MYSQL_ROW row; @@ -252,7 +252,7 @@ void TitleManager::CreateNewPlayerTitle(Client *c, const char *Title) return; char errbuf[MYSQL_ERRMSG_SIZE]; - char *query = NULL; + char *query = nullptr; MYSQL_RES *result; char *EscTitle = new char[strlen(Title) * 2 + 1]; @@ -296,7 +296,7 @@ void TitleManager::CreateNewPlayerSuffix(Client *c, const char *Suffix) return; char errbuf[MYSQL_ERRMSG_SIZE]; - char *query = NULL; + char *query = nullptr; MYSQL_RES *result; char *EscSuffix = new char[strlen(Suffix) * 2 + 1]; diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 3bcd96ca1..867fabd57 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -44,7 +44,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme return; } - ItemInst* container = NULL; + ItemInst* container = nullptr; if (worldo) { @@ -54,7 +54,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme { // Check to see if they have an inventory container type 53 that is used for this. Inventory& user_inv = user->GetInv(); - ItemInst* inst = NULL; + ItemInst* inst = nullptr; inst = user_inv.GetItem(in_augment->container_slot); if (inst) @@ -92,7 +92,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme return; } - ItemInst *tobe_auged, *auged_with = NULL; + ItemInst *tobe_auged, *auged_with = nullptr; int8 slot=-1; // Verify 2 items in the augmentation device @@ -133,7 +133,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme bool deleteItems = false; - ItemInst *itemOneToPush = NULL, *itemTwoToPush = NULL; + ItemInst *itemOneToPush = nullptr, *itemTwoToPush = nullptr; // Adding augment if (in_augment->augment_slot == -1) @@ -151,7 +151,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme } else { - ItemInst *old_aug=NULL; + ItemInst *old_aug=nullptr; const uint32 id=auged_with->GetID(); if (id==40408 || id==40409 || id==40410) tobe_auged->DeleteAugment(in_augment->augment_slot); @@ -215,8 +215,8 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob Inventory& user_inv = user->GetInv(); PlayerProfile_Struct& user_pp = user->GetPP(); - ItemInst* container = NULL; - ItemInst* inst = NULL; + ItemInst* container = nullptr; + ItemInst* inst = nullptr; uint8 c_type = 0xE8; uint32 some_id = 0; bool worldcontainer=false; @@ -634,7 +634,7 @@ void Client::TradeskillSearchResults(const char *query, unsigned long qlen, uint8 r; for(r = 0; r < qcount; r++) { row = mysql_fetch_row(result); - if(row == NULL || row[0] == NULL || row[1] == NULL || row[2] == NULL || row[3] == NULL || row[5] == NULL) + if(row == nullptr || row[0] == nullptr || row[1] == nullptr || row[2] == nullptr || row[3] == nullptr || row[5] == nullptr) continue; uint32 recipe = (uint32)atoi(row[0]); const char *name = row[1]; @@ -647,7 +647,7 @@ void Client::TradeskillSearchResults(const char *query, unsigned long qlen, // explicitly learned are excempt from that limit if (RuleB(Skills, UseLimitTradeskillSearchSkillDiff)) { if (((int32)trivial - (int32)GetSkill((SkillType)tradeskill)) > RuleI(Skills, MaxTradeskillSearchSkillDiff) - && row[4] == NULL) + && row[4] == nullptr) { continue; } @@ -731,8 +731,8 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { row = mysql_fetch_row(result); //watch for references to items which are not in the - //items table, which the left join will make NULL... - if(row[2] == NULL || row[3] == NULL) { + //items table, which the left join will make nullptr... + if(row[2] == nullptr || row[3] == nullptr) { continue; } @@ -789,7 +789,7 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { //returns true on success bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { - if(spec == NULL) + if(spec == nullptr) return(false); uint16 user_skill = GetSkill(spec->tradeskill); @@ -916,7 +916,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { break; } } - const Item_Struct* item = NULL; + const Item_Struct* item = nullptr; if (spec->tradeskill == BLACKSMITHING) { switch(GetAA(aaBlacksmithingMastery)) { @@ -1284,7 +1284,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 MYSQL_RES *TSresult; MYSQL_ROW TSrow; if (RunQuery(TSquery, MakeAnyLenString(&TSquery, "SELECT item_id, componentcount from tradeskill_recipe_entries where recipe_id=%i AND componentcount > 0", recipe_id), TSerrbuf, &TSresult)) { - while((TSrow = mysql_fetch_row(TSresult))!=NULL) { + while((TSrow = mysql_fetch_row(TSresult))!=nullptr) { int ccnt = 0; for(int x = 0; x < 10; x++){ const ItemInst* inst = container->GetItem(x); @@ -1366,7 +1366,7 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id spec->name = row[6]; spec->must_learn = (uint8)atoi(row[7]); spec->quest = atoi(row[8]) ? true : false; - if (row[9] == NULL) { + if (row[9] == nullptr) { spec->has_learnt = false; spec->madecount = 0; } else { @@ -1492,9 +1492,9 @@ void Client::LearnRecipe(uint32 recipeID) row = mysql_fetch_row(result); - if (row != NULL && row[0] != NULL) { + if (row != nullptr && row[0] != nullptr) { // Only give Learn message if character doesn't know the recipe - if (row[1] == NULL) { + if (row[1] == nullptr) { Message_StringID(4, TRADESKILL_LEARN_RECIPE, row[0]); // Actually learn the recipe now qlen = MakeAnyLenString(&query, "INSERT INTO char_recipe_list " diff --git a/zone/trading.cpp b/zone/trading.cpp index 472fedfe6..363faff69 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -272,7 +272,7 @@ void Trade::DumpTrade() { Mob* with = With(); LogFile->write(EQEMuLog::Debug, "Dumping trade data: '%s' in TradeState %i with '%s'", - this->owner->GetName(), state, ((with==NULL)?"(null)":with->GetName())); + this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName())); if (!owner->IsClient()) return; @@ -341,8 +341,8 @@ void Client::FinishTrade(Mob* tradingWith, ServerPacket* qspack, bool finalizer) mlog(TRADING__CLIENT, "Finishing trade with client %s", other->GetName()); int16 slot_id; - const Item_Struct* item = NULL; - QSPlayerLogTrade_Struct* qsaudit = NULL; + const Item_Struct* item = nullptr; + QSPlayerLogTrade_Struct* qsaudit = nullptr; bool QSPLT = false; // QS code @@ -359,7 +359,7 @@ void Client::FinishTrade(Mob* tradingWith, ServerPacket* qspack, bool finalizer) const ItemInst* inst = m_inv[i]; uint16 parent_offset = 0; - if(inst == NULL) { continue; } + if(inst == nullptr) { continue; } mlog(TRADING__CLIENT, "Giving %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, i, other->GetName()); @@ -388,7 +388,7 @@ void Client::FinishTrade(Mob* tradingWith, ServerPacket* qspack, bool finalizer) for(uint8 j = 0; j < inst->GetItem()->BagSlots; j++) { const ItemInst* baginst = inst->GetItem(j); - if(baginst == NULL) { continue; } + if(baginst == nullptr) { continue; } int16 k=Inventory::CalcSlotId(i, j); item_count = qsaudit->char1_count + qsaudit->char2_count; @@ -427,7 +427,7 @@ void Client::FinishTrade(Mob* tradingWith, ServerPacket* qspack, bool finalizer) for(uint8 bagslot_idx = 0; bagslot_idx < inst->GetItem()->BagSlots; bagslot_idx++) { const ItemInst* bag_inst = inst->GetItem(bagslot_idx); - if(bag_inst == NULL) { continue; } + if(bag_inst == nullptr) { continue; } int16 to_bagslot_id = Inventory::CalcSlotId(slot_id, bagslot_idx); qsaudit->items[++parent_offset].to_slot = to_bagslot_id; @@ -447,7 +447,7 @@ void Client::FinishTrade(Mob* tradingWith, ServerPacket* qspack, bool finalizer) for(uint8 bagslot_idx = 0; bagslot_idx < inst->GetItem()->BagSlots; bagslot_idx++) { const ItemInst* bag_inst = inst->GetItem(bagslot_idx); - if(bag_inst == NULL) { continue; } + if(bag_inst == nullptr) { continue; } int16 to_bagslot_id = Inventory::CalcSlotId(SLOT_CURSOR, bagslot_idx); qsaudit->items[++parent_offset].to_id = this->character_id; @@ -471,7 +471,7 @@ void Client::FinishTrade(Mob* tradingWith, ServerPacket* qspack, bool finalizer) for(uint8 bagslot_idx = 0; bagslot_idx < inst->GetItem()->BagSlots; bagslot_idx++) { const ItemInst* bag_inst = inst->GetItem(bagslot_idx); - if(bag_inst == NULL) { continue; } + if(bag_inst == nullptr) { continue; } int16 to_bagslot_id = Inventory::CalcSlotId(SLOT_CURSOR, bagslot_idx); qsaudit->items[++parent_offset].to_id = this->character_id; @@ -505,7 +505,7 @@ void Client::FinishTrade(Mob* tradingWith, ServerPacket* qspack, bool finalizer) } } else if(tradingWith && tradingWith->IsNPC()) { - QSPlayerLogHandin_Struct* qsaudit = NULL; + QSPlayerLogHandin_Struct* qsaudit = nullptr; bool QSPLH = false; // QS code @@ -924,17 +924,17 @@ void Client::BulkSendTraderInventory(uint32 char_id) { safe_delete(inst); } else - _log(TRADING__CLIENT, "Client::BulkSendTraderInventory NULL inst pointer"); + _log(TRADING__CLIENT, "Client::BulkSendTraderInventory nullptr inst pointer"); } else - _log(TRADING__CLIENT, "Client::BulkSendTraderInventory NULL item pointer or item is NODROP %8X",item); + _log(TRADING__CLIENT, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); } safe_delete(TraderItems); } ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ - ItemInst* item = NULL; + ItemInst* item = nullptr; uint16 SlotID = 0; for(int i = 0; i < 8;i++){ item = this->GetInv().GetItem(22 + i); @@ -951,13 +951,13 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ } _log(TRADING__CLIENT, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); - return NULL; + return nullptr; } GetItems_Struct* Client::GetTraderItems(){ - const ItemInst* item = NULL; + const ItemInst* item = nullptr; uint16 SlotID = 0; GetItems_Struct* gis= new GetItems_Struct; @@ -988,7 +988,7 @@ GetItems_Struct* Client::GetTraderItems(){ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ - const ItemInst* item= NULL; + const ItemInst* item= nullptr; uint16 SlotID = 0; for(int i = 0; i < 8;i++){ item = this->GetInv().GetItem(22+i); @@ -1082,7 +1082,7 @@ void Client::TraderUpdate(uint16 SlotID,uint32 TraderID){ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* Customer, uint16 TraderSlot){ - const ItemInst* item= NULL; + const ItemInst* item= nullptr; bool Stackable = false; int16 Charges=0; @@ -2050,7 +2050,7 @@ void Client::SendBuyerResults(char* SearchString, uint32 SearchID) { } uint32 LastCharID = 0; - Client *Buyer = NULL; + Client *Buyer = nullptr; while ((Row = mysql_fetch_row(Result))) { @@ -2714,7 +2714,7 @@ void Client::BuyerItemSearch(const EQApplicationPacket *app) { pdest = strstr(Name, Criteria); - if (pdest != NULL) { + if (pdest != nullptr) { sprintf(bisr->Results[Count].ItemName, item->Name); bisr->Results[Count].ItemID = item->ID; bisr->Results[Count].Unknown068 = item->Icon; diff --git a/zone/trap.cpp b/zone/trap.cpp index 771414c22..9a8a143cd 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -26,20 +26,20 @@ Schema: CREATE TABLE traps ( - id int(11) NOT NULL auto_increment, - zone varchar(16) NOT NULL default '', - x int(11) NOT NULL default '0', - y int(11) NOT NULL default '0', - z int(11) NOT NULL default '0', - chance tinyint NOT NULL default '0', - maxzdiff float NOT NULL default '0', - radius float NOT NULL default '0', - effect int(11) NOT NULL default '0', - effectvalue int(11) NOT NULL default '0', - effectvalue2 int(11) NOT NULL default '0', - message varcahr(200) NOT NULL; - skill int(11) NOT NULL default '0', - spawnchance int(11) NOT NULL default '0', + id int(11) NOT nullptr auto_increment, + zone varchar(16) NOT nullptr default '', + x int(11) NOT nullptr default '0', + y int(11) NOT nullptr default '0', + z int(11) NOT nullptr default '0', + chance tinyint NOT nullptr default '0', + maxzdiff float NOT nullptr default '0', + radius float NOT nullptr default '0', + effect int(11) NOT nullptr default '0', + effectvalue int(11) NOT nullptr default '0', + effectvalue2 int(11) NOT nullptr default '0', + message varcahr(200) NOT nullptr; + skill int(11) NOT nullptr default '0', + spawnchance int(11) NOT nullptr default '0', PRIMARY KEY (id) ) TYPE=MyISAM; @@ -67,7 +67,7 @@ Trap::Trap() : disarmed = false; respawn_time = 0; respawn_var = 0; - hiddenTrigger = NULL; + hiddenTrigger = nullptr; ownHiddenTrigger = false; } @@ -188,7 +188,7 @@ void Trap::Trigger(Mob* trigger) trigger->SetHP(trigger->GetHP() - dmg); a->damage = dmg; a->sequence = MakeRandomInt(0, 1234567); - a->source = GetHiddenTrigger()!=NULL ? GetHiddenTrigger()->GetID() : trigger->GetID(); + a->source = GetHiddenTrigger()!=nullptr ? GetHiddenTrigger()->GetID() : trigger->GetID(); a->spellid = 0; a->target = trigger->GetID(); a->type = 253; @@ -205,7 +205,7 @@ Trap* EntityList::FindNearbyTrap(Mob* searcher, float max_dist) { LinkedListIterator iterator(trap_list); iterator.Reset(); float dist = 999999; - Trap* current_trap = NULL; + Trap* current_trap = nullptr; float max_dist2 = max_dist*max_dist; Trap *cur; diff --git a/zone/tribute.cpp b/zone/tribute.cpp index a6124d00a..acfab14f0 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -167,7 +167,7 @@ void Client::DoTributeUpdate() { //summon the item for them const ItemInst* inst = database.CreateItem(item_id, 1); - if(inst == NULL) + if(inst == nullptr) continue; PutItemInInventory(TRIBUTE_SLOT_START+r, *inst, false); @@ -246,7 +246,7 @@ void Client::SendTributeDetails(uint32 client_id, uint32 tribute_id) { int32 Client::TributeItem(uint32 slot, uint32 quantity) { const ItemInst*inst = m_inv[slot]; - if(inst == NULL) + if(inst == nullptr) return(0); //figure out what its worth @@ -398,7 +398,7 @@ bool ZoneDatabase::LoadTributes() { uint32 id = atoul(row[r++]); t.name = row[r++]; t.description = row[r++]; - t.unknown = strtoul(row[r++], NULL, 10); + t.unknown = strtoul(row[r++], nullptr, 10); t.is_guild = atol(row[r++])==0?false:true; tribute_list[id] = t; diff --git a/zone/updatemgr.h b/zone/updatemgr.h index 7ca4da0ef..5b3848b33 100644 --- a/zone/updatemgr.h +++ b/zone/updatemgr.h @@ -45,7 +45,7 @@ class Mob; class UMType { public: UMType() { - app = NULL; ack = false; + app = nullptr; ack = false; } UMType(EQApplicationPacket *_app, bool _ack) { app = _app; ack = _ack; diff --git a/zone/watermap.cpp b/zone/watermap.cpp index 3cf36a283..8196c360d 100644 --- a/zone/watermap.cpp +++ b/zone/watermap.cpp @@ -32,7 +32,7 @@ WaterMap::WaterMap() -: BSP_Root(NULL) +: BSP_Root(nullptr) { } @@ -86,28 +86,28 @@ WaterRegionType WaterMap::BSPReturnRegionType(int32 node_number, float y, float } bool WaterMap::InWater(float y, float x, float z) const { - if(BSP_Root == NULL) { + if(BSP_Root == nullptr) { return false; } return(BSPReturnRegionType(1, y, x, z) == RegionTypeWater); } bool WaterMap::InVWater(float y, float x, float z) const { - if(BSP_Root == NULL) { + if(BSP_Root == nullptr) { return false; } return(BSPReturnRegionType(1, y, x, z) == RegionTypeVWater); } bool WaterMap::InLava(float y, float x, float z) const { - if(BSP_Root == NULL) { + if(BSP_Root == nullptr) { return false; } return(BSPReturnRegionType(1, y, x, z) == RegionTypeLava); } bool WaterMap::InLiquid(float y, float x, float z) const { - if(BSP_Root == NULL) //if the water map isn't loaded, this will save ~1 CPU cycle + if(BSP_Root == nullptr) //if the water map isn't loaded, this will save ~1 CPU cycle return false; return (InWater(y, x, z) || InLava(y, x, z)); } @@ -116,26 +116,26 @@ WaterMap* WaterMap::LoadWaterMapfile(const char* in_zonename, const char *direct FILE *fp; char zBuf[64]; char cWork[256]; - WaterMap* ret = NULL; + WaterMap* ret = nullptr; //have to convert to lower because the short names im getting //are not all lower anymore, copy since strlwr edits the str. strn0cpy(zBuf, in_zonename, 64); - if(directory == NULL) + if(directory == nullptr) directory = MAP_DIR; snprintf(cWork, 250, "%s/%s.wtr", directory, strlwr(zBuf)); if ((fp = fopen( cWork, "rb" ))) { ret = new WaterMap(); - if(ret != NULL) { + if(ret != nullptr) { if(ret->loadWaterMap(fp)) { printf("Water Map %s loaded.\n", cWork); } else { safe_delete(ret); printf("Water Map %s exists but could not be processed.\n", cWork); - return NULL; + return nullptr; } } else { printf("Water Map %s loading failed.\n", cWork); @@ -177,7 +177,7 @@ bool WaterMap::loadWaterMap(FILE *fp) { BSP_Root = (ZBSP_Node *) new ZBSP_Node[BSPTreeSize]; - if(BSP_Root==NULL) { + if(BSP_Root==nullptr) { printf("Memory allocation failed while reading water map.\n"); return(false); } diff --git a/zone/watermap.h b/zone/watermap.h index 1820bf925..2f7466392 100644 --- a/zone/watermap.h +++ b/zone/watermap.h @@ -46,7 +46,7 @@ typedef enum { class WaterMap { public: - static WaterMap* LoadWaterMapfile(const char* in_zonename, const char *directory = NULL); + static WaterMap* LoadWaterMapfile(const char* in_zonename, const char *directory = nullptr); WaterRegionType BSPReturnRegionType(int32 node_number, float y, float x, float z) const; bool InWater(float y, float x, float z) const; bool InVWater(float y, float x, float z) const; diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 277e1539c..d2bdd9616 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -128,7 +128,7 @@ void NPC::ResumeWandering() itoa(cur_wp,temp,10); //do this before updating to next waypoint CalculateNewWaypoint(); SetAppearance(eaStanding, false); - parse->EventNPC(EVENT_WAYPOINT_DEPART, this, NULL, temp, 0); + parse->EventNPC(EVENT_WAYPOINT_DEPART, this, nullptr, temp, 0); } // if not currently at a waypoint, we continue on to the one we were headed to before the stop } else @@ -237,7 +237,7 @@ void NPC::UpdateWaypoint(int wp_index) { VERTEX dest(cur_wp_x, cur_wp_y, cur_wp_z); - float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, NULL, NULL); + float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, nullptr, nullptr); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaWaypoint)) cur_wp_z = newz + 1; @@ -564,7 +564,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b { VERTEX dest(x_pos, y_pos, z_pos); - float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, NULL, NULL); + float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, nullptr, nullptr); mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); @@ -673,7 +673,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b { VERTEX dest(x_pos, y_pos, z_pos); - float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, NULL, NULL); + float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, nullptr, nullptr); mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); @@ -790,7 +790,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec { VERTEX dest(x_pos, y_pos, z_pos); - float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, NULL, NULL); + float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, nullptr, nullptr); mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); @@ -900,7 +900,7 @@ void NPC::AssignWaypoints(int32 grid) { { VERTEX dest(newwp.x, newwp.y, newwp.z); - float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, NULL, NULL); + float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, nullptr, nullptr); if( (newz > -2000) && ABS(newz-dest.z) < RuleR(Map, FixPathingZMaxDeltaLoading)) newwp.z = newz + 1; @@ -951,7 +951,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { { VERTEX dest(x_pos, y_pos, z_pos); - float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, NULL, NULL); + float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, nullptr, nullptr); mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); @@ -978,7 +978,7 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) { { VERTEX dest(x_pos, y_pos, z_pos); - float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, NULL, NULL); + float newz = zone->zonemap->FindBestZ(MAP_ROOT_NODE, dest, nullptr, nullptr); mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index f7be0ac0b..c25af347e 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -321,7 +321,7 @@ void WorldServer::Process() { zc2->success = 1; // This block is necessary to clean up any merc objects owned by a Client. Maybe we should do this for bots, too? - if(entity->CastToClient()->GetMerc() != NULL) + if(entity->CastToClient()->GetMerc() != nullptr) { entity->CastToClient()->GetMerc()->ProcessClientZoneChange(entity->CastToClient()); } @@ -413,7 +413,7 @@ void WorldServer::Process() { if(strstr(sem->message,"^")==0) client->Message(sem->type, (char*)sem->message); else{ - for(newmessage = strtok((char*)sem->message,"^");newmessage!=NULL;newmessage=strtok(NULL, "^")) + for(newmessage = strtok((char*)sem->message,"^");newmessage!=nullptr;newmessage=strtok(nullptr, "^")) client->Message(sem->type, newmessage); } } @@ -424,7 +424,7 @@ void WorldServer::Process() { if(strstr(sem->message,"^")==0) entity_list.MessageStatus(sem->guilddbid, sem->minstatus, sem->type, sem->message); else{ - for(newmessage = strtok((char*)sem->message,"^");newmessage!=NULL;newmessage=strtok(NULL, "^")) + for(newmessage = strtok((char*)sem->message,"^");newmessage!=nullptr;newmessage=strtok(nullptr, "^")) entity_list.MessageStatus(sem->guilddbid, sem->minstatus, sem->type, newmessage); } } @@ -525,7 +525,7 @@ void WorldServer::Process() { case ServerOP_ZonePlayer: { ServerZonePlayer_Struct* szp = (ServerZonePlayer_Struct*) pack->pBuffer; Client* client = entity_list.GetClientByName(szp->name); - printf("Zoning %s to %s(%u) - %u\n", client != NULL ? client->GetCleanName() : "Unknown", szp->zone, database.GetZoneID(szp->zone), szp->instance_id); + printf("Zoning %s to %s(%u) - %u\n", client != nullptr ? client->GetCleanName() : "Unknown", szp->zone, database.GetZoneID(szp->zone), szp->instance_id); if (client != 0) { if (strcasecmp(szp->adminname, szp->name) == 0) client->Message(0, "Zoning to: %s", szp->zone); @@ -745,9 +745,9 @@ void WorldServer::Process() { char buffer[5]; snprintf(buffer,5,"%i",zb->port); //just to be sure that it will work on linux if(zb->zoneid != 0) - execl(net.GetZoneFileName(),net.GetZoneFileName(),database.GetZoneName(zb->zoneid),zb->ip2, buffer,inet_ntoa(in), NULL); + execl(net.GetZoneFileName(),net.GetZoneFileName(),database.GetZoneName(zb->zoneid),zb->ip2, buffer,inet_ntoa(in), nullptr); else - execl(net.GetZoneFileName(),net.GetZoneFileName(),".",zb->ip2, buffer,inet_ntoa(in), NULL); + execl(net.GetZoneFileName(),net.GetZoneFileName(),".",zb->ip2, buffer,inet_ntoa(in), nullptr); #endif break; } @@ -763,7 +763,7 @@ void WorldServer::Process() { safe_delete(outapp); //TEST char timeMessage[255]; - time_t timeCurrent = time(NULL); + time_t timeCurrent = time(nullptr); TimeOfDay_Struct eqTime; zone->zone_time.getEQTimeOfDay( timeCurrent, &eqTime); //if ( eqTime.hour >= 0 && eqTime.minute >= 0 ) @@ -912,7 +912,7 @@ void WorldServer::Process() { safe_delete(outapp); - if(!group->AddMember(NULL, sgfs->gf.name2, sgfs->CharacterID)) + if(!group->AddMember(nullptr, sgfs->gf.name2, sgfs->CharacterID)) break; if(Inviter->CastToClient()->IsLFP()) @@ -960,7 +960,7 @@ void WorldServer::Process() { uint32 groupid = database.GetGroupID(c->GetName()); - Group* group = NULL; + Group* group = nullptr; if(groupid > 0) { @@ -973,7 +973,7 @@ void WorldServer::Process() { if(group->GetID() != 0) entity_list.AddGroup(group, groupid); else - group = NULL; + group = nullptr; } //else, somebody from our group is already here... if(group) @@ -1515,7 +1515,7 @@ void WorldServer::Process() { ServerSpawnStatusChange_Struct *ssc = (ServerSpawnStatusChange_Struct*)pack->pBuffer; LinkedListIterator iterator(zone->spawn2_list); iterator.Reset(); - Spawn2 *found_spawn = NULL; + Spawn2 *found_spawn = nullptr; while(iterator.MoreElements()) { Spawn2* cur = iterator.GetData(); diff --git a/zone/zone.cpp b/zone/zone.cpp index aa58d1bd9..557354d8a 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -179,7 +179,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { //this really loads the objects into entity_list bool Zone::LoadZoneObjects() { char errbuf[MYSQL_ERRMSG_SIZE]; - char* query = NULL; + char* query = nullptr; MYSQL_RES *result; MYSQL_ROW row; @@ -273,7 +273,7 @@ bool Zone::LoadZoneObjects() { data.unknown076 = (uint32)atoi(row[idx++]); data.unknown084 = 0; - ItemInst* inst = NULL; + ItemInst* inst = nullptr; //FatherNitwit: this dosent seem to work... //tradeskill containers do not have an itemid of 0... at least what I am seeing if (itemid == 0) { @@ -286,7 +286,7 @@ bool Zone::LoadZoneObjects() { } //Father Nitwit's fix... not perfect... - if(inst == NULL && type != OT_DROPPEDITEM) { + if(inst == nullptr && type != OT_DROPPEDITEM) { inst = new ItemInst(ItemUseWorldContainer); } @@ -327,7 +327,7 @@ bool Zone::LoadGroundSpawns() { uint32 gsnumber=0; for(gsindex=0;gsindex<50;gsindex++){ if(groundspawn.spawn[gsindex].item>0 && groundspawn.spawn[gsindex].item<500000){ - ItemInst* inst = NULL; + ItemInst* inst = nullptr; inst = database.CreateItem(groundspawn.spawn[gsindex].item); gsnumber=groundspawn.spawn[gsindex].max_allowed; ix=0; @@ -786,8 +786,8 @@ void Zone::DBAWComplete(uint8 workpt_b1, DBAsyncWork* dbaw) { char errbuf[MYSQL_ERRMSG_SIZE]; MYSQL_RES* result = 0; DBAsyncQuery* dbaq = dbaw->PopAnswer(); - if(dbaq == NULL) { - LogFile->write(EQEMuLog::Error, "NULL answer provided for async merchant list load."); + if(dbaq == nullptr) { + LogFile->write(EQEMuLog::Error, "nullptr answer provided for async merchant list load."); break; } if(!dbaq->GetAnswer(errbuf, &result)) { @@ -808,8 +808,8 @@ void Zone::DBAWComplete(uint8 workpt_b1, DBAsyncWork* dbaw) { char errbuf[MYSQL_ERRMSG_SIZE]; MYSQL_RES* result = 0; DBAsyncQuery* dbaq = dbaw->PopAnswer(); - if(dbaq == NULL) { - LogFile->write(EQEMuLog::Error, "NULL answer provided for async temp merchant list load."); + if(dbaq == nullptr) { + LogFile->write(EQEMuLog::Error, "nullptr answer provided for async temp merchant list load."); break; } if(!dbaq->GetAnswer(errbuf, &result)) { @@ -922,10 +922,10 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) zoneid = in_zoneid; instanceid = in_instanceid; instanceversion = database.GetInstanceVersion(instanceid); - zonemap = NULL; - watermap = NULL; - pathing = NULL; - qGlobals = NULL; + zonemap = nullptr; + watermap = nullptr; + pathing = nullptr; + qGlobals = nullptr; default_ruleset = 0; if(RuleB(TaskSystem, EnableTaskSystem)) { @@ -971,13 +971,13 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) LogFile->write(EQEMuLog::Debug, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); weather_type = 0; zone_weather = 0; - blocked_spells = NULL; + blocked_spells = nullptr; totalBS = 0; - aas = NULL; + aas = nullptr; totalAAs = 0; gottime = false; - Instance_Shutdown_Timer = NULL; + Instance_Shutdown_Timer = nullptr; bool is_perma = false; if(instanceid > 0) { @@ -991,23 +991,23 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) } else { - Instance_Timer = NULL; + Instance_Timer = nullptr; } } else { - Instance_Timer = NULL; + Instance_Timer = nullptr; } - adv_data = NULL; - map_name = NULL; - Instance_Warning_timer = NULL; + adv_data = nullptr; + map_name = nullptr; + Instance_Warning_timer = nullptr; did_adventure_actions = false; database.QGlobalPurge(); if(zoneid == RuleI(World, GuildBankZoneID)) GuildBanks = new GuildBankManager; else - GuildBanks = NULL; + GuildBanks = nullptr; } Zone::~Zone() { @@ -1035,7 +1035,7 @@ Zone::~Zone() { safe_delete_array(adv_data); safe_delete_array(map_name); - if(aas != NULL) { + if(aas != nullptr) { int r; for(r = 0; r < totalAAs; r++) { uchar *data = (uchar *) aas[r]; @@ -1217,7 +1217,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe memset(&newzone_data, 0, sizeof(NewZone_Struct)); if(instance_id == 0) { - map_name = NULL; + map_name = nullptr; if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, default_ruleset, &map_name)) { @@ -1228,7 +1228,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe else { //Fall back to base zone if we don't find the instance version. - map_name = NULL; + map_name = nullptr; if(!database.GetZoneCFG(database.GetZoneID(filename), instance_id, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, default_ruleset, &map_name)) { @@ -1379,7 +1379,7 @@ bool Zone::Process() { if(GetInstanceID() > 0) { - if(Instance_Timer != NULL && Instance_Shutdown_Timer == NULL) + if(Instance_Timer != nullptr && Instance_Shutdown_Timer == nullptr) { if(Instance_Timer->Check()) { @@ -1388,9 +1388,9 @@ bool Zone::Process() { Instance_Shutdown_Timer = new Timer(20000); //20 seconds } - if(adv_data == NULL) + if(adv_data == nullptr) { - if(Instance_Warning_timer == NULL) + if(Instance_Warning_timer == nullptr) { uint32 rem_time = Instance_Timer->GetRemainingTime(); if(rem_time < 60000 && rem_time > 55000) @@ -1415,7 +1415,7 @@ bool Zone::Process() { } } } - else if(Instance_Shutdown_Timer != NULL) + else if(Instance_Shutdown_Timer != nullptr) { if(Instance_Shutdown_Timer->Check()) { @@ -1618,7 +1618,7 @@ ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, uint32 to, Clien } if(closest_dist > max_distance2) - closest_zp = NULL; + closest_zp = nullptr; if(!closest_zp) closest_zp = GetClosestZonePointWithoutZone(x, y, z, client); @@ -1627,7 +1627,7 @@ ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, uint32 to, Clien } ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, const char* to_name, Client* client, float max_distance) { - if(to_name == NULL) + if(to_name == nullptr) return GetClosestZonePointWithoutZone(x,y,z, client, max_distance); return GetClosestZonePoint(x, y, z, database.GetZoneID(to_name), client, max_distance); } @@ -1665,7 +1665,7 @@ ZonePoint* Zone::GetClosestZonePointWithoutZone(float x, float y, float z, Clien iterator.Advance(); } if(closest_dist > max_distance2) - closest_zp = NULL; + closest_zp = nullptr; return closest_zp; } @@ -1699,7 +1699,7 @@ bool ZoneDatabase::LoadStaticZonePoints(LinkedList* zone_point_list, zp->target_heading = atof(row[8]); zp->number = atoi(row[9]); zp->target_zone_instance = atoi(row[10]); - zp->client_version_mask = (uint32)strtoul(row[11], NULL, 0); + zp->client_version_mask = (uint32)strtoul(row[11], nullptr, 0); zone_point_list->Insert(zp); zone->numzonepoints++; } @@ -2386,7 +2386,7 @@ void Zone::LoadLDoNTrapEntries() uint32 id = atoi(row[0]); uint32 trap_id = atoi(row[1]); - LDoNTrapTemplate *tt = NULL; + LDoNTrapTemplate *tt = nullptr; std::map::iterator it; it = ldon_trap_list.find(trap_id); if(it == ldon_trap_list.end()) diff --git a/zone/zone.h b/zone/zone.h index 8a8e2a9bf..5c331272f 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -239,8 +239,8 @@ public: bool IsSpellBlocked(uint32 spell_id, float nx, float ny, float nz); const char *GetSpellBlockedMessage(uint32 spell_id, float nx, float ny, float nz); int GetTotalBlockedSpells() { return totalBS; } - inline bool HasMap() { return zonemap != NULL; } - inline bool HasWaterMap() { return watermap != NULL; } + inline bool HasMap() { return zonemap != nullptr; } + inline bool HasWaterMap() { return watermap != nullptr; } QGlobalCache *GetQGlobals() { return qGlobals; } QGlobalCache *CreateQGlobals() { qGlobals = new QGlobalCache(); return qGlobals; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 6e2953534..36e74c5f2 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -38,7 +38,7 @@ void ZoneDatabase::ZDBInitVars() { npc_spells_cache = 0; npc_spells_loadtried = 0; max_faction = 0; - faction_array = NULL; + faction_array = nullptr; } ZoneDatabase::~ZoneDatabase() { @@ -51,7 +51,7 @@ ZoneDatabase::~ZoneDatabase() { } safe_delete_array(npc_spells_loadtried); - if (faction_array != NULL) { + if (faction_array != nullptr) { for (x=0; x <= max_faction; x++) { if (faction_array[x] != 0) safe_delete(faction_array[x]); @@ -167,7 +167,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 timeleft) { timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); uint32 cur = tv.tv_sec; char errbuf[MYSQL_ERRMSG_SIZE]; @@ -214,7 +214,7 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) if(row) { timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); uint32 resStart = atoi(row[0]); uint32 resDuration = atoi(row[1]); @@ -289,7 +289,7 @@ void ZoneDatabase::UpdateBug(BugStruct* bug){ uint32 len = strlen(bug->bug); - char* bugtext = NULL; + char* bugtext = nullptr; if(len > 0) { bugtext = new char[2*len+1]; @@ -298,7 +298,7 @@ void ZoneDatabase::UpdateBug(BugStruct* bug){ } len = strlen(bug->ui); - char* uitext = NULL; + char* uitext = nullptr; if(len > 0) { uitext = new char[2*len+1]; @@ -307,7 +307,7 @@ void ZoneDatabase::UpdateBug(BugStruct* bug){ } len = strlen(bug->target_name); - char* targettext = NULL; + char* targettext = nullptr; if(len > 0) { targettext = new char[2*len+1]; @@ -318,8 +318,8 @@ void ZoneDatabase::UpdateBug(BugStruct* bug){ //x and y are intentionally swapped because eq is inversexy coords if (!RunQuery(query, MakeAnyLenString(&query, "INSERT INTO bugs (zone, name, ui, x, y, z, type, flag, target, bug, date) " "values('%s', '%s', '%s', '%.2f', '%.2f', '%.2f', '%s', %d, '%s', '%s', CURDATE())", zone->GetShortName(), bug->name, - uitext==NULL?"":uitext, bug->y, bug->x, bug->z, bug->chartype, bug->type, targettext==NULL?"Unknown Target":targettext, - bugtext==NULL?"":bugtext), errbuf)) { + uitext==nullptr?"":uitext, bug->y, bug->x, bug->z, bug->chartype, bug->type, targettext==nullptr?"Unknown Target":targettext, + bugtext==nullptr?"":bugtext), errbuf)) { cerr << "Error in UpdateBug" << query << "' " << errbuf << endl; } safe_delete_array(query); @@ -473,7 +473,7 @@ void ZoneDatabase::GetEventLogs(const char* name,char* target,uint32 account_id, void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) { if (!container) { - LogFile->write(EQEMuLog::Error, "Programming error: LoadWorldContainer passed NULL pointer"); + LogFile->write(EQEMuLog::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); return; } @@ -481,8 +481,8 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) char* query = 0; MYSQL_RES *result; MYSQL_ROW row; - //const Item_Struct* item = NULL; - //ItemInst* inst = NULL; + //const Item_Struct* item = nullptr; + //ItemInst* inst = nullptr; uint32 len_query = MakeAnyLenString(&query, "select " "bagidx,itemid,charges,augslot1,augslot2,augslot3,augslot4,augslot5 from object_contents where parentid=%i", parentid); @@ -646,7 +646,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { if (mysql_num_rows(result) != 1) { _log(TRADING__CLIENT, "Bad result from query\n"); fflush(stdout); - return NULL; + return nullptr; } row = mysql_fetch_row(result); int ItemID = atoi(row[1]); @@ -657,14 +657,14 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { if(!item) { _log(TRADING__CLIENT, "Unable to create item\n"); fflush(stdout); - return NULL; + return nullptr; } if (item && (item->NoDrop!=0)) { ItemInst* inst = database.CreateItem(item); if(!inst) { _log(TRADING__CLIENT, "Unable to create item instance\n"); fflush(stdout); - return NULL; + return nullptr; } inst->SetCharges(Charges); @@ -678,7 +678,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { } } - return NULL; + return nullptr; } @@ -898,7 +898,7 @@ bool ZoneDatabase::GetCharacterInfoForLogin_result(MYSQL_RES* result, pp->y = atof(row[4]); pp->z = atof(row[5]); - pp->lastlogin = time(NULL); + pp->lastlogin = time(nullptr); if (pp->x == -1 && pp->y == -1 && pp->z == -1) GetSafePoints(pp->zone_id, database.GetInstanceVersion(pp->zoneInstance), &pp->x, &pp->y, &pp->z); @@ -913,13 +913,13 @@ bool ZoneDatabase::GetCharacterInfoForLogin_result(MYSQL_RES* result, strcpy(current_zone, row[2]); if (guilddbid) { - if(row[6] != NULL) + if(row[6] != nullptr) *guilddbid = atoi(row[6]); else *guilddbid = GUILD_NONE; } if (guildrank) { - if(row[7] != NULL) + if(row[7] != nullptr) *guildrank = atoi(row[7]); else *guildrank = GUILD_RANK_NONE; @@ -983,11 +983,11 @@ bool ZoneDatabase::NoRentExpired(const char* name){ } /* Searches npctable for matching id, and returns the item if found, - * or NULL otherwise. If id passed is 0, loads all npc_types for + * or nullptr otherwise. If id passed is 0, loads all npc_types for * the current zone, returning the last item added. */ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { - const NPCType *npc=NULL; + const NPCType *npc=nullptr; map::iterator itr; // If NPC is already in tree, return it. @@ -1179,8 +1179,8 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { if (tmpNPCType->armor_tint[0] == 0) { char at_errbuf[MYSQL_ERRMSG_SIZE]; - char *at_query = NULL; - MYSQL_RES *at_result = NULL; + char *at_query = nullptr; + MYSQL_RES *at_result = nullptr; MYSQL_ROW at_row; MakeAnyLenString(&at_query, @@ -1241,7 +1241,7 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { tmpNPCType->see_invis = atoi(row[r++]); tmpNPCType->see_invis_undead = atoi(row[r++])==0?false:true; // Set see_invis_undead flag - if (row[r] != NULL) + if (row[r] != nullptr) strn0cpy(tmpNPCType->lastname, row[r], 32); r++; @@ -1269,7 +1269,7 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { { cerr << "Error loading duplicate NPC " << tmpNPCType->npc_id << endl; delete tmpNPCType; - npc = NULL; + npc = nullptr; } else { zone->npctable[tmpNPCType->npc_id]=tmpNPCType; npc = tmpNPCType; @@ -1290,7 +1290,7 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 clientlevel) { - const NPCType *npc=NULL; + const NPCType *npc=nullptr; map::iterator itr; //need to save based on merc_npc_type & client level @@ -1299,9 +1299,9 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client // If NPC is already in tree, return it. if((itr = zone->merctable.find(merc_type_id)) != zone->merctable.end()) return itr->second; - //If the NPC type is 0, return NULL. (sanity check) + //If the NPC type is 0, return nullptr. (sanity check) if(id == 0) - return NULL; + return nullptr; // Otherwise, get NPCs from database. char errbuf[MYSQL_ERRMSG_SIZE]; @@ -1490,8 +1490,8 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client if (tmpNPCType->armor_tint[0] == 0) { char at_errbuf[MYSQL_ERRMSG_SIZE]; - char *at_query = NULL; - MYSQL_RES *at_result = NULL; + char *at_query = nullptr; + MYSQL_RES *at_result = nullptr; MYSQL_ROW at_row; MakeAnyLenString(&at_query, @@ -1552,7 +1552,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client //tmpNPCType->see_invis = atoi(row[r++]); //tmpNPCType->see_invis_undead = atoi(row[r++])==0?false:true; // Set see_invis_undead flag - //if (row[r] != NULL) + //if (row[r] != nullptr) // strn0cpy(tmpNPCType->lastname, row[r], 32); //r++; @@ -1579,7 +1579,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client if (zone->merctable.find(tmpNPCType->npc_id * 100 + clientlevel) != zone->merctable.end()) { delete tmpNPCType; - npc = NULL; + npc = nullptr; } else { zone->merctable[tmpNPCType->npc_id * 100 + clientlevel]=tmpNPCType; npc = tmpNPCType; @@ -2290,7 +2290,7 @@ void ZoneDatabase::RefreshGroupFromDB(Client *c){ MYSQL_ROW row; strcpy(gu->yourname, c->GetName()); - GetGroupLeadershipInfo(g->GetID(), gu->leadersname, NULL, NULL, NULL, NULL, &gu->leader_aas); + GetGroupLeadershipInfo(g->GetID(), gu->leadersname, nullptr, nullptr, nullptr, nullptr, &gu->leader_aas); gu->NPCMarkerID = g->GetNPCMarkerID(); int index = 0; @@ -2336,7 +2336,7 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid){ MYSQL_ROW row; uint8 count=0; if (RunQuery(query, MakeAnyLenString(&query, "SELECT count(charid) FROM group_id WHERE groupid=%d", groupid), errbuf, &result)) { - if((row = mysql_fetch_row(result))!=NULL) + if((row = mysql_fetch_row(result))!=nullptr) count = atoi(row[0]); mysql_free_result(result); } else { @@ -2354,7 +2354,7 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid){ MYSQL_ROW row; uint8 count=0; if (RunQuery(query, MakeAnyLenString(&query, "SELECT count(charid) FROM raid_members WHERE raidid=%d AND groupid=%d;", raidid, groupid), errbuf, &result)) { - if((row = mysql_fetch_row(result))!=NULL) + if((row = mysql_fetch_row(result))!=nullptr) count = atoi(row[0]); mysql_free_result(result); } else { @@ -2376,7 +2376,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid) if (RunQuery(query, strlen(query), errbuf, &result)) { safe_delete_array(query); row = mysql_fetch_row(result); - if (row != NULL && row[0] != 0) { + if (row != nullptr && row[0] != 0) { int32 ret = atoi(row[0]); mysql_free_result(result); return ret; @@ -3143,7 +3143,7 @@ bool ZoneDatabase::LoadFactionData() faction_array = new Faction*[max_faction+1]; for(unsigned int i=0; iDBAWComplete(workpt.b1(), dbaw); break; diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 674a36e81..84c3e4e3a 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -49,7 +49,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { uint16 target_zone_id = 0; uint16 target_instance_id = zc->instanceID; - ZonePoint* zone_point = NULL; + ZonePoint* zone_point = nullptr; //figure out where they are going. if(zc->zoneID == 0) { @@ -146,7 +146,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //make sure its a valid zone. const char *target_zone_name = database.GetZoneName(target_zone_id); - if(target_zone_name == NULL) { + if(target_zone_name == nullptr) { //invalid zone... Message(13, "Invalid target zone ID."); LogFile->write(EQEMuLog::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); @@ -215,7 +215,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //client requested a zoning... what are the cases when this could happen? //Handle zone point case: - if(zone_point != NULL) { + if(zone_point != nullptr) { //they are zoning using a valid zone point, figure out coords //999999 is a placeholder for 'same as where they were from' @@ -422,7 +422,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, if(GetPetID() != 0) { //if they have a pet and they are staying in zone, move with them Mob *p = GetPet(); - if(p != NULL){ + if(p != nullptr){ p->SetPetOrder(SPO_Follow); p->GMMove(x+15, y, z); //so it dosent have to run across the map. } @@ -464,8 +464,8 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z, float heading, uint8 ignorerestrictions, ZoneMode zm) { bool ReadyToZone = true; int iZoneNameLength = 0; - const char* pShortZoneName = NULL; - char* pZoneName = NULL; + const char* pShortZoneName = nullptr; + char* pZoneName = nullptr; pShortZoneName = database.GetZoneName(zoneID); database.GetZoneLongName(pShortZoneName, &pZoneName); @@ -799,9 +799,9 @@ void Client::SendZoneFlagInfo(Client *to) const { const char *short_name = database.GetZoneName(zoneid); - char *long_name = NULL; + char *long_name = nullptr; database.GetZoneLongName(short_name, &long_name); - if(long_name == NULL) + if(long_name == nullptr) long_name = empty; float safe_x, safe_y, safe_z; From e2fd78b51063d4d38a065bddeddfc25b30fda373 Mon Sep 17 00:00:00 2001 From: j883376 Date: Sun, 5 May 2013 06:47:53 -0400 Subject: [PATCH 2/3] Fix Auto XTargets not clearing on death --- zone/attack.cpp | 1 + zone/client.cpp | 16 ++++++++++++++++ zone/client.h | 1 + 3 files changed, 18 insertions(+) diff --git a/zone/attack.cpp b/zone/attack.cpp index 1bbb6efa8..b311ac28c 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1486,6 +1486,7 @@ void Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ entity_list.RemoveFromTargets(this); hate_list.RemoveEnt(this); + RemoveAutoXTargets(); //remove ourself from all proximities diff --git a/zone/client.cpp b/zone/client.cpp index b468f922e..9f73e8371 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -6990,6 +6990,22 @@ void Client::RemoveGroupXTargets() } } +void Client::RemoveAutoXTargets() +{ + if(!XTargettingAvailable()) + return; + + for(int i = 0; i < GetMaxXTargets(); ++i) + { + if(XTargets[i].Type == Auto) + { + XTargets[i].ID = 0; + XTargets[i].Name[0] = 0; + SendXTargetPacket(i, NULL); + } + } +} + void Client::ShowXTargets(Client *c) { if(!c) diff --git a/zone/client.h b/zone/client.h index 2d7aa2ac7..93eb3b945 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1095,6 +1095,7 @@ public: void RemoveXTarget(Mob *m, bool OnlyAutoSlots); void SendXTargetPacket(uint32 Slot, Mob *m); void RemoveGroupXTargets(); + void RemoveAutoXTargets(); void ShowXTargets(Client *c); void InitializeMercInfo(); bool CheckCanHireMerc(Mob* merchant, uint32 template_id); From 4a0749f811a82709728928c818d68645c9a3fa35 Mon Sep 17 00:00:00 2001 From: j883376 Date: Sun, 5 May 2013 18:51:20 -0400 Subject: [PATCH 3/3] Change NULL to nullptr in RemoveAutoXTargets() --- zone/client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index 9f73e8371..6063bb306 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -7001,7 +7001,7 @@ void Client::RemoveAutoXTargets() { XTargets[i].ID = 0; XTargets[i].Name[0] = 0; - SendXTargetPacket(i, NULL); + SendXTargetPacket(i, nullptr); } } }