summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net/protocol.cpp7
-rw-r--r--src/net/protocol.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp
index 4b94a66c..0187f69e 100644
--- a/src/net/protocol.cpp
+++ b/src/net/protocol.cpp
@@ -241,14 +241,15 @@ int attack(unsigned short x, unsigned short y, unsigned char direction)
attack(target);
return target->id;
}
-
+
// Implement charging attacks here
char_info->lastAttackTime = 0;
-
+
return 0;
}
-void attack(Being *target) {
+void attack(Being *target)
+{
int dist_x = target->x - player_node->x;
int dist_y = target->y - player_node->y;
if (abs(dist_y) >= abs(dist_x)) {
diff --git a/src/net/protocol.h b/src/net/protocol.h
index 07684298..57321d45 100644
--- a/src/net/protocol.h
+++ b/src/net/protocol.h
@@ -24,6 +24,8 @@
#ifndef _TMW_PROTOCOL_H
#define _TMW_PROTOCOL_H
+#include "../being.h"
+
// Packets from server to client
#define SMSG_LOGIN_SUCCESS 0x0073 /**< Logged in, starting location */
#define SMSG_REMOVE_BEING 0x0080 /**< Died, logged out, teleport ... */