summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-11 00:57:27 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-11 00:57:27 +0000
commit7b41ec2aaf871b7a443c65259afc1fd625dd3b9f (patch)
treed7406e40bf4a8ad7941a3a4cb3901de50867fff0 /src
parent95683b8ecea0b12342b259e501e7eed8b5c40ee6 (diff)
downloadMana-7b41ec2aaf871b7a443c65259afc1fd625dd3b9f.tar.gz
Mana-7b41ec2aaf871b7a443c65259afc1fd625dd3b9f.tar.bz2
Mana-7b41ec2aaf871b7a443c65259afc1fd625dd3b9f.tar.xz
Mana-7b41ec2aaf871b7a443c65259afc1fd625dd3b9f.zip
Maybe it would be a good idea to handle the login success message. This fixes
the initial starting location for new player characters.
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp1
-rw-r--r--src/being.h1
-rw-r--r--src/game.cpp9
-rw-r--r--src/main.cpp1
-rw-r--r--src/main.h1
5 files changed, 9 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp
index f49e7145..6ae01f77 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -23,6 +23,7 @@
#include "being.h"
#include "game.h"
+#include "net/protocol.h"
Being *player_node = NULL;
diff --git a/src/being.h b/src/being.h
index 41a2cca5..657a0658 100644
--- a/src/being.h
+++ b/src/being.h
@@ -24,7 +24,6 @@
#ifndef _TMW_BEING_H
#define _TMW_BEING_H
-#include "net/protocol.h"
#include <list>
struct PATH_NODE {
diff --git a/src/game.cpp b/src/game.cpp
index 81c07375..2342168e 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -43,7 +43,6 @@
char map_path[480];
unsigned short dest_x, dest_y, src_x, src_y;
-unsigned int player_x, player_y;
bool refresh_beings = false;
unsigned char keyb_state;
volatile int tick_time;
@@ -493,6 +492,12 @@ void do_parse() {
#endif
// Parse packet based on their id
switch (id) {
+ case SMSG_LOGIN_SUCCESS:
+ // Connected to game server succesfully, set spawn point
+ player_node->x = get_x(RFIFOP(6));
+ player_node->y = get_y(RFIFOP(6));
+ break;
+
// Received speech
case 0x008d:
temp = (char *)malloc(RFIFOW(2)-7);
@@ -1293,7 +1298,7 @@ void do_parse() {
break;
// Manage non implemented packets
default:
- log("Unhandled packet: %x\n", id);
+ log("Unhandled packet: %x", id);
//alert(pkt_nfo,"","","","",0,0);
break;
}
diff --git a/src/main.cpp b/src/main.cpp
index aba7724c..69ffd431 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -29,6 +29,7 @@
#include "sound.h"
#include "graphics.h"
#include "resources/resourcemanager.h"
+#include "net/protocol.h"
#include <iostream>
#include <guichan.hpp>
diff --git a/src/main.h b/src/main.h
index e4876ae6..e8cf4511 100644
--- a/src/main.h
+++ b/src/main.h
@@ -29,7 +29,6 @@
#include "gui/skill.h"
#include "graphic/spriteset.h"
#include "resources/image.h"
-#include "net/protocol.h"
#include "configuration.h"
#include "game.h"
#include "log.h"