From a20e7890a278770a24b63e9d641b25911cb02cd6 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 30 Aug 2016 10:52:30 +0300 Subject: [PATCH] Fix formatting --- apps/openmw-mp/Script/Functions/CharClass.cpp | 12 ++++++------ apps/openmw/mwmp/LocalPlayer.cpp | 4 ++-- apps/openmw/mwmp/Networking.cpp | 10 +++++----- components/openmw-mp/Packets/PacketClass.cpp | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/CharClass.cpp b/apps/openmw-mp/Script/Functions/CharClass.cpp index b98ca623c..d66005d84 100644 --- a/apps/openmw-mp/Script/Functions/CharClass.cpp +++ b/apps/openmw-mp/Script/Functions/CharClass.cpp @@ -42,7 +42,7 @@ void CharClassFunctions::SetClassMajorAttribute(unsigned short pid, unsigned cha Player *player; GET_PLAYER(pid, player,); - if(slot > 1) + if (slot > 1) throw invalid_argument("Incorrect attribute slot id"); player->klass.mData.mAttribute[slot] = attrId; @@ -58,7 +58,7 @@ void CharClassFunctions::SetClassMajorSkill(unsigned short pid, unsigned char sl { Player *player; GET_PLAYER(pid, player,); - if(slot > 4) + if (slot > 4) throw invalid_argument("Incorrect skill slot id"); player->klass.mData.mSkills[slot][1] = skillId; } @@ -66,7 +66,7 @@ void CharClassFunctions::SetClassMinorSkill(unsigned short pid, unsigned char sl { Player *player; GET_PLAYER(pid, player,); - if(slot > 4) + if (slot > 4) throw invalid_argument("Incorrect skill slot id"); player->klass.mData.mSkills[slot][0] = skillId; } @@ -103,7 +103,7 @@ int CharClassFunctions::GetClassMajorAttribute(unsigned short pid, unsigned char { Player *player; GET_PLAYER(pid, player,0); - if(slot > 1) + if (slot > 1) throw invalid_argument("Incorrect attribute slot id"); return player->klass.mData.mAttribute[slot]; } @@ -119,7 +119,7 @@ int CharClassFunctions::GetClassMajorSkill(unsigned short pid, unsigned char slo { Player *player; GET_PLAYER(pid, player,0); - if(slot > 4) + if (slot > 4) throw invalid_argument("Incorrect skill slot id"); return player->klass.mData.mSkills[slot][1]; } @@ -128,7 +128,7 @@ int CharClassFunctions::GetClassMinorSkill(unsigned short pid, unsigned char slo { Player *player; GET_PLAYER(pid, player,0); - if(slot > 4) + if (slot > 4) throw invalid_argument("Incorrect skill slot id"); return player->klass.mData.mSkills[slot][0]; } diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 5714ec1b9..a6233acd0 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -586,7 +586,7 @@ void LocalPlayer::updateChar() void LocalPlayer::SetClass() { - if(klass.mId.empty()) // custom class + if (klass.mId.empty()) // custom class { klass.mData.mIsPlayable = 0x1; MWBase::Environment::get().getMechanicsManager()->setPlayerClass(klass); @@ -607,7 +607,7 @@ void LocalPlayer::SendClass() const ESM::NPC *cpl = world->getPlayerPtr().get()->mBase; const ESM::Class *cls = world->getStore().get().find(cpl->mClass); - if(cpl->mClass.find("$dynamic") != string::npos) // custom class + if (cpl->mClass.find("$dynamic") != string::npos) // custom class { klass.mId = ""; klass.mName = cls->mName; diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index c5ced187f..24b056a68 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -577,7 +577,7 @@ void Networking::ReceiveMessage(RakNet::Packet *packet) { if (id == myid) { - if(packet->length == myPacket->headerSize()) + if (packet->length == myPacket->headerSize()) getLocalPlayer()->SendClass(); else { @@ -589,15 +589,15 @@ void Networking::ReceiveMessage(RakNet::Packet *packet) } case ID_GAME_TIME: { - if(id == myid) + if (id == myid) { myPacket->Packet(&bsIn, getLocalPlayer(), false); MWBase::World *world = MWBase::Environment::get().getWorld(); - if(getLocalPlayer()->hour != -1) + if (getLocalPlayer()->hour != -1) world->setHour(getLocalPlayer()->hour); - else if(getLocalPlayer()->day != -1) + else if (getLocalPlayer()->day != -1) world->setDay(getLocalPlayer()->day); - else if(getLocalPlayer()->month != -1) + else if (getLocalPlayer()->month != -1) world->setMonth(getLocalPlayer()->month); } } diff --git a/components/openmw-mp/Packets/PacketClass.cpp b/components/openmw-mp/Packets/PacketClass.cpp index 49f123c53..e7a5d454e 100644 --- a/components/openmw-mp/Packets/PacketClass.cpp +++ b/components/openmw-mp/Packets/PacketClass.cpp @@ -15,7 +15,7 @@ void mwmp::PacketClass::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, BasePacket::Packet(bs, player, send); RW(player->klass.mId, send); - if(player->klass.mId.empty()) // custom class + if (player->klass.mId.empty()) // custom class { RW(player->klass.mName, send); RW(player->klass.mDescription, send);