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 | |
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')
-rw-r--r-- | src/map/magic-stmt.c | 9 | ||||
-rw-r--r-- | src/map/pc.c | 2 |
2 files changed, 8 insertions, 3 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: diff --git a/src/map/pc.c b/src/map/pc.c index 748abf9..bf819a1 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4046,7 +4046,7 @@ int pc_setpos (struct map_session_data *sd, char *mapname_org, int x, int y, if (pc_issit (sd)) { - pc_setstand (sd); +// pc_setstand (sd); // [fate] Nothing wrong with warping while sitting skill_gangsterparadise (sd, 0); } |