diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-16 17:21:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-16 17:21:46 +0300 |
commit | bc7213b9b4650dd26029be375e7a6727bd60afb2 (patch) | |
tree | e325f8172b50681487b024456dfb4da9a7a7853f /src/emap/atcommand.c | |
parent | b7afcb67f381f5087f2cf1e388b7acf79fa95a03 (diff) | |
download | evol-hercules-bc7213b9b4650dd26029be375e7a6727bd60afb2.tar.gz evol-hercules-bc7213b9b4650dd26029be375e7a6727bd60afb2.tar.bz2 evol-hercules-bc7213b9b4650dd26029be375e7a6727bd60afb2.tar.xz evol-hercules-bc7213b9b4650dd26029be375e7a6727bd60afb2.zip |
Add gm command slide for fast move player on same map.
Diffstat (limited to 'src/emap/atcommand.c')
-rw-r--r-- | src/emap/atcommand.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/emap/atcommand.c b/src/emap/atcommand.c index 7978758..5818dc4 100644 --- a/src/emap/atcommand.c +++ b/src/emap/atcommand.c @@ -89,3 +89,37 @@ ACMD2(setSkill) return true; } + +ACMD2(slide) +{ + int x = 0; + int y = 0; + if (!*message || sscanf(message, "%4d %4d", &x, &y) < 2) + { + const char* text = info->help; + if (text) + clif->messageln (fd, text); + return false; + } + + if (!sd) + { + clif->message(fd, msg_fd(fd, 3)); // Character not found. + return false; + } + + const int m = sd->bl.m; + if (x < 0 || x >= map->list[m].xs || y < 0 || y >= map->list[m].ys) + { + ShowError("slide: attempt to place player %s (%d:%d) on invalid coordinates (%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, x, y); + return false; + } + if (map->getcell(m, &sd->bl, x, y, CELL_CHKNOPASS) && pc_get_group_level(sd) < battle->bc->gm_ignore_warpable_area) + { + clif->message(fd, msg_fd(fd, 2)); + return false; + } + clif->slide(&sd->bl, x, y); + unit->movepos(&sd->bl, x, y, 1, 0); + return true; +} |