summaryrefslogtreecommitdiff
path: root/src/net/protocol.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-13 12:49:52 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-13 12:49:52 +0000
commit10b881f997384378a299bff358716db5183b65a5 (patch)
tree2231d834a69c1db68980c1ccefdc6586df351fc0 /src/net/protocol.cpp
parentda5a71f65682dbb3f830be4d5ffcd0046aa7b7ce (diff)
downloadMana-10b881f997384378a299bff358716db5183b65a5.tar.gz
Mana-10b881f997384378a299bff358716db5183b65a5.tar.bz2
Mana-10b881f997384378a299bff358716db5183b65a5.tar.xz
Mana-10b881f997384378a299bff358716db5183b65a5.zip
Huge header cleanup to reduce dependencies and compile time.
Diffstat (limited to 'src/net/protocol.cpp')
-rw-r--r--src/net/protocol.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp
index 53a0d2c8..e30e9d4e 100644
--- a/src/net/protocol.cpp
+++ b/src/net/protocol.cpp
@@ -21,13 +21,7 @@
* $Id$
*/
-#include <guichan.hpp>
-#include "../main.h"
-#include "../game.h"
-#include "../playerinfo.h"
-#include "../log.h"
#include "protocol.h"
-#include "network.h"
#ifdef WIN32
#include <windows.h>
@@ -35,6 +29,15 @@
#include "win2linux.h"
#endif
+#include "network.h"
+
+#include "../being.h"
+#include "../game.h"
+#include "../log.h"
+#include "../main.h"
+#include "../playerinfo.h"
+#include "../sound.h"
+
short packet_lengths[] = {
10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -232,19 +235,19 @@ Being* attack(unsigned short x, unsigned short y, unsigned char direction)
switch (direction)
{
- case SOUTH:
+ case Being::SOUTH:
target = findNode(x, y + 1, Being::MONSTER);
break;
- case WEST:
+ case Being::WEST:
target = findNode(x - 1, y, Being::MONSTER);
break;
- case NORTH:
+ case Being::NORTH:
target = findNode(x, y - 1, Being::MONSTER);
break;
- case EAST:
+ case Being::EAST:
target = findNode(x + 1, y, Being::MONSTER);
break;
}
@@ -264,16 +267,16 @@ void attack(Being *target)
if (abs(dist_y) >= abs(dist_x))
{
if (dist_y > 0)
- player_node->direction = SOUTH;
+ player_node->direction = Being::SOUTH;
else
- player_node->direction = NORTH;
+ player_node->direction = Being::NORTH;
}
else
{
if (dist_x > 0)
- player_node->direction = EAST;
+ player_node->direction = Being::EAST;
else
- player_node->direction = WEST;
+ player_node->direction = Being::WEST;
}
// Implement charging attacks here