diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-04 01:58:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-04 01:58:21 +0300 |
commit | 90f9d99976e2053dcf8448c47da615d234d83fbf (patch) | |
tree | 219581871c21a6859ab869e04bdf1ef1569c6f5f /src/map/npc.c | |
parent | bf5775fe4c2ea24a4404335ea01a60ac76021230 (diff) | |
download | evol-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.
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 29 |
1 files changed, 2 insertions, 27 deletions
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; |