summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-04 01:58:21 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-04 01:58:21 +0300
commit90f9d99976e2053dcf8448c47da615d234d83fbf (patch)
tree219581871c21a6859ab869e04bdf1ef1569c6f5f
parentbf5775fe4c2ea24a4404335ea01a60ac76021230 (diff)
downloadevol-hercules-90f9d99976e2053dcf8448c47da615d234d83fbf.tar.gz
evol-hercules-90f9d99976e2053dcf8448c47da615d234d83fbf.tar.bz2
evol-hercules-90f9d99976e2053dcf8448c47da615d234d83fbf.tar.xz
evol-hercules-90f9d99976e2053dcf8448c47da615d234d83fbf.zip
Remove script command setnpcdistance and area distance variable.
Now it in upstream.
-rw-r--r--src/map/data/npcd.c1
-rw-r--r--src/map/init.c1
-rw-r--r--src/map/npc.c29
-rw-r--r--src/map/script.c14
-rw-r--r--src/map/script.h1
-rw-r--r--src/map/struct/npcdext.h1
6 files changed, 2 insertions, 45 deletions
diff --git a/src/map/data/npcd.c b/src/map/data/npcd.c
index 535c953..aef922b 100644
--- a/src/map/data/npcd.c
+++ b/src/map/data/npcd.c
@@ -34,6 +34,5 @@ struct NpcdExt *npcd_create(void)
if (!data)
return NULL;
data->init = false;
- data->areaSize = AREA_SIZE;
return data;
}
diff --git a/src/map/init.c b/src/map/init.c
index f1e7004..b73427f 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -85,7 +85,6 @@ HPExport void plugin_init (void)
addScriptCommand("getmapmask", "s", getMapMask);
addScriptCommand("getnpcclass", "*", getNpcClass);
addScriptCommand("setnpcsex", "*", setNpcSex);
- addScriptCommand("setnpcdistance", "i", setNpcDistance);
addScriptCommand("setpcsit", "*", setPcSit);
addScriptCommand("getpcsit", "*", getPcSit);
addScriptCommand("showavatar", "*", showAvatar);
diff --git a/src/map/npc.c b/src/map/npc.c
index 8ad68af..0fc5c33 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -24,8 +24,6 @@ struct npc_data* enpc_checknear(struct map_session_data* sd, struct block_list*
{
struct npc_data *nd;
- hookStop();
-
if (!sd)
return NULL;
@@ -36,32 +34,9 @@ struct npc_data* enpc_checknear(struct map_session_data* sd, struct block_list*
nd = (TBL_NPC*)bl;
if (sd->npc_id == bl->id)
- return nd;
-
- if (nd->class_ < 0) //Class-less npc, enable click from anywhere.
- return nd;
-
- const int npcX = bl->x;
- const int npcY = bl->y;
- const int x = sd->bl.x;
- const int y = sd->bl.y;
-
- if (bl->m != sd->bl.m
- || npcX < x - AREA_SIZE - 1 || npcX > x + AREA_SIZE + 1
- || npcY < y - AREA_SIZE - 1 || npcY > y + AREA_SIZE + 1)
- {
- return NULL;
- }
-
- struct NpcdExt *data = npcd_get(nd);
- if (data)
{
- const int size = data->areaSize;
- if (npcX < x - size || npcX > x + size
- || npcY < y - size || npcY > y + size)
- {
- return NULL;
- }
+ hookStop();
+ return nd;
}
return nd;
diff --git a/src/map/script.c b/src/map/script.c
index da63a29..d8ea254 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -753,20 +753,6 @@ BUILDIN(getPcSit)
return true;
}
-BUILDIN(setNpcDistance)
-{
- struct npc_data *nd = (struct npc_data *) map->id2bl (st->oid);
- if (!nd)
- return false;
-
- struct NpcdExt *data = npcd_get(nd);
- if (!data)
- return false;
-
- data->areaSize = script_getnum(st, 2);
- return true;
-}
-
BUILDIN(showAvatar)
{
int id = 0;
diff --git a/src/map/script.h b/src/map/script.h
index b238e92..7fc4ba6 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -32,7 +32,6 @@ BUILDIN(getNpcClass);
BUILDIN(setNpcSex);
BUILDIN(setPcSit);
BUILDIN(getPcSit);
-BUILDIN(setNpcDistance);
BUILDIN(showAvatar);
BUILDIN(setAvatarDir);
BUILDIN(setAvatarAction);
diff --git a/src/map/struct/npcdext.h b/src/map/struct/npcdext.h
index 2ba1b72..2158f2c 100644
--- a/src/map/struct/npcdext.h
+++ b/src/map/struct/npcdext.h
@@ -6,7 +6,6 @@
struct NpcdExt
{
- int areaSize;
bool init;
};