diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-23 13:08:54 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-23 13:08:54 +0000 |
commit | 593b12ed67cf27b69563afd2d12752c7ebfee683 (patch) | |
tree | 5c7c850f6950104e7e5aafa300035744fded470c /src/map | |
parent | 1b008a629ddb633d91a70e2c037924fab10e2d6c (diff) | |
download | hercules-593b12ed67cf27b69563afd2d12752c7ebfee683.tar.gz hercules-593b12ed67cf27b69563afd2d12752c7ebfee683.tar.bz2 hercules-593b12ed67cf27b69563afd2d12752c7ebfee683.tar.xz hercules-593b12ed67cf27b69563afd2d12752c7ebfee683.zip |
* Added some of Shinomori's fixes
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@751 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/intif.c | 18 | ||||
-rw-r--r-- | src/map/npc.c | 25 | ||||
-rw-r--r-- | src/map/pc.c | 12 | ||||
-rw-r--r-- | src/map/pc.h | 7 |
4 files changed, 44 insertions, 18 deletions
diff --git a/src/map/intif.c b/src/map/intif.c index fd79acc0c..28f1b65a2 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -627,6 +627,7 @@ int intif_guild_castle_datasave(int castle_id,int index, int value) // Wisp/Page reception int intif_parse_WisMessage(int fd) { // rewritten by [Yor] struct map_session_data* sd; + char *wisp_source; int id=RFIFOL(fd,4); int i=0; //,j=0; @@ -651,9 +652,20 @@ int intif_parse_WisMessage(int fd) { // rewritten by [Yor] else{ */ - if(i == MAX_IGNORE_LIST) { - clif_wis_message(sd->fd,RFIFOP(fd,8),RFIFOP(fd,56),RFIFOW(fd,2)-56); - intif_wis_replay(RFIFOL(fd,4),0); // 送信成功 + else { + wisp_source = RFIFOP(fd,8); // speed up [Yor] + for(i=0;i<MAX_IGNORE_LIST;i++){ //拒否リストに名前があるかどうか判定してあれば拒否 + if(strcmp(sd->ignore[i].name, wisp_source)==0){ + break; + } + } + if(i==MAX_IGNORE_LIST) // run out of list, so we are not ignored + { + clif_wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56); + intif_wis_replay(id,0); // 送信成功 + } + else + intif_wis_replay(id, 2); // 受信拒否 } }else intif_wis_replay(id,1); // そんな人いません diff --git a/src/map/npc.c b/src/map/npc.c index 7b616282f..728e76a9c 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -32,13 +32,17 @@ struct npc_src_list { struct npc_src_list * next; - struct npc_src_list * prev; +// struct npc_src_list * prev; //[Shinomori] char name[4]; } ; -static struct npc_src_list *npc_src_first,*npc_src_last; +static struct npc_src_list *npc_src_first=NULL; +static struct npc_src_list *npc_src_last=NULL; static int npc_id=START_NPC_NUM; -static int npc_warp,npc_shop,npc_script,npc_mob; +static int npc_warp=0; +static int npc_shop=0; +static int npc_script=0; +static int npc_mob=0; int npc_get_new_npc_id(void){ return npc_id++; } @@ -1366,6 +1370,17 @@ void npc_addsrcfile(char *name) return; } + { + // prevent multiple insert of source files + struct npc_src_list *p=npc_src_first; + while( p ) + { // found the file, no need to insert it again + if( 0==strcmp(name,p->name) ) + return; + p=p->next; + } + } + len = sizeof(*new) + strlen(name); new=(struct npc_src_list *)aCalloc(1,len); new->next = NULL; @@ -2273,10 +2288,10 @@ int do_init_npc(void) memset(&ev_tm_b,-1,sizeof(ev_tm_b)); for(nsl=npc_src_first;nsl;nsl=nsl->next) { - if(nsl->prev){ + /*if(nsl->prev){ // [Shinomori] free(nsl->prev); nsl->prev = NULL; - } + }*/ fp=fopen(nsl->name,"r"); if (fp==NULL) { printf("file not found : %s\n",nsl->name); diff --git a/src/map/pc.c b/src/map/pc.c index 3cd14fcef..09ff43733 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -55,13 +55,11 @@ static char job_bonus[3][MAX_PC_CLASS][MAX_LEVEL]; static int exp_table[14][MAX_LEVEL]; static char statp[255][7]; -/*static struct { - int id; - int max; - struct { - short id,lv; - } need[6]; -} skill_tree[3][MAX_PC_CLASS][100];*/ // moved to pc.h - celest +// h-files are for declarations, not for implementations... [Shinomori] +struct skill_tree_entry skill_tree[3][MAX_PC_CLASS][100]; +// timer for night.day implementation +int day_timer_tid; +int night_timer_tid; static int atkmods[3][20]; // 武器ATKサイズ修正(size_fix.txt) static int refinebonus[5][3]; // 精?ボ?ナステ?ブル(refine_db.txt) diff --git a/src/map/pc.h b/src/map/pc.h index 1f294ce92..a32926886 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -181,7 +181,8 @@ struct skill_tree_entry { struct { short id,lv; } need[6]; -} skill_tree[3][MAX_PC_CLASS][100]; // Celest +}; // Celest +extern struct skill_tree_entry skill_tree[3][MAX_PC_CLASS][100]; int pc_read_gm_account(int fd); int pc_setinvincibletimer(struct map_session_data *sd,int); @@ -194,8 +195,8 @@ int do_init_pc(void); enum {ADDITEM_EXIST,ADDITEM_NEW,ADDITEM_OVERAMOUNT}; // timer for night.day -int day_timer_tid; -int night_timer_tid; +extern int day_timer_tid; +extern int night_timer_tid; int map_day_timer(int,unsigned int,int,int); // by [yor] int map_night_timer(int,unsigned int,int,int); // by [yor] |