summaryrefslogtreecommitdiff
path: root/src/net
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
parentda5a71f65682dbb3f830be4d5ffcd0046aa7b7ce (diff)
downloadmana-client-10b881f997384378a299bff358716db5183b65a5.tar.gz
mana-client-10b881f997384378a299bff358716db5183b65a5.tar.bz2
mana-client-10b881f997384378a299bff358716db5183b65a5.tar.xz
mana-client-10b881f997384378a299bff358716db5183b65a5.zip
Huge header cleanup to reduce dependencies and compile time.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/protocol.cpp31
-rw-r--r--src/net/protocol.h2
2 files changed, 18 insertions, 15 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
diff --git a/src/net/protocol.h b/src/net/protocol.h
index 002b4b2f..3fa039ba 100644
--- a/src/net/protocol.h
+++ b/src/net/protocol.h
@@ -24,7 +24,7 @@
#ifndef _TMW_PROTOCOL_H
#define _TMW_PROTOCOL_H
-#include "../being.h"
+class Being;
// Packets from server to client
#define SMSG_LOGIN_SUCCESS 0x0073 /**< Logged in, starting location */