summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-13 23:09:44 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-13 23:09:44 +0300
commit1c7c54e8102f1f449ffe7dfaa3a041915079d290 (patch)
tree3da90ea7e18d4c4a6fe2f0eb4c76718dc3e489f5 /src
parent467455bf7907411918d8fb6f4113eb95df443a29 (diff)
downloadmv-1c7c54e8102f1f449ffe7dfaa3a041915079d290.tar.gz
mv-1c7c54e8102f1f449ffe7dfaa3a041915079d290.tar.bz2
mv-1c7c54e8102f1f449ffe7dfaa3a041915079d290.tar.xz
mv-1c7c54e8102f1f449ffe7dfaa3a041915079d290.zip
fix code style.
Diffstat (limited to 'src')
-rw-r--r--src/actormanager.cpp3
-rw-r--r--src/actormanager.h7
-rw-r--r--src/being/actortype.h2
-rw-r--r--src/being/being.cpp1
-rw-r--r--src/being/being.h3
-rw-r--r--src/being/beingaction.h2
-rw-r--r--src/being/beingdirection.h2
-rw-r--r--src/being/beingflag.h2
-rw-r--r--src/being/compoundsprite.cpp2
-rw-r--r--src/being/compoundsprite.h3
-rw-r--r--src/being/localplayer.cpp16
-rw-r--r--src/being/localplayer.h1
-rw-r--r--src/being/pickup.h2
-rw-r--r--src/gui/windows/whoisonline.cpp1
-rw-r--r--src/guild.cpp2
-rw-r--r--src/net/tmwa/playerhandler.cpp1
-rw-r--r--src/party.cpp2
-rw-r--r--src/resources/beinginfo.h8
18 files changed, 40 insertions, 20 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index f8d4e137e..265c60e17 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -1038,7 +1038,8 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
const bool valid = validateBeing(aroundBeing, being,
type, excluded, 50);
int d = being->getDistance();
- if (being->getType() != ActorType::MONSTER || !mTargetOnlyReachable)
+ if (being->getType() != ActorType::MONSTER
+ || !mTargetOnlyReachable)
{ // if distance not calculated, use old distance
d = (being->getTileX() - x) * (being->getTileX() - x)
+ (being->getTileY() - y) * (being->getTileY() - y);
diff --git a/src/actormanager.h b/src/actormanager.h
index 00be468a1..a44e3fc79 100644
--- a/src/actormanager.h
+++ b/src/actormanager.h
@@ -25,10 +25,11 @@
#include "flooritem.h"
-#include "being/being.h"
+#include "listeners/configlistener.h"
#include "localconsts.h"
+class Being;
class LocalPlayer;
class Map;
@@ -161,8 +162,8 @@ class ActorManager final: public ConfigListener
* Finds a nearest being by name and (optionally) by type.
*/
Being *findNearestByName(const std::string &name,
- const ActorType::Type &type = ActorType::UNKNOWN)
- const A_WARN_UNUSED;
+ const ActorType::Type &type
+ = ActorType::UNKNOWN) const A_WARN_UNUSED;
/**
* Heal all players in distance.
diff --git a/src/being/actortype.h b/src/being/actortype.h
index 794dae5f2..f57d6662b 100644
--- a/src/being/actortype.h
+++ b/src/being/actortype.h
@@ -35,6 +35,6 @@ namespace ActorType
PET,
AVATAR
};
-}
+} // namespace ActorType
#endif // BEING_ACTORTYPE_H
diff --git a/src/being/being.cpp b/src/being/being.cpp
index a2be3a071..0d72585f1 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -36,6 +36,7 @@
#include "being/attributes.h"
#include "being/beingaction.h"
#include "being/beingcacheentry.h"
+#include "being/beingflag.h"
#include "being/beingspeech.h"
#include "being/playerrelations.h"
diff --git a/src/being/being.h b/src/being/being.h
index e01c7b08e..87949479c 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -31,9 +31,10 @@
#include "being/beingaction.h"
#include "being/beingdirection.h"
-#include "being/beingflag.h"
#include "being/gender.h"
+#include "being/actorsprite.h"
+
#include <map>
#include "localconsts.h"
diff --git a/src/being/beingaction.h b/src/being/beingaction.h
index a6bc47b28..91bd7de27 100644
--- a/src/being/beingaction.h
+++ b/src/being/beingaction.h
@@ -40,6 +40,6 @@ namespace BeingAction
HURT,
SPAWN
};
-} // BeingAction
+} // namespace BeingAction
#endif // BEING_BEINGACTION_H
diff --git a/src/being/beingdirection.h b/src/being/beingdirection.h
index 7d17b788f..6e4d394ed 100644
--- a/src/being/beingdirection.h
+++ b/src/being/beingdirection.h
@@ -35,6 +35,6 @@ namespace BeingDirection
UP = 4,
RIGHT = 8
};
-}
+} // namespace BeingDirection
#endif // BEING_BEINGDIRECTION_H
diff --git a/src/being/beingflag.h b/src/being/beingflag.h
index 9c9a76ef4..029283c7c 100644
--- a/src/being/beingflag.h
+++ b/src/being/beingflag.h
@@ -33,5 +33,5 @@ namespace BeingFlag
GENDER_MALE = 128,
SPECIAL = 128 + 64
};
-}
+} // namespace BeingFlag
#endif // BEING_BEINGFLAG_H
diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp
index 4e496730d..d355deafc 100644
--- a/src/being/compoundsprite.cpp
+++ b/src/being/compoundsprite.cpp
@@ -30,6 +30,8 @@
#include "sdlshared.h"
+#include "being/compounditem.h"
+
#include "resources/map/map.h"
#include "resources/map/mapconsts.h"
diff --git a/src/being/compoundsprite.h b/src/being/compoundsprite.h
index 7e983ad2d..b36da2d1f 100644
--- a/src/being/compoundsprite.h
+++ b/src/being/compoundsprite.h
@@ -24,13 +24,12 @@
#include "sprite.h"
-#include "being/compounditem.h"
-
#include <list>
#include <vector>
#include "localconsts.h"
+class CompoundItem;
class Image;
class CompoundSprite : public Sprite
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 9ba8b236b..8d921d8dd 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -36,6 +36,7 @@
#include "resources/map/walklayer.h"
#include "being/attributes.h"
+#include "being/beingflag.h"
#include "being/pickup.h"
#include "being/playerinfo.h"
#include "being/playerrelations.h"
@@ -763,7 +764,8 @@ void LocalPlayer::attack(Being *const target, const bool keep,
mActionTime = tick_time;
- if (target->getType() != ActorType::PLAYER || checAttackPermissions(target))
+ if (target->getType() != ActorType::PLAYER
+ || checAttackPermissions(target))
{
setAction(BeingAction::ATTACK);
@@ -2284,28 +2286,32 @@ void LocalPlayer::crazyMoveA()
// if (client->limitPackets(PACKET_DIRECTION))
{
setDirection(BeingDirection::DOWN);
- Net::getPlayerHandler()->setDirection(BeingDirection::DOWN);
+ Net::getPlayerHandler()->setDirection(
+ BeingDirection::DOWN);
}
break;
case 'u':
// if (client->limitPackets(PACKET_DIRECTION))
{
setDirection(BeingDirection::UP);
- Net::getPlayerHandler()->setDirection(BeingDirection::UP);
+ Net::getPlayerHandler()->setDirection(
+ BeingDirection::UP);
}
break;
case 'l':
// if (client->limitPackets(PACKET_DIRECTION))
{
setDirection(BeingDirection::LEFT);
- Net::getPlayerHandler()->setDirection(BeingDirection::LEFT);
+ Net::getPlayerHandler()->setDirection(
+ BeingDirection::LEFT);
}
break;
case 'r':
// if (client->limitPackets(PACKET_DIRECTION))
{
setDirection(BeingDirection::RIGHT);
- Net::getPlayerHandler()->setDirection(BeingDirection::RIGHT);
+ Net::getPlayerHandler()->setDirection(
+ BeingDirection::RIGHT);
}
break;
case 'L':
diff --git a/src/being/localplayer.h b/src/being/localplayer.h
index ee57dc96a..d327ee19a 100644
--- a/src/being/localplayer.h
+++ b/src/being/localplayer.h
@@ -27,7 +27,6 @@
#include "gui/userpalette.h"
-#include "listeners/actionlistener.h"
#include "listeners/actorspritelistener.h"
#include "listeners/attributelistener.h"
#include "listeners/statlistener.h"
diff --git a/src/being/pickup.h b/src/being/pickup.h
index b15070e58..dfa35fe20 100644
--- a/src/being/pickup.h
+++ b/src/being/pickup.h
@@ -40,6 +40,6 @@ namespace Pickup
STACK_FULL,
DROP_STEAL
};
-}
+} // namespace Pickup
#endif // BEING_PICKUP_H
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index ff24030d4..2df2f431b 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -39,6 +39,7 @@
#include "configuration.h"
#include "main.h"
+#include "being/beingflag.h"
#include "being/localplayer.h"
#include "being/playerrelations.h"
diff --git a/src/guild.cpp b/src/guild.cpp
index c6411e774..a589430e2 100644
--- a/src/guild.cpp
+++ b/src/guild.cpp
@@ -24,6 +24,8 @@
#include "actormanager.h"
+#include "being/being.h"
+
#include "utils/stringutils.h"
#include "debug.h"
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 550d0e89d..09d7e2163 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -27,6 +27,7 @@
#include "soundmanager.h"
#include "being/attributes.h"
+#include "being/beingflag.h"
#include "net/net.h"
diff --git a/src/party.cpp b/src/party.cpp
index 8b004883f..5e07175d7 100644
--- a/src/party.cpp
+++ b/src/party.cpp
@@ -23,6 +23,8 @@
#include "actormanager.h"
+#include "being/being.h"
+
#include "utils/stringutils.h"
#include "debug.h"
diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h
index f76a08cc6..62ad7eaf9 100644
--- a/src/resources/beinginfo.h
+++ b/src/resources/beinginfo.h
@@ -23,13 +23,17 @@
#ifndef RESOURCES_BEINGINFO_H
#define RESOURCES_BEINGINFO_H
-#include "being/actorsprite.h"
-
#include "resources/cursor.h"
+
+#include "being/targetcursorsize.h"
+
#include "resources/soundinfo.h"
+#include "resources/spritedef.h"
#include "resources/db/colordb.h"
+#include "resources/map/blocktype.h"
+
#include <map>
struct Attack final