summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-27 20:53:45 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-27 20:53:45 +0300
commitde7d095b98846529e2394e9868a6dd2e4344acc8 (patch)
tree922f05aaa5746fa90e4c43c0a9160b5f6b51fe81 /src
parent32947c0634ec582f6d641402433d2037f5087a36 (diff)
downloadManaVerse-de7d095b98846529e2394e9868a6dd2e4344acc8.tar.gz
ManaVerse-de7d095b98846529e2394e9868a6dd2e4344acc8.tar.bz2
ManaVerse-de7d095b98846529e2394e9868a6dd2e4344acc8.tar.xz
ManaVerse-de7d095b98846529e2394e9868a6dd2e4344acc8.zip
fix code style.
Diffstat (limited to 'src')
-rw-r--r--src/actions/pets.cpp2
-rw-r--r--src/actions/windows.cpp1
-rw-r--r--src/actormanager.cpp2
-rw-r--r--src/being/crazymoves.cpp24
-rw-r--r--src/being/mercenaryinfo.h2
-rw-r--r--src/being/petinfo.h2
-rw-r--r--src/gui/viewport.cpp7
-rw-r--r--src/gui/windows/buyingstoreselldialog.h4
-rw-r--r--src/listeners/inputactionreplaylistener.cpp3
-rw-r--r--src/net/eathena/auctionhandler.h3
-rw-r--r--src/net/eathena/bankhandler.h3
-rw-r--r--src/net/eathena/buyingstorehandler.cpp2
-rw-r--r--src/net/eathena/buyingstorehandler.h3
-rw-r--r--src/net/eathena/cashshophandler.h3
-rw-r--r--src/net/eathena/chathandler.cpp2
-rw-r--r--src/net/eathena/familyhandler.h3
-rw-r--r--src/net/eathena/friendshandler.h3
-rw-r--r--src/net/eathena/mercenaryhandler.cpp2
-rw-r--r--src/net/eathena/pethandler.cpp4
-rw-r--r--src/net/messageout.cpp2
20 files changed, 55 insertions, 22 deletions
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp
index ef544d88a..7e046758c 100644
--- a/src/actions/pets.cpp
+++ b/src/actions/pets.cpp
@@ -213,7 +213,7 @@ impHandler0(petAiStop)
return true;
}
-impHandler0(petMove)
+impHandler(petMove)
{
int x = 0;
int y = 0;
diff --git a/src/actions/windows.cpp b/src/actions/windows.cpp
index 1b879496a..eccc21d1d 100644
--- a/src/actions/windows.cpp
+++ b/src/actions/windows.cpp
@@ -298,7 +298,6 @@ impHandler0(cartWindowShow)
#else
return false;
#endif
-
}
impHandler0(updaterWindowShow)
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index fb999ac68..032631d24 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -1297,7 +1297,7 @@ Being* ActorManager::findMostDamagedPlayer() const
if ((!being) || (!being->isAlive()) || // don't heal dead
(player_relations.getRelation(being->getName()) ==
- PlayerRelation::ENEMY2) || // don't heal enemy
+ PlayerRelation::ENEMY2) || // don't heal enemy
(localPlayer == being)) // don't heal self
{
continue;
diff --git a/src/being/crazymoves.cpp b/src/being/crazymoves.cpp
index e5baaf76c..bc91feb57 100644
--- a/src/being/crazymoves.cpp
+++ b/src/being/crazymoves.cpp
@@ -138,28 +138,32 @@ void CrazyMoves::crazyMove2()
switch (localPlayer->getDirection())
{
case BeingDirection::UP:
- localPlayer->setWalkingDir(BeingDirection::UP | BeingDirection::LEFT);
+ localPlayer->setWalkingDir(BeingDirection::UP |
+ BeingDirection::LEFT);
localPlayer->setDirection(BeingDirection::RIGHT);
playerHandler->setDirection(
BeingDirection::DOWN | BeingDirection::RIGHT);
break;
case BeingDirection::RIGHT:
- localPlayer->setWalkingDir(BeingDirection::UP | BeingDirection::RIGHT);
+ localPlayer->setWalkingDir(BeingDirection::UP |
+ BeingDirection::RIGHT);
localPlayer->setDirection(BeingDirection::DOWN);
playerHandler->setDirection(
BeingDirection::DOWN | BeingDirection::LEFT);
break;
case BeingDirection::DOWN:
- localPlayer->setWalkingDir(BeingDirection::DOWN | BeingDirection::RIGHT);
+ localPlayer->setWalkingDir(BeingDirection::DOWN |
+ BeingDirection::RIGHT);
localPlayer->setDirection(BeingDirection::LEFT);
playerHandler->setDirection(
BeingDirection::UP | BeingDirection::LEFT);
break;
case BeingDirection::LEFT:
- localPlayer->setWalkingDir(BeingDirection::DOWN | BeingDirection::LEFT);
+ localPlayer->setWalkingDir(BeingDirection::DOWN |
+ BeingDirection::LEFT);
localPlayer->setDirection(BeingDirection::UP);
playerHandler->setDirection(
BeingDirection::UP | BeingDirection::RIGHT);
@@ -381,7 +385,8 @@ void CrazyMoves::crazyMove8()
{
mult ++;
}
- localPlayer->move(movesX[idx][0] * (mult - 1), movesY[idx][0] * (mult - 1));
+ localPlayer->move(movesX[idx][0] * (mult - 1),
+ movesY[idx][0] * (mult - 1));
}
else if (map->getWalk(x + movesX[idx][1],
y + movesY[idx][1], blockWalkMask))
@@ -392,7 +397,8 @@ void CrazyMoves::crazyMove8()
{
mult ++;
}
- localPlayer->move(movesX[idx][1] * (mult - 1), movesY[idx][1] * (mult - 1));
+ localPlayer->move(movesX[idx][1] * (mult - 1),
+ movesY[idx][1] * (mult - 1));
}
else if (map->getWalk(x + movesX[idx][2],
y + movesY[idx][2], blockWalkMask))
@@ -403,7 +409,8 @@ void CrazyMoves::crazyMove8()
{
mult ++;
}
- localPlayer->move(movesX[idx][2] * (mult - 1), movesY[idx][2] * (mult - 1));
+ localPlayer->move(movesX[idx][2] * (mult - 1),
+ movesY[idx][2] * (mult - 1));
}
else if (map->getWalk(x + movesX[idx][3],
y + movesY[idx][3], blockWalkMask))
@@ -414,7 +421,8 @@ void CrazyMoves::crazyMove8()
{
mult ++;
}
- localPlayer->move(movesX[idx][3] * (mult - 1), movesY[idx][3] * (mult - 1));
+ localPlayer->move(movesX[idx][3] * (mult - 1),
+ movesY[idx][3] * (mult - 1));
}
}
diff --git a/src/being/mercenaryinfo.h b/src/being/mercenaryinfo.h
index 948f93760..8e63afdc2 100644
--- a/src/being/mercenaryinfo.h
+++ b/src/being/mercenaryinfo.h
@@ -21,6 +21,8 @@
#ifndef BEING_MERCENARYINFO_H
#define BEING_MERCENARYINFO_H
+#include <string>
+
#include "localconsts.h"
struct MercenaryInfo final
diff --git a/src/being/petinfo.h b/src/being/petinfo.h
index caaf8022c..e67ae4139 100644
--- a/src/being/petinfo.h
+++ b/src/being/petinfo.h
@@ -21,6 +21,8 @@
#ifndef BEING_PETINFO_H
#define BEING_PETINFO_H
+#include <string>
+
#include "localconsts.h"
struct PetInfo final
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 4592d5e69..fa29590f4 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -413,7 +413,8 @@ bool Viewport::openContextMenu(const MouseEvent &event)
bool Viewport::leftMouseAction()
{
- const bool stopAttack = inputManager.isActionActive(InputAction::STOP_ATTACK);
+ const bool stopAttack = inputManager.isActionActive(
+ InputAction::STOP_ATTACK);
// Interact with some being
if (mHoverBeing)
{
@@ -441,7 +442,9 @@ bool Viewport::leftMouseAction()
return true;
}
}
- else if (!stopAttack && (type == ActorType::Monster || type == ActorType::Npc))
+ else if (!stopAttack &&
+ (type == ActorType::Monster ||
+ type == ActorType::Npc))
{
if ((localPlayer->withinAttackRange(mHoverBeing) ||
inputManager.isActionActive(static_cast<int>(
diff --git a/src/gui/windows/buyingstoreselldialog.h b/src/gui/windows/buyingstoreselldialog.h
index 39b45a127..9fb40cba0 100644
--- a/src/gui/windows/buyingstoreselldialog.h
+++ b/src/gui/windows/buyingstoreselldialog.h
@@ -42,8 +42,8 @@ class BuyingStoreSellDialog final : public SellDialog
*
* @see Window::Window
*/
- explicit BuyingStoreSellDialog(const int accountId,
- const int storeId);
+ BuyingStoreSellDialog(const int accountId,
+ const int storeId);
A_DELETE_COPY(BuyingStoreSellDialog)
diff --git a/src/listeners/inputactionreplaylistener.cpp b/src/listeners/inputactionreplaylistener.cpp
index 1a948f029..7c0f60c6a 100644
--- a/src/listeners/inputactionreplaylistener.cpp
+++ b/src/listeners/inputactionreplaylistener.cpp
@@ -30,7 +30,8 @@ InputActionReplayListener inputActionReplayListener;
InputActionReplayListener::InputActionReplayListener() :
ActionListener(),
- mDialog(nullptr)
+ mDialog(nullptr),
+ mAction()
{
}
diff --git a/src/net/eathena/auctionhandler.h b/src/net/eathena/auctionhandler.h
index c393a6798..a513f9c89 100644
--- a/src/net/eathena/auctionhandler.h
+++ b/src/net/eathena/auctionhandler.h
@@ -21,6 +21,8 @@
#ifndef NET_EATHENA_AUCTIONHANDLER_H
#define NET_EATHENA_AUCTIONHANDLER_H
+#ifdef EATHENA_SUPPORT
+
#include "net/auctionhandler.h"
#include "net/eathena/messagehandler.h"
@@ -75,4 +77,5 @@ class AuctionHandler final : public MessageHandler, public Net::AuctionHandler
} // namespace EAthena
+#endif // EATHENA_SUPPORT
#endif // NET_EATHENA_AUCTIONHANDLER_H
diff --git a/src/net/eathena/bankhandler.h b/src/net/eathena/bankhandler.h
index 64574dc88..d5d9f513d 100644
--- a/src/net/eathena/bankhandler.h
+++ b/src/net/eathena/bankhandler.h
@@ -21,6 +21,8 @@
#ifndef NET_EATHENA_BANKHANDLER_H
#define NET_EATHENA_BANKHANDLER_H
+#ifdef EATHENA_SUPPORT
+
#include "net/bankhandler.h"
#include "net/eathena/messagehandler.h"
@@ -53,4 +55,5 @@ class BankHandler final : public MessageHandler,
} // namespace EAthena
+#endif // EATHENA_SUPPORT
#endif // NET_EATHENA_BANKHANDLER_H
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index a3da66527..921c2f300 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -296,7 +296,7 @@ void BuyingStoreHandler::create(const std::string &name,
std::vector<ShopItem*> &items) const
{
createOutPacket(CMSG_BUYINGSTORE_CREATE);
- outMsg.writeInt16(89 + items.size() * 8, "len");
+ outMsg.writeInt16(static_cast<int16_t>(89 + items.size() * 8), "len");
outMsg.writeInt32(maxMoney, "limit money");
outMsg.writeInt8(flag, "flag");
outMsg.writeString(name, 80, "store name");
diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h
index 123ae135e..53cc6fcef 100644
--- a/src/net/eathena/buyingstorehandler.h
+++ b/src/net/eathena/buyingstorehandler.h
@@ -21,6 +21,8 @@
#ifndef NET_EATHENA_BUYINGSTOREHANDLER_H
#define NET_EATHENA_BUYINGSTOREHANDLER_H
+#ifdef EATHENA_SUPPORT
+
#include "net/buyingstorehandler.h"
#include "net/eathena/messagehandler.h"
@@ -75,4 +77,5 @@ class BuyingStoreHandler final : public MessageHandler,
} // namespace EAthena
+#endif // EATHENA_SUPPORT
#endif // NET_EATHENA_BUYINGSTOREHANDLER_H
diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h
index 24f8d7f1a..176af7dc3 100644
--- a/src/net/eathena/cashshophandler.h
+++ b/src/net/eathena/cashshophandler.h
@@ -21,6 +21,8 @@
#ifndef NET_EATHENA_CASHSHOPHANDLER_H
#define NET_EATHENA_CASHSHOPHANDLER_H
+#ifdef EATHENA_SUPPORT
+
#include "net/cashshophandler.h"
#include "net/eathena/messagehandler.h"
@@ -54,4 +56,5 @@ class CashShopHandler final : public MessageHandler,
} // namespace EAthena
+#endif // EATHENA_SUPPORT
#endif // NET_EATHENA_CASHSHOPHANDLER_H
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 0d401f0e3..aaad26fda 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -757,7 +757,7 @@ void ChatHandler::talkPet(const std::string &restrict text,
createOutPacket(CMSG_PET_TALK);
outMsg.writeInt16(static_cast<int16_t>(sz + 4 + 1), "len");
- outMsg.writeString(msg, sz, "message");
+ outMsg.writeString(msg, static_cast<int>(sz), "message");
outMsg.writeInt8(0, "zero byte");
}
diff --git a/src/net/eathena/familyhandler.h b/src/net/eathena/familyhandler.h
index df53482b1..f648c44cd 100644
--- a/src/net/eathena/familyhandler.h
+++ b/src/net/eathena/familyhandler.h
@@ -21,6 +21,8 @@
#ifndef NET_EATHENA_FAMILYHANDLER_H
#define NET_EATHENA_FAMILYHANDLER_H
+#ifdef EATHENA_SUPPORT
+
#include "net/familyhandler.h"
#include "net/eathena/messagehandler.h"
@@ -55,4 +57,5 @@ class FamilyHandler final : public MessageHandler,
} // namespace EAthena
+#endif // EATHENA_SUPPORT
#endif // NET_EATHENA_FAMILYHANDLER_H
diff --git a/src/net/eathena/friendshandler.h b/src/net/eathena/friendshandler.h
index 635a57fe0..f0b5ead71 100644
--- a/src/net/eathena/friendshandler.h
+++ b/src/net/eathena/friendshandler.h
@@ -21,6 +21,8 @@
#ifndef NET_EATHENA_FRIENDSHANDLER_H
#define NET_EATHENA_FRIENDSHANDLER_H
+#ifdef EATHENA_SUPPORT
+
#include "net/friendshandler.h"
#include "net/eathena/messagehandler.h"
@@ -56,4 +58,5 @@ class FriendsHandler final : public MessageHandler,
} // namespace EAthena
+#endif // EATHENA_SUPPORT
#endif // NET_EATHENA_FRIENDSHANDLER_H
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp
index 0c3985f07..e611ae259 100644
--- a/src/net/eathena/mercenaryhandler.cpp
+++ b/src/net/eathena/mercenaryhandler.cpp
@@ -230,7 +230,7 @@ void MercenaryHandler::talk(const std::string &restrict text) const
createOutPacket(CMSG_HOMMERC_TALK);
outMsg.writeInt16(static_cast<int16_t>(sz + 4 + 1), "len");
- outMsg.writeString(msg, sz, "message");
+ outMsg.writeString(msg, static_cast<int>(sz), "message");
outMsg.writeInt8(0, "zero byte");
}
diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp
index 963ef0cc3..1b03cbf83 100644
--- a/src/net/eathena/pethandler.cpp
+++ b/src/net/eathena/pethandler.cpp
@@ -116,8 +116,8 @@ void PetHandler::move(const int petId A_UNUSED,
return;
createOutPacket(CMSG_PET_MOVE_TO);
outMsg.writeInt32(0, "pet id");
- outMsg.writeInt16(x, "x");
- outMsg.writeInt16(y, "y");
+ outMsg.writeInt16(static_cast<int16_t>(x), "x");
+ outMsg.writeInt16(static_cast<int16_t>(y), "y");
}
void PetHandler::spawn(const Being *const being A_UNUSED,
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp
index 2d1389581..8b1792e17 100644
--- a/src/net/messageout.cpp
+++ b/src/net/messageout.cpp
@@ -156,7 +156,7 @@ unsigned char MessageOut::toServerDirection(unsigned char direction)
case 4: // UP
direction = 4;
break;
- case 12: // UP | RIGHT
+ case 12: // UP | RIGHT
direction = 5;
break;
case 8: // RIGHT