Selaa lähdekoodia

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
ultramage 15 vuotta sitten
vanhempi
commit
339022cd20
4 muutettua tiedostoa jossa 2 lisäystä ja 23 poistoa
  1. 1 7
      src/map/chrif.c
  2. 0 9
      src/map/map.c
  3. 0 6
      src/map/skill.h
  4. 1 1
      src/map/status.c

+ 1 - 7
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();

+ 0 - 9
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);
 }
 

+ 0 - 6
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‚̃†ƒjƒbƒg”z’u‚ª�Å‘å
 #define MAX_SKILL_UNIT_COUNT ((MAX_SQUARE_LAYOUT*2+1)*(MAX_SQUARE_LAYOUT*2+1))

+ 1 - 1
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;
 }