diff options
author | Lloyd Bryant <lloyd_bryant@netzero.net> | 2008-08-17 06:28:13 +0000 |
---|---|---|
committer | Lloyd Bryant <lloyd_bryant@netzero.net> | 2008-08-17 06:28:13 +0000 |
commit | d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18 (patch) | |
tree | d1eb473d5d703ac37c7ed4cdcfc52e4caca5aa95 | |
parent | 68888853bc946a52ca368c5fc859b6709ae0e661 (diff) | |
download | mana-d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18.tar.gz mana-d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18.tar.bz2 mana-d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18.tar.xz mana-d5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18.zip |
Fixed crash resulting from having a player targeted when hitting a warp point
-rw-r--r-- | ChangeLog | 31 | ||||
-rw-r--r-- | src/being.cpp | 1 | ||||
-rw-r--r-- | src/monster.cpp | 10 | ||||
-rw-r--r-- | src/net/beinghandler.cpp | 5 | ||||
-rw-r--r-- | src/net/playerhandler.cpp | 7 |
5 files changed, 31 insertions, 23 deletions
@@ -1,3 +1,8 @@ +2008-08-16 Lloyd Bryant ("Sanga") <sanga@aethyra.com> + + * Fixed bug where client would crash if another player + was targeted when you hit a warp point. + 2008-08-14 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Uncommented line so that MP status bar correctly @@ -10,33 +15,33 @@ provided "GM flag", which prepends "(GM)" to the player's name and changes the font color. -2008-08-08 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-08-08 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Made "--skipupdate" skip the update download process, but still load whatever updates have been previously downloaded. -2008-07-25 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-25 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Added feature to remember window locations from one session to the next (patch from TMW by ElvenProgrammer) -2008-07-24 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-24 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Tweak in net/beinghandler.cpp to compensate for a visual bug when using the TMW server. -2008-07-23 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-23 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Added support for capes/misc1/misc2 into the character selection display -2008-07-23 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-23 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Added "chat" button to open/close chat window * Added support for viewable cape/misc1/misc2 (new eAthena version ONLY -2008-07-22 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-22 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Added handler for 0x0086 movement packet (new eAthena). * Changed startup sequence for game.cpp to send a ping packet @@ -44,11 +49,11 @@ This is required by the new eAthena version. * Added #deines for some "ping" packets. -2008-07-19 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-19 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Removed unnecessary check ("weight") from itemdb loader -2008-07-18 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-18 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Added code to provide viewable glove and shoe sprites @@ -56,18 +61,18 @@ * Added code to avoid collision between different displayed text. -2008-07-08 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-08 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Added handling for a "Stop Walking" packet. This will force the client back into sync during those "can't run away from a battle" sync error conditions. -2008-07-07 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-07 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Added support for update host provided by login server * Changed startup sequence to login first, then update -2008-07-05 Lloyd Bryant ("Sanga") <lloyd_bryant@netzero.net> +2008-07-05 Lloyd Bryant ("Sanga") <sanga@aethyra.com> * Applied patch from kraant to convert into a TME branded client * Removed redundant autoconf files @@ -153,12 +158,12 @@ now stored in an update host specific directory. Based on a patch by Sanga. -2008-06-04 Lloyd Bryant <lloyd_bryant@netzero.net> +2008-06-04 Lloyd Bryant <sanga@aethyra.com> * src/net/charserverhandler.cpp: Display shield sprite also in character select window. -2008-05-30 Lloyd Bryant <lloyd_bryant@netzero.net> +2008-05-30 Lloyd Bryant <sanga@aethyra.com> * src/net/equipmenthandler.cpp, src/net/beinghandler.cpp, src/net/protocol.h, src/being.h: Merged handling for eAthena packets diff --git a/src/being.cpp b/src/being.cpp index 822bc647..fd1b67fe 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -33,6 +33,7 @@ #include "map.h" #include "particle.h" #include "text.h" +#include "localplayer.h" #include "resources/resourcemanager.h" #include "resources/imageset.h" diff --git a/src/monster.cpp b/src/monster.cpp index 5d62a9cc..e5f9f4b2 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -28,7 +28,6 @@ #include "sound.h" #include "particle.h" #include "text.h" -#include "localplayer.h" #include "gui/gui.h" @@ -66,12 +65,11 @@ Monster::Monster(Uint32 id, Uint16 job, Map *map): } } -Monster::~Monster() -{ +Monster::~Monster() { + if (mText) - { - player_node->setTarget(0); - } + delete mText; + } void diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index affdcd56..5b2ac5f4 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -201,10 +201,9 @@ void BeingHandler::handleMessage(MessageIn *msg) if (!dstBeing) break; - if (dstBeing == player_node->getTarget()) - { + // If this is player's current target, clear it. + if (player_node->getTarget() == dstBeing) player_node->stopAttack(); - } if (msg->readInt8() == 1) { diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 7f9e455a..e871b670 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -129,6 +129,12 @@ void PlayerHandler::handleMessage(MessageIn *msg) logger->log("Warping to %s (%d, %d)", mapPath.c_str(), x, y); + /* + * We must clear the local player's target *before* the call + * to changeMap, as it deletes all beings. + */ + player_node->stopAttack(); + // Switch the actual map, deleting the previous one engine->changeMap(mapPath); @@ -138,7 +144,6 @@ void PlayerHandler::handleMessage(MessageIn *msg) float scrollOffsetY = (y - player_node->mY) * 32; player_node->setAction(Being::STAND); - player_node->stopAttack(); player_node->mFrame = 0; player_node->mX = x; player_node->mY = y; |