diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-27 16:28:00 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-27 16:28:00 +0000 |
commit | 3e29ca7edd4e8618fa24e6a2c65e35a3baeddad8 (patch) | |
tree | d4c0a477d799150cc8ca2de0a986bd4a7adc2275 /src/map/npc.c | |
parent | e5f192830eb4334ba335872062618961952ca38e (diff) | |
download | hercules-3e29ca7edd4e8618fa24e6a2c65e35a3baeddad8.tar.gz hercules-3e29ca7edd4e8618fa24e6a2c65e35a3baeddad8.tar.bz2 hercules-3e29ca7edd4e8618fa24e6a2c65e35a3baeddad8.tar.xz hercules-3e29ca7edd4e8618fa24e6a2c65e35a3baeddad8.zip |
- Changed npc_click declaration to receive an npc structure rather than a generic block-list one.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7925 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index ac5c88654..626344881 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -969,7 +969,7 @@ int npc_touch_areanpc(struct map_session_data *sd,int m,int x,int y) if( npc_event(sd,name,0)>0 ) {
pc_stop_walking(sd,1); //Make it stop walking!
- npc_click(sd,&(map[m].npc[i]->bl));
+ npc_click(sd,map[m].npc[i]);
}
//aFree(name);
break;
@@ -1082,10 +1082,8 @@ int npc_globalmessage(const char *name,char *mes) * クリック時のNPC処理
*------------------------------------------
*/
-int npc_click(struct map_session_data *sd,struct block_list *bl)
+int npc_click(struct map_session_data *sd,struct npc_data *nd)
{
- struct npc_data *nd = NULL;
-
nullpo_retr(1, sd);
if (sd->npc_id != 0) {
@@ -1094,18 +1092,12 @@ int npc_click(struct map_session_data *sd,struct block_list *bl) return 1;
}
- if(!bl) return 1;
- switch(bl->type){
- case BL_NPC:
- if ((nd = npc_checknear(sd,bl)) == NULL)
- return 1;
- //Hidden/Disabled npc.
- if (nd->class_ < 0 || nd->sc.option&OPTION_INVISIBLE)
- return 1;
- break;
- default:
- return 1;
- }
+ if(!nd) return 1;
+ if ((nd = npc_checknear(sd,&nd->bl)) == NULL)
+ return 1;
+ //Hidden/Disabled npc.
+ if (nd->class_ < 0 || nd->sc.option&OPTION_INVISIBLE)
+ return 1;
switch(nd->bl.subtype) {
case SHOP:
|