浏览代码

Fixed @whozeny.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/athena@300 54d463be-8e91-2dee-dedb-b68131a5f0ec
valaris 20 年之前
父节点
当前提交
a6379d05f6
共有 4 个文件被更改,包括 12 次插入8 次删除
  1. 1 0
      Changelog.txt
  2. 5 2
      src/map/atcommand.c
  3. 4 4
      src/map/map.c
  4. 2 2
      src/map/npc.c

+ 1 - 0
Changelog.txt

@@ -1,5 +1,6 @@
 Date	Added
 11/21
+	* Fixed @whozeny. [Valaris]
 	* Added rest of mapflags to const.txt. [Valaris]
 	* Closed AFM files after reading, this fixed the improper char-server session #. [Valaris]
         * Skill updates: [Celest]

+ 5 - 2
src/map/atcommand.c

@@ -1639,7 +1639,7 @@ int atcommand_whozeny(
 	char match_text[100];
 	char player_name[24];
 	int zeny[clif_countusers()];
-	char counted[clif_countusers()];
+	int counted[clif_countusers()];
 
 	memset(output, '\0', sizeof(output));
 	memset(match_text, '\0', sizeof(match_text));
@@ -1658,6 +1658,7 @@ int atcommand_whozeny(
 					player_name[j] = tolower(player_name[j]);
 				if (strstr(player_name, match_text) != NULL) { // search with no case sensitive
 					zeny[count]=pl_sd->status.zeny;
+					counted[i]=0;
 					count++;
 				}
 		}
@@ -1668,7 +1669,9 @@ int atcommand_whozeny(
 		if(!zeny[c])
 			continue;
 		for (i = 0; i < fd_max; i++) {
-			if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && !counted[i] && zeny[c]) {
+			if(!zeny[c])
+				continue;
+			if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && zeny[c] && counted[i]==0) {
 				if(pl_sd->status.zeny==zeny[c]) {
 					sprintf(output, "Name: %s | Zeny: %d", pl_sd->status.name, pl_sd->status.zeny);
 					clif_displaymessage(fd, output);

+ 4 - 4
src/map/map.c

@@ -1480,8 +1480,8 @@ static int map_readafm(int m,char *fn) {
 	afm_file = fopen(fn, "r");
 	if (afm_file != NULL) {
 			
-		printf("\rLoading Maps [%d/%d]: %-50s  ",m,map_num,fn);
-		fflush(stdout);
+//		printf("\rLoading Maps [%d/%d]: %-50s  ",m,map_num,fn);
+//		fflush(stdout);
 
 		str=fgets(afm_line, sizeof(afm_line)-1, afm_file);
 		str=fgets(afm_line, sizeof(afm_line)-1, afm_file);
@@ -1569,8 +1569,8 @@ static int map_readmap(int m,char *fn, char *alias) {
 	if(gat==NULL)
 		return -1;
 
-	printf("\rLoading Maps [%d/%d]: %-50s  ",m,map_num,fn);
-	fflush(stdout);
+//	printf("\rLoading Maps [%d/%d]: %-50s  ",m,map_num,fn);
+//	fflush(stdout);
 
 	map[m].m=m;
 	xs=map[m].xs=*(int*)(gat+6);

+ 2 - 2
src/map/npc.c

@@ -2282,8 +2282,8 @@ int do_init_npc(void)
 			}
 		}
 		fclose(fp);
-		printf("\rLoading NPCs [%d]: %-54s",npc_id-START_NPC_NUM,nsl->name);
-		fflush(stdout);
+//		printf("\rLoading NPCs [%d]: %-54s",npc_id-START_NPC_NUM,nsl->name);
+//		fflush(stdout);
 	}
 	printf("\rNPCs Loaded: %d [Warps:%d Shops:%d Scripts:%d Mobs:%d]\n",
 		npc_id-START_NPC_NUM,npc_warp,npc_shop,npc_script,npc_mob);