diff options
author | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-01 05:48:06 +0000 |
---|---|---|
committer | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-01 05:48:06 +0000 |
commit | a76908de39c38dcb65afb6d1ab628bc414abd483 (patch) | |
tree | bb1cd4e78c3a5f956dd974bd01b02b5c0c8e92e6 /src/map/npc.c | |
parent | b8b2214648b6408c15cd9018a05a6dc63de45535 (diff) | |
download | hercules-a76908de39c38dcb65afb6d1ab628bc414abd483.tar.gz hercules-a76908de39c38dcb65afb6d1ab628bc414abd483.tar.bz2 hercules-a76908de39c38dcb65afb6d1ab628bc414abd483.tar.xz hercules-a76908de39c38dcb65afb6d1ab628bc414abd483.zip |
* Optimized fake npc system. Added npc_checknear back to npc_buysellsel.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6426 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index a38d36a3d..12c17de7a 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -979,9 +979,9 @@ int npc_checknear(struct map_session_data *sd,int id) return 1;
}
- // Reprecated, please do not uncomment this. [Lance]
- //if (nd->class_<0) // イベント系は常にOK
- // return 0;
+
+ if (nd->class_<0) // イベント系は常にOK
+ return 0;
// エリア判定
if (nd->bl.m!=sd->bl.m ||
@@ -1026,13 +1026,14 @@ int npc_click(struct map_session_data *sd,int id) return 1;
}
+
if (npc_checknear(sd,id))
return 1;
nd=(struct npc_data *)map_id2bl(id);
- //Disabled npc.
- if (nd->sc.option&OPTION_INVISIBLE)
+ //Hidden/Disabled npc.
+ if (nd->class_ < 0 || nd->sc.option&OPTION_INVISIBLE)
return 1;
sd->npc_id=id;
@@ -1085,8 +1086,8 @@ int npc_buysellsel(struct map_session_data *sd,int id,int type) nullpo_retr(1, sd);
- //if (npc_checknear(sd,id))
- // return 1;
+ if (npc_checknear(sd,id))
+ return 1;
nd=(struct npc_data *)map_id2bl(id);
if (nd->bl.subtype!=SHOP) {
|