summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-03-15 18:48:05 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-03-15 18:48:05 +0000
commit7f663395fb7b25d1229822462a72041ad65e391b (patch)
treef1faccd796da8322577fcee91ae775e810382ce6 /src
parentc504f823250938f711341565763eef58827af4a6 (diff)
downloadhercules-7f663395fb7b25d1229822462a72041ad65e391b.tar.gz
hercules-7f663395fb7b25d1229822462a72041ad65e391b.tar.bz2
hercules-7f663395fb7b25d1229822462a72041ad65e391b.tar.xz
hercules-7f663395fb7b25d1229822462a72041ad65e391b.zip
* Fixed pet database reading displaying wrong amount of read entries per file (bugreport:4797).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14746 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/pet.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 6b16fe888..1f350ec4b 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -1220,7 +1220,7 @@ int read_petdb()
for( i = 0; i < ARRAYLENGTH(filename); i++ )
{
char line[1024];
- int lines;
+ int lines, entries;
sprintf(line, "%s/%s", db_path, filename[i]);
fp=fopen(line,"r");
@@ -1231,7 +1231,7 @@ int read_petdb()
continue;
}
- lines = 0;
+ lines = entries = 0;
while( fgets(line, sizeof(line), fp) && j < MAX_PET_DB )
{
char *str[22], *p;
@@ -1326,12 +1326,13 @@ int read_petdb()
pet_db[j].equip_script = parse_script(str[21], filename[i], lines, 0);
j++;
+ entries++;
}
if( j >= MAX_PET_DB )
ShowWarning("read_petdb: Reached max number of pets [%d]. Remaining pets were not read.\n ", MAX_PET_DB);
fclose(fp);
- ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' pets in '"CL_WHITE"%s"CL_RESET"'.\n",j,filename[i]);
+ ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' pets in '"CL_WHITE"%s"CL_RESET"'.\n", entries, filename[i]);
}
return 0;
}