diff --git a/apps/openmw/mwmp/CellController.cpp b/apps/openmw/mwmp/CellController.cpp index 0b9797281..795cba1a9 100644 --- a/apps/openmw/mwmp/CellController.cpp +++ b/apps/openmw/mwmp/CellController.cpp @@ -183,7 +183,7 @@ void CellController::removeLocalActorRecord(std::string actorIndex) bool CellController::isLocalActor(MWWorld::Ptr ptr) { - if (ptr.mRef == NULL) + if (ptr.mRef == nullptr) return false; std::string mapIndex = generateMapIndex(ptr); @@ -231,7 +231,7 @@ bool CellController::isDedicatedActor(int refNumIndex, int mpNum) bool CellController::isDedicatedActor(MWWorld::Ptr ptr) { - if (ptr.mRef == NULL) + if (ptr.mRef == nullptr) return false; std::string mapIndex = generateMapIndex(ptr); @@ -313,7 +313,7 @@ MWWorld::CellStore *CellController::getCellStore(const ESM::Cell& cell) } catch (std::exception&) { - cellStore = NULL; + cellStore = nullptr; } } diff --git a/apps/openmw/mwmp/GUIController.cpp b/apps/openmw/mwmp/GUIController.cpp index 105fcd1f9..70d96db12 100644 --- a/apps/openmw/mwmp/GUIController.cpp +++ b/apps/openmw/mwmp/GUIController.cpp @@ -92,7 +92,7 @@ void mwmp::GUIController::showDialogList(const mwmp::BasePlayer::GUIMessageBox & { MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager(); windowManager->removeDialog(mListBox); - mListBox = NULL; + mListBox = nullptr; std::vector list; @@ -360,7 +360,7 @@ void mwmp::GUIController::setGlobalMapMarkerTooltip(MWGui::MapWindow *mapWindow, if (!destNotes.empty()) { - MWGui::LocalMapBase::MarkerUserData data (NULL); + MWGui::LocalMapBase::MarkerUserData data (nullptr); data.notes = destNotes; data.caption = markerWidget->getUserString("Caption_TextOneLine"); diff --git a/apps/openmw/mwmp/MechanicsHelper.cpp b/apps/openmw/mwmp/MechanicsHelper.cpp index a77e0e4dc..ace4dc93e 100644 --- a/apps/openmw/mwmp/MechanicsHelper.cpp +++ b/apps/openmw/mwmp/MechanicsHelper.cpp @@ -71,7 +71,7 @@ Attack *MechanicsHelper::getLocalAttack(const MWWorld::Ptr& ptr) else if (mwmp::Main::get().getCellController()->isLocalActor(ptr)) return &mwmp::Main::get().getCellController()->getLocalActor(ptr)->attack; - return NULL; + return nullptr; } Attack *MechanicsHelper::getDedicatedAttack(const MWWorld::Ptr& ptr) @@ -81,7 +81,7 @@ Attack *MechanicsHelper::getDedicatedAttack(const MWWorld::Ptr& ptr) else if (mwmp::Main::get().getCellController()->isDedicatedActor(ptr)) return &mwmp::Main::get().getCellController()->getDedicatedActor(ptr)->attack; - return NULL; + return nullptr; } MWWorld::Ptr MechanicsHelper::getPlayerPtr(const Target& target) @@ -90,11 +90,11 @@ MWWorld::Ptr MechanicsHelper::getPlayerPtr(const Target& target) { if (target.guid == mwmp::Main::get().getLocalPlayer()->guid) return MWBase::Environment::get().getWorld()->getPlayerPtr(); - else if (PlayerList::getPlayer(target.guid) != NULL) + else if (PlayerList::getPlayer(target.guid) != nullptr) return PlayerList::getPlayer(target.guid)->getPtr(); } - return NULL; + return nullptr; } void MechanicsHelper::assignAttackTarget(Attack* attack, const MWWorld::Ptr& target) @@ -154,7 +154,7 @@ void MechanicsHelper::processAttack(Attack attack, const MWWorld::Ptr& attacker) { if (attack.target.guid == mwmp::Main::get().getLocalPlayer()->guid) victim = MWBase::Environment::get().getWorld()->getPlayerPtr(); - else if (PlayerList::getPlayer(attack.target.guid) != NULL) + else if (PlayerList::getPlayer(attack.target.guid) != nullptr) victim = PlayerList::getPlayer(attack.target.guid)->getPtr(); } else @@ -182,7 +182,7 @@ void MechanicsHelper::processAttack(Attack attack, const MWWorld::Ptr& attacker) weapon = MWWorld::Ptr(); } - if (victim.mRef != NULL) + if (victim.mRef != nullptr) { bool healthdmg = true; diff --git a/apps/openmw/mwmp/PlayerList.cpp b/apps/openmw/mwmp/PlayerList.cpp index 0586693b9..8c636a2de 100644 --- a/apps/openmw/mwmp/PlayerList.cpp +++ b/apps/openmw/mwmp/PlayerList.cpp @@ -91,7 +91,7 @@ void PlayerList::createPlayer(RakNet::RakNetGUID guid) dedicPlayer->state = 0; world->deleteObject(dedicPlayer->ptr); delete dedicPlayer->reference; - dedicPlayer->reference = NULL; + dedicPlayer->reference = nullptr; reset = true; } } @@ -255,7 +255,7 @@ DedicatedPlayer *PlayerList::getPlayer(const MWWorld::Ptr &ptr) bool PlayerList::isDedicatedPlayer(const MWWorld::Ptr &ptr) { - if (ptr.mRef == NULL) + if (ptr.mRef == nullptr) return false; return (getPlayer(ptr) != 0); diff --git a/components/openmw-mp/Log.cpp b/components/openmw-mp/Log.cpp index e87c4a036..0ed414337 100644 --- a/components/openmw-mp/Log.cpp +++ b/components/openmw-mp/Log.cpp @@ -14,7 +14,7 @@ using namespace std; -Log *Log::sLog = NULL; +Log *Log::sLog = nullptr; Log::Log(int logLevel) : logLevel(logLevel) { @@ -23,17 +23,17 @@ Log::Log(int logLevel) : logLevel(logLevel) void Log::Create(int logLevel) { - if (sLog != NULL) + if (sLog != nullptr) return; sLog = new Log(logLevel); } void Log::Delete() { - if (sLog == NULL) + if (sLog == nullptr) return; delete sLog; - sLog = NULL; + sLog = nullptr; } const Log &Log::Get() @@ -98,7 +98,7 @@ void Log::print(int level, bool hasPrefix, const char *file, int line, const cha sstr << '\n'; va_list args; va_start(args, message); - vector buf((unsigned long) (vsnprintf(NULL, 0, sstr.str().c_str(), args) + 1)); + vector buf((unsigned long) (vsnprintf(nullptr, 0, sstr.str().c_str(), args) + 1)); va_end(args); va_start(args, message); vsnprintf(buf.data(), buf.size(), sstr.str().c_str(), args);