summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2015-05-06 13:02:40 -0500
committerWushin <pasekei@gmail.com>2015-05-06 13:02:40 -0500
commit85edc4773feebcf492be2c7e7684fab57f49b465 (patch)
tree5bc966846769799fb715155f56dd3180513e2c14 /src
parentf9f5d7d036d9419e2953fe30873c754e07dd7df5 (diff)
parent9f78807e495e22606440c92b63b916354c0c0524 (diff)
downloadtmwa-85edc4773feebcf492be2c7e7684fab57f49b465.tar.gz
tmwa-85edc4773feebcf492be2c7e7684fab57f49b465.tar.bz2
tmwa-85edc4773feebcf492be2c7e7684fab57f49b465.tar.xz
tmwa-85edc4773feebcf492be2c7e7684fab57f49b465.zip
Merge pull request #57 from mekolat/patch-1
remove special warp names
Diffstat (limited to 'src')
-rw-r--r--src/map/pc.cpp29
-rw-r--r--src/map/pc.hpp1
-rw-r--r--src/map/script-fun.cpp19
3 files changed, 2 insertions, 47 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index e8e526a..6fa35b0 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -2289,35 +2289,6 @@ int pc_setpos(dumb_ptr<map_session_data> sd,
}
/*==========================================
- * PCのランダムワープ
- *------------------------------------------
- */
-int pc_randomwarp(dumb_ptr<map_session_data> sd, BeingRemoveWhy type)
-{
- int x, y, i = 0;
-
- nullpo_retz(sd);
-
- P<map_local> m = sd->bl_m;
-
- if (sd->bl_m->flag.get(MapFlag::NOTELEPORT)) // テレポート禁止
- return 0;
-
- do
- {
- x = random_::in(1, m->xs - 2);
- y = random_::in(1, m->ys - 2);
- }
- while (bool(read_gatp(m, x, y) & MapCell::UNWALKABLE)
- && (i++) < 1000);
-
- if (i < 1000)
- pc_setpos(sd, m->name_, x, y, type);
-
- return 0;
-}
-
-/*==========================================
*
*------------------------------------------
*/
diff --git a/src/map/pc.hpp b/src/map/pc.hpp
index 6c0803f..d100938 100644
--- a/src/map/pc.hpp
+++ b/src/map/pc.hpp
@@ -92,7 +92,6 @@ int pc_walktoxy(dumb_ptr<map_session_data>, int, int);
int pc_stop_walking(dumb_ptr<map_session_data>, int);
int pc_setpos(dumb_ptr<map_session_data>, MapName, int, int, BeingRemoveWhy);
void pc_setsavepoint(dumb_ptr<map_session_data>, MapName, int, int);
-int pc_randomwarp(dumb_ptr<map_session_data> sd, BeingRemoveWhy type);
ADDITEM pc_checkadditem(dumb_ptr<map_session_data>, ItemNameId, int);
int pc_inventoryblank(dumb_ptr<map_session_data>);
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index 7fafd91..3291cfc 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -338,22 +338,10 @@ void builtin_warp(ScriptState *st)
{
int x, y;
dumb_ptr<map_session_data> sd = script_rid2sd(st);
-
MapName str = stringish<MapName>(ZString(conv_str(st, &AARG(0))));
x = conv_num(st, &AARG(1));
y = conv_num(st, &AARG(2));
- if (str == "Random"_s)
- pc_randomwarp(sd, BeingRemoveWhy::WARPED);
- else if (str == "SavePoint"_s or str == "Save"_s)
- {
- if (sd->bl_m->flag.get(MapFlag::NORETURN))
- return;
-
- pc_setpos(sd, sd->status.save_point.map_, sd->status.save_point.x, sd->status.save_point.y,
- BeingRemoveWhy::WARPED);
- }
- else
- pc_setpos(sd, str, x, y, BeingRemoveWhy::GONE);
+ pc_setpos(sd, str, x, y, BeingRemoveWhy::GONE);
}
/*==========================================
@@ -364,10 +352,7 @@ static
void builtin_areawarp_sub(dumb_ptr<block_list> bl, MapName mapname, int x, int y)
{
dumb_ptr<map_session_data> sd = bl->is_player();
- if (mapname == "Random"_s)
- pc_randomwarp(sd, BeingRemoveWhy::WARPED);
- else
- pc_setpos(sd, mapname, x, y, BeingRemoveWhy::GONE);
+ pc_setpos(sd, mapname, x, y, BeingRemoveWhy::GONE);
}
static