diff options
author | Fate <fate-tmw@googlemail.com> | 2010-04-16 02:42:14 +0000 |
---|---|---|
committer | Fate <fate-tmw@googlemail.com> | 2010-04-16 02:42:22 +0000 |
commit | f7ec2dcd666826366380c1b50879d29bfe12ea53 (patch) | |
tree | 4fcd92bda22f91328e7e585e37f87598bd90511f /src/map/magic-stmt.c | |
parent | ff7e96f79568d6f5b0ff4bad7da7de40c57481a5 (diff) | |
download | tmwa-f7ec2dcd666826366380c1b50879d29bfe12ea53.tar.gz tmwa-f7ec2dcd666826366380c1b50879d29bfe12ea53.tar.bz2 tmwa-f7ec2dcd666826366380c1b50879d29bfe12ea53.tar.xz tmwa-f7ec2dcd666826366380c1b50879d29bfe12ea53.zip |
Fixed entity_warp() in magic, as used by teleporting, to properly update the map string using pc_setpos()
Noted (and solution suggested) by Freeyorp
Diffstat (limited to 'src/map/magic-stmt.c')
-rw-r--r-- | src/map/magic-stmt.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/map/magic-stmt.c b/src/map/magic-stmt.c index a318314..b9833d6 100644 --- a/src/map/magic-stmt.c +++ b/src/map/magic-stmt.c @@ -405,6 +405,7 @@ static void entity_warp (entity_t * target, int destm, int destx, int desty) case BL_PC: { character_t *character = (character_t *) target; + char *map_name; clif_clearchar_area (&character->bl, 3); map_delblock (&character->bl); character->bl.x = destx; @@ -414,9 +415,13 @@ static void entity_warp (entity_t * target, int destm, int destx, int desty) pc_touch_all_relevant_npcs (character); // Note that touching NPCs may have triggered warping and thereby updated x and y: - clif_changemap (character, map[character->bl.m].name, - character->bl.x, character->bl.y); + map_name = map[character->bl.m].name; + // Warp part #1: update relevant data, interrupt trading etc.: + pc_setpos (character, map_name, character->bl.x, character->bl.y, 0); + // Warp part #2: now notify the client + clif_changemap (character, map_name, + character->bl.x, character->bl.y); break; } case BL_MOB: |