From 720ef5f6c5b943bde7ecd28f11a1ca916414d426 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 29 Nov 2017 13:00:22 +0200 Subject: [PATCH] [General] Use consistent code style --- apps/openmw-mp/Actors.cpp | 2 +- apps/openmw-mp/GUI.cpp | 10 ++--- apps/openmw-mp/Networking.cpp | 2 +- apps/openmw-mp/Object.cpp | 44 +++++++++---------- apps/openmw-mp/Script/EventController.hpp | 8 ++-- apps/openmw-mp/Script/LuaState.cpp | 6 +-- apps/openmw-mp/Window.cpp | 16 +++---- components/openmw-mp/Base/BaseNetCreature.hpp | 4 +- .../Controllers/ActorPacketController.cpp | 4 +- .../Controllers/PlayerPacketController.cpp | 4 +- .../Controllers/WorldPacketController.cpp | 4 +- components/openmw-mp/Log.hpp | 2 +- .../Packets/Player/PacketGUIWindow.cpp | 4 +- .../Player/PacketPlayerActiveSkills.cpp | 4 +- .../Packets/Player/PacketPlayerAttribute.cpp | 2 +- .../Packets/Player/PacketPlayerBook.cpp | 2 +- .../Packets/Player/PacketPlayerCellState.cpp | 2 +- .../Packets/Player/PacketPlayerFaction.cpp | 2 +- .../Packets/Player/PacketPlayerInventory.cpp | 2 +- .../Packets/Player/PacketPlayerJournal.cpp | 2 +- .../Packets/Player/PacketPlayerKillCount.cpp | 2 +- .../Packets/Player/PacketPlayerMap.cpp | 2 +- .../Packets/Player/PacketPlayerSkill.cpp | 2 +- .../Packets/Player/PacketPlayerSpellbook.cpp | 4 +- .../Packets/World/PacketContainer.cpp | 4 +- .../openmw-mp/Packets/World/WorldPacket.cpp | 2 +- 26 files changed, 71 insertions(+), 71 deletions(-) diff --git a/apps/openmw-mp/Actors.cpp b/apps/openmw-mp/Actors.cpp index c97db425e..0c42a4319 100644 --- a/apps/openmw-mp/Actors.cpp +++ b/apps/openmw-mp/Actors.cpp @@ -241,7 +241,7 @@ void ActorController::sendList(std::shared_ptr player, std::vectorguid; actorList.action = mwmp::BaseActorList::SET; - for(auto &actor : actors) + for (auto &actor : actors) { actorList.baseActors.push_back(actor->actor); } diff --git a/apps/openmw-mp/GUI.cpp b/apps/openmw-mp/GUI.cpp index f7ef25fc4..579dae600 100644 --- a/apps/openmw-mp/GUI.cpp +++ b/apps/openmw-mp/GUI.cpp @@ -106,16 +106,16 @@ std::shared_ptr GUI::createWindow(short x, short y, sol::function fn, so { int id = 0; - for(auto &window : windows) + for (auto &window : windows) { - if(window.second == nullptr) + if (window.second == nullptr) { id = window.first; break; } } - if(id == 0) + if (id == 0) id = lastWindowId++; auto window = std::make_shared(player, id); @@ -129,7 +129,7 @@ std::shared_ptr GUI::createWindow(short x, short y, sol::function fn, so void GUI::deleteWindow(std::shared_ptr window) { auto it = windows.find(window->getID()); - if(it != windows.end()) + if (it != windows.end()) { it->second = nullptr; } @@ -138,7 +138,7 @@ void GUI::deleteWindow(std::shared_ptr window) void GUI::onGUIWindowAction() { auto it = windows.find(player->guiWindow.id); - if(it != windows.end() && it->second != nullptr) + if (it != windows.end() && it->second != nullptr) { it->second->call(player->guiWindow); } diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 6abbd9951..1d37081f0 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -114,7 +114,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) if (!player->isHandshaked()) { LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Have not completed handshake with player %d", player->getId()); - if(player->handshakeAttempts() > 5) + if (player->handshakeAttempts() > 5) kickPlayer(player->guid); return; } diff --git a/apps/openmw-mp/Object.cpp b/apps/openmw-mp/Object.cpp index 2df61e2d9..6192cf315 100644 --- a/apps/openmw-mp/Object.cpp +++ b/apps/openmw-mp/Object.cpp @@ -280,7 +280,7 @@ shared_ptr>> ObjectController::copyObjects(mwmp::BaseE { auto objects = make_shared>>(); - for(auto &obj : event.worldObjects) + for (auto &obj : event.worldObjects) { auto object = new Object; object->copied = true; @@ -294,7 +294,7 @@ shared_ptr>> ObjectController::copyContainers(mwmp: { auto containers = make_shared>>(); - for(auto &obj : event.worldObjects) + for (auto &obj : event.worldObjects) { auto container = new Container; container->copied = true; @@ -321,7 +321,7 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrguid; @@ -329,48 +329,48 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrcopied && object->changedBase) || object->copied; - if(object->changedDoorState && validNewObjOrCopy) + if (object->changedDoorState && validNewObjOrCopy) { changed[Type::DOOR_STATE] = true; events[Type::DOOR_STATE].worldObjects.push_back(object->object); } - if(object->changedObjectState && validNewObjOrCopy) + if (object->changedObjectState && validNewObjOrCopy) { changed[Type::OBJECT_STATE] = true; events[Type::OBJECT_STATE].worldObjects.push_back(object->object); } - if(object->changedObjectScale && validNewObjOrCopy) + if (object->changedObjectScale && validNewObjOrCopy) { changed[Type::OBJECT_SCALE] = true; events[Type::OBJECT_SCALE].worldObjects.push_back(object->object); } - if(object->changedObjectTrap && validNewObjOrCopy) + if (object->changedObjectTrap && validNewObjOrCopy) { changed[Type::OBJECT_TRAP] = true; events[Type::OBJECT_TRAP].worldObjects.push_back(object->object); } - if(object->changedObjectLock && validNewObjOrCopy) + if (object->changedObjectLock && validNewObjOrCopy) { changed[Type::OBJECT_LOCK] = true; events[Type::OBJECT_LOCK].worldObjects.push_back(object->object); } - if(object->changedObjectDelete && validNewObjOrCopy) + if (object->changedObjectDelete && validNewObjOrCopy) { changed[Type::OBJECT_DELETE] = true; events[Type::OBJECT_DELETE].worldObjects.push_back(object->object); } - if(object->changedObjectSpawn && validNewObjOrCopy) + if (object->changedObjectSpawn && validNewObjOrCopy) { changed[Type::OBJECT_SPAWN] = true; events[Type::OBJECT_SPAWN].worldObjects.push_back(object->object); } - if(object->changedObjectPlace && validNewObjOrCopy) + if (object->changedObjectPlace && validNewObjOrCopy) { changed[Type::OBJECT_PLACE] = true; events[Type::OBJECT_PLACE].worldObjects.push_back(object->object); @@ -379,56 +379,56 @@ void ObjectController::sendObjects(shared_ptr player, shared_ptrGetPacket(ID_DOOR_STATE); auto &event = events[Type::DOOR_STATE]; packet->setEvent(&event); packet->Send(event.guid); } - if(changed[Type::OBJECT_STATE]) + if (changed[Type::OBJECT_STATE]) { auto packet = worldCtrl->GetPacket(ID_OBJECT_STATE); auto &event = events[Type::OBJECT_STATE]; packet->setEvent(&event); packet->Send(event.guid); } - if(changed[Type::OBJECT_SCALE]) + if (changed[Type::OBJECT_SCALE]) { auto packet = worldCtrl->GetPacket(ID_OBJECT_SCALE); auto &event = events[Type::OBJECT_SCALE]; packet->setEvent(&event); packet->Send(event.guid); } - if(changed[Type::OBJECT_TRAP]) + if (changed[Type::OBJECT_TRAP]) { auto packet = worldCtrl->GetPacket(ID_OBJECT_TRAP); auto &event = events[Type::OBJECT_TRAP]; packet->setEvent(&event); packet->Send(event.guid); } - if(changed[Type::OBJECT_LOCK]) + if (changed[Type::OBJECT_LOCK]) { auto packet = worldCtrl->GetPacket(ID_OBJECT_LOCK); auto &event = events[Type::OBJECT_LOCK]; packet->setEvent(&event); packet->Send(event.guid); } - if(changed[Type::OBJECT_DELETE]) + if (changed[Type::OBJECT_DELETE]) { auto packet = worldCtrl->GetPacket(ID_OBJECT_DELETE); auto &event = events[Type::OBJECT_DELETE]; packet->setEvent(&event); packet->Send(event.guid); } - if(changed[Type::OBJECT_SCALE]) + if (changed[Type::OBJECT_SCALE]) { auto packet = worldCtrl->GetPacket(ID_OBJECT_SPAWN); auto &event = events[Type::OBJECT_SCALE]; packet->setEvent(&event); packet->Send(event.guid); } - if(changed[Type::OBJECT_PLACE]) + if (changed[Type::OBJECT_PLACE]) { auto packet = worldCtrl->GetPacket(ID_OBJECT_PLACE); auto &event = events[Type::OBJECT_PLACE]; @@ -445,10 +445,10 @@ void ObjectController::sendContainers(shared_ptr player, shared_ptrguid; - for(auto &object : *objects) + for (auto &object : *objects) { bool validNewObjOrCopy = (!object->copied && object->changedBase) || object->copied; - if(object->changed && validNewObjOrCopy) + if (object->changed && validNewObjOrCopy) event.worldObjects.push_back(object->object); } diff --git a/apps/openmw-mp/Script/EventController.hpp b/apps/openmw-mp/Script/EventController.hpp index 4eb647965..ba72306da 100644 --- a/apps/openmw-mp/Script/EventController.hpp +++ b/apps/openmw-mp/Script/EventController.hpp @@ -90,9 +90,9 @@ public: { lastCalled = functions.end(); _stop = false; - for(CIterator iter = functions.begin(); iter != functions.end(); ++iter) + for (CIterator iter = functions.begin(); iter != functions.end(); ++iter) { - if(!_stop) + if (!_stop) iter->second.call(std::forward(args)...); else { @@ -110,7 +110,7 @@ public: lastCalled = functions.end(); _stop = false; - for(CIterator iter = functions.begin(); iter != functions.end(); ++iter) + for (CIterator iter = functions.begin(); iter != functions.end(); ++iter) { if (!_stop) ret = iter->second.call(std::forward(args)...); @@ -152,4 +152,4 @@ private: Container events; Event lastEvent = CoreEvent::LAST; LuaState *luaCtrl; -}; \ No newline at end of file +}; diff --git a/apps/openmw-mp/Script/LuaState.cpp b/apps/openmw-mp/Script/LuaState.cpp index 7d332d76d..abcb00c2c 100644 --- a/apps/openmw-mp/Script/LuaState.cpp +++ b/apps/openmw-mp/Script/LuaState.cpp @@ -405,7 +405,7 @@ void checkDependencies(const vector &mods, const ServerPluginI stringstream sstr; sstr << depNameRequest << ": version \"" << depVersionFound << "\" is not applicable for \"" << spi.name << "\" expected \"" << depVersionRequest + "\""; - if(fatal) + if (fatal) throw runtime_error(sstr.str()); else LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", sstr.str().c_str()); @@ -415,7 +415,7 @@ void checkDependencies(const vector &mods, const ServerPluginI { stringstream sstr; sstr << depNameRequest + " \"" << depVersionRequest << "\" not found."; - if(fatal) + if (fatal) throw runtime_error(sstr.str()); else LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", sstr.str().c_str()); @@ -512,7 +512,7 @@ void LuaState::loadMods(const std::string &modDir, std::vector *lis modInfo.author = pt.get("author"); modInfo.version = pt.get("version"); - for(const auto &v : pt.get_child("dependencies")) + for (const auto &v : pt.get_child("dependencies")) modInfo.dependencies.emplace_back(v.first, v.second.get_value()); auto name = pt.get("name"); diff --git a/apps/openmw-mp/Window.cpp b/apps/openmw-mp/Window.cpp index 2e5324167..2fd419b2e 100644 --- a/apps/openmw-mp/Window.cpp +++ b/apps/openmw-mp/Window.cpp @@ -98,12 +98,12 @@ void Window::call(const BasePlayer::GUIWindow &window) void Window::setCallback(sol::function callback) { /*int id = 0; - for(auto &&cb : callbacks) + for (auto &&cb : callbacks) { - if(cb.second.get() == nullptr) + if (cb.second.get() == nullptr) id = cb.first; } - if(id == 0) + if (id == 0) id = lastId++; callbacks[id] = make_unique(callback);*/ this->callback = callback; @@ -122,7 +122,7 @@ void Window::addButton(short x, short y, const std::string &label, sol::optional widget.posY = y; widget.name = label; widget.type = BasePlayer::GUIWindow::WidgetType::Button; - if(active) + if (active) widget.disabled = !active.value(); else widget.disabled = false; @@ -138,7 +138,7 @@ void Window::addEditBox(short x, short y, short w, short h, const std::string &i widget.height = h; widget.name = id; widget.type = BasePlayer::GUIWindow::WidgetType::Editbox; - if(active) + if (active) widget.disabled = !active.value(); else widget.disabled = false; @@ -166,7 +166,7 @@ void Window::addPassiveListBox(short x, short y, short w, short h, const std::st widget.name = id; widget.type = BasePlayer::GUIWindow::WidgetType::ListBoxPassive; - if(active) + if (active) widget.disabled = !active.value(); else widget.disabled = false; @@ -187,7 +187,7 @@ void Window::addActiveListBox(short x, short y, short w, short h, const std::str widget.height = h; widget.name = id; widget.type = BasePlayer::GUIWindow::WidgetType::ListBoxActive; - if(active) + if (active) widget.disabled = !active.value(); else widget.disabled = false; @@ -207,7 +207,7 @@ void Window::addSlider(short x, short y, short w, short h, const std::string &id widget.height = h; widget.name = id; widget.type = BasePlayer::GUIWindow::WidgetType::Slider; - if(active) + if (active) widget.disabled = !active.value(); else widget.disabled = false; diff --git a/components/openmw-mp/Base/BaseNetCreature.hpp b/components/openmw-mp/Base/BaseNetCreature.hpp index f4d1b1b58..07263999c 100644 --- a/components/openmw-mp/Base/BaseNetCreature.hpp +++ b/components/openmw-mp/Base/BaseNetCreature.hpp @@ -36,10 +36,10 @@ namespace mwmp inline void copyCreatureStats(ESM::CreatureStats &stats) { - for(int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) creatureStats.mDynamic[i] = stats.mDynamic[i]; - for(int i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) creatureStats.mAttributes[i] = stats.mAttributes[i]; creatureStats.mLevel = stats.mLevel; diff --git a/components/openmw-mp/Controllers/ActorPacketController.cpp b/components/openmw-mp/Controllers/ActorPacketController.cpp index 060bc02b6..b585805f9 100644 --- a/components/openmw-mp/Controllers/ActorPacketController.cpp +++ b/components/openmw-mp/Controllers/ActorPacketController.cpp @@ -48,13 +48,13 @@ mwmp::ActorPacket *mwmp::ActorPacketController::GetPacket(RakNet::MessageID id) void mwmp::ActorPacketController::SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream) { - for(const auto &packet : packets) + for (const auto &packet : packets) packet.second->SetStreams(inStream, outStream); } bool mwmp::ActorPacketController::ContainsPacket(RakNet::MessageID id) { - for(const auto &packet : packets) + for (const auto &packet : packets) { if (packet.first == id) return true; diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index 362dd8c83..ca20ead80 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -102,13 +102,13 @@ mwmp::PlayerPacket *mwmp::PlayerPacketController::GetPacket(RakNet::MessageID id void mwmp::PlayerPacketController::SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream) { - for(const auto &packet : packets) + for (const auto &packet : packets) packet.second->SetStreams(inStream, outStream); } bool mwmp::PlayerPacketController::ContainsPacket(RakNet::MessageID id) { - for(const auto &packet : packets) + for (const auto &packet : packets) { if (packet.first == id) return true; diff --git a/components/openmw-mp/Controllers/WorldPacketController.cpp b/components/openmw-mp/Controllers/WorldPacketController.cpp index dad5242a0..bf190b6fe 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.cpp +++ b/components/openmw-mp/Controllers/WorldPacketController.cpp @@ -63,13 +63,13 @@ mwmp::WorldPacket *mwmp::WorldPacketController::GetPacket(RakNet::MessageID id) void mwmp::WorldPacketController::SetStream(RakNet::BitStream *inStream, RakNet::BitStream *outStream) { - for(const auto &packet : packets) + for (const auto &packet : packets) packet.second->SetStreams(inStream, outStream); } bool mwmp::WorldPacketController::ContainsPacket(RakNet::MessageID id) { - for(const auto &packet : packets) + for (const auto &packet : packets) { if (packet.first == id) return true; diff --git a/components/openmw-mp/Log.hpp b/components/openmw-mp/Log.hpp index 104076347..2d4731f6f 100644 --- a/components/openmw-mp/Log.hpp +++ b/components/openmw-mp/Log.hpp @@ -126,7 +126,7 @@ public: } std::string str = Message(message, std::forward(args)...); - if(str.back() != '\n') + if (str.back() != '\n') std::cout << str << std::endl; else std::cout << str << std::flush; diff --git a/components/openmw-mp/Packets/Player/PacketGUIWindow.cpp b/components/openmw-mp/Packets/Player/PacketGUIWindow.cpp index 2cc284a6a..1d79de58d 100644 --- a/components/openmw-mp/Packets/Player/PacketGUIWindow.cpp +++ b/components/openmw-mp/Packets/Player/PacketGUIWindow.cpp @@ -27,7 +27,7 @@ void PacketGUIWindow::Packet(RakNet::BitStream *bs, bool send) size = static_cast(player->guiWindow.widgets.size()); RW(size, send); - if(!send) + if (!send) player->guiWindow.widgets.resize(size); @@ -42,7 +42,7 @@ void PacketGUIWindow::Packet(RakNet::BitStream *bs, bool send) { RW(widget.disabled, send); - if(widget.type != BasePlayer::GUIWindow::WidgetType::Button) + if (widget.type != BasePlayer::GUIWindow::WidgetType::Button) { RW(widget.width, send); RW(widget.height, send); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerActiveSkills.cpp b/components/openmw-mp/Packets/Player/PacketPlayerActiveSkills.cpp index 39f9b6b36..477d9f14f 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerActiveSkills.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerActiveSkills.cpp @@ -28,12 +28,12 @@ void PacketPlayerActiveSkills::Packet(RakNet::BitStream *bs, bool send) RW(spell.second.mTimeStamp, send); uint32_t effectsCount; - if(send) + if (send) effectsCount = static_cast(spell.second.mEffects.size()); RW(effectsCount, send); - if(!send) + if (!send) spell.second.mEffects.resize(effectsCount); for (auto &&effect : spell.second.mEffects) diff --git a/components/openmw-mp/Packets/Player/PacketPlayerAttribute.cpp b/components/openmw-mp/Packets/Player/PacketPlayerAttribute.cpp index 28708bbc0..feb0884dc 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerAttribute.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerAttribute.cpp @@ -19,7 +19,7 @@ void PacketPlayerAttribute::Packet(RakNet::BitStream *bs, bool send) RW(count, send); - if(!send) + if (!send) { player->attributeChanges.attributeIndexes.clear(); player->attributeChanges.attributeIndexes.resize(count); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerBook.cpp b/components/openmw-mp/Packets/Player/PacketPlayerBook.cpp index faed80603..574262993 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerBook.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerBook.cpp @@ -20,7 +20,7 @@ void PacketPlayerBook::Packet(RakNet::BitStream *bs, bool send) RW(count, send); - if(!send) + if (!send) { player->bookChanges.books.clear(); player->bookChanges.books.resize(count); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerCellState.cpp b/components/openmw-mp/Packets/Player/PacketPlayerCellState.cpp index 30540f7c7..618bcac7f 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerCellState.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerCellState.cpp @@ -21,7 +21,7 @@ void mwmp::PacketPlayerCellState::Packet(RakNet::BitStream *bs, bool send) RW(count, send); - if(!send) + if (!send) { player->cellStateChanges.cellStates.clear(); player->cellStateChanges.cellStates.resize(count); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp b/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp index b0c6add95..6fb68cdf5 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp @@ -22,7 +22,7 @@ void PacketPlayerFaction::Packet(RakNet::BitStream *bs, bool send) RW(count, send); - if(!send) + if (!send) { player->factionChanges.factions.clear(); player->factionChanges.factions.resize(count); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerInventory.cpp b/components/openmw-mp/Packets/Player/PacketPlayerInventory.cpp index 11131d51e..ecbb9d249 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerInventory.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerInventory.cpp @@ -26,7 +26,7 @@ void PacketPlayerInventory::Packet(RakNet::BitStream *bs, bool send) RW(count, send); - if(!send) + if (!send) { player->inventoryChanges.items.clear(); player->inventoryChanges.items.resize(count); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp b/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp index 4e50715b1..f366c8add 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp @@ -20,7 +20,7 @@ void PacketPlayerJournal::Packet(RakNet::BitStream *bs, bool send) RW(count, send); - if(!send) + if (!send) { player->journalChanges.journalItems.clear(); player->journalChanges.journalItems.resize(count); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerKillCount.cpp b/components/openmw-mp/Packets/Player/PacketPlayerKillCount.cpp index 1893304b6..88fff7e0b 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerKillCount.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerKillCount.cpp @@ -17,7 +17,7 @@ void mwmp::PacketPlayerKillCount::Packet(RakNet::BitStream *bs, bool send) RW(count, send); - if(!send) + if (!send) { player->killChanges.kills.clear(); player->killChanges.kills.resize(count); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerMap.cpp b/components/openmw-mp/Packets/Player/PacketPlayerMap.cpp index 804873c04..d2850e366 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerMap.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerMap.cpp @@ -20,7 +20,7 @@ void PacketPlayerMap::Packet(RakNet::BitStream *bs, bool send) RW(count, send); - if(!send) + if (!send) { player->mapChanges.cellsExplored.clear(); player->mapChanges.cellsExplored.resize(count); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerSkill.cpp b/components/openmw-mp/Packets/Player/PacketPlayerSkill.cpp index acb692fe7..fb8553a7f 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerSkill.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerSkill.cpp @@ -25,7 +25,7 @@ void PacketPlayerSkill::Packet(RakNet::BitStream *bs, bool send) RW(count, send); - if(!send) + if (!send) { player->skillChanges.skillIndexes.clear(); player->skillChanges.skillIndexes.resize(count); diff --git a/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.cpp b/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.cpp index 8f1d4589c..f04f8990d 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerSpellbook.cpp @@ -22,7 +22,7 @@ void PacketPlayerSpellbook::Packet(RakNet::BitStream *bs, bool send) RW(changesCount, send); - if(!send) + if (!send) { player->spellbookChanges.spells.clear(); player->spellbookChanges.spells.resize(changesCount); @@ -33,7 +33,7 @@ void PacketPlayerSpellbook::Packet(RakNet::BitStream *bs, bool send) RW(spell.mId, send, true); - if(spell.mId.find("$dynamic") != string::npos) + if (spell.mId.find("$dynamic") != string::npos) { RW(spell.mName, send, true); diff --git a/components/openmw-mp/Packets/World/PacketContainer.cpp b/components/openmw-mp/Packets/World/PacketContainer.cpp index 6aa763cbd..6a17d9b61 100644 --- a/components/openmw-mp/Packets/World/PacketContainer.cpp +++ b/components/openmw-mp/Packets/World/PacketContainer.cpp @@ -28,7 +28,7 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send) RW(worldObject.containerItemCount, send); - if(!send) + if (!send) { worldObject.containerItems.clear(); worldObject.containerItems.resize(worldObject.containerItemCount); @@ -41,7 +41,7 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send) return; } - for(auto &&containerItem: worldObject.containerItems) + for (auto &&containerItem: worldObject.containerItems) { RW(containerItem.refId, send); RW(containerItem.count, send); diff --git a/components/openmw-mp/Packets/World/WorldPacket.cpp b/components/openmw-mp/Packets/World/WorldPacket.cpp index 9aae8c31d..b85ffdf1c 100644 --- a/components/openmw-mp/Packets/World/WorldPacket.cpp +++ b/components/openmw-mp/Packets/World/WorldPacket.cpp @@ -54,7 +54,7 @@ bool WorldPacket::PacketHeader(RakNet::BitStream *bs, bool send) return false; } - if(!send) + if (!send) { event->worldObjects.resize(event->worldObjectCount); }