From 7b41ec2aaf871b7a443c65259afc1fd625dd3b9f Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 11 Mar 2005 00:57:27 +0000 Subject: Maybe it would be a good idea to handle the login success message. This fixes the initial starting location for new player characters. --- src/being.cpp | 1 + src/being.h | 1 - src/game.cpp | 9 +++++++-- src/main.cpp | 1 + src/main.h | 1 - 5 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') 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 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 #include 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" -- cgit v1.2.3-70-g09d2