From 339022cd204a9119ce309a78449aeb8e1f8e5d69 Mon Sep 17 00:00:00 2001 From: ultramage Date: Sat, 27 Feb 2010 18:01:09 +0000 Subject: [PATCH] Some generic code cleanups (unused struct, user counting, code comment). git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14254 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/chrif.c | 8 +------- src/map/map.c | 9 --------- src/map/skill.h | 6 ------ src/map/status.c | 2 +- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/map/chrif.c b/src/map/chrif.c index eaedb8a4d4..5054054246 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1501,13 +1501,7 @@ int send_users_tochar(void) chrif_check(-1); - // get user count (TODO: improve this) - iter = mapit_getallusers(); - for( mapit_first(iter); mapit_exists(iter); mapit_next(iter) ) - users++; - mapit_free(iter); - - // build the packet + users = map_usercount(); WFIFOHEAD(char_fd, 6+8*users); WFIFOW(char_fd,0) = 0x2aff; iter = mapit_getallusers(); diff --git a/src/map/map.c b/src/map/map.c index ebeea67a11..b58033f1f2 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -179,15 +179,6 @@ int map_getusers(void) *------------------------------------------*/ int map_usercount(void) { -/* - int count = 0; - struct s_mapiterator* iter = mapit_getallusers(); - for( mapit_first(iter); mapit_exists(iter); mapit_next(iter) ) - count++; - mapit_free(iter); - return count; -*/ - // since pc_db now only holds fully authed players, this approach is equivalent: return pc_db->size(pc_db); } diff --git a/src/map/skill.h b/src/map/skill.h index d8a0f5f64a..6c8ac178ef 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -99,12 +99,6 @@ struct s_skill_db { }; extern struct s_skill_db skill_db[MAX_SKILL_DB]; -struct skill_name_db { - int id; // skill id - char *name; // search strings - char *desc; // description that shows up for searches -}; - #define MAX_SKILL_UNIT_LAYOUT 50 #define MAX_SQUARE_LAYOUT 5 // 11*11のユニット配置が最大 #define MAX_SKILL_UNIT_COUNT ((MAX_SQUARE_LAYOUT*2+1)*(MAX_SQUARE_LAYOUT*2+1)) diff --git a/src/map/status.c b/src/map/status.c index 20335d8ede..4a72019476 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6218,7 +6218,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val } if( opt_flag&2 && sd && sd->touching_id ) - npc_touchnext_areanpc(sd,false); + npc_touchnext_areanpc(sd,false); // run OnTouch_ on next char in range return 1; }