summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvalaris <valaris@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-14 22:31:02 +0000
committervalaris <valaris@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-14 22:31:02 +0000
commit14380ba0d1e63585c3135ac53418bf1a376c099a (patch)
tree2b37b2e9bfb6a7c5ada194edf41288b836f5a9c3
parent093c946637efc6b7e91a4b9300bc60290c0c70b7 (diff)
downloadhercules-14380ba0d1e63585c3135ac53418bf1a376c099a.tar.gz
hercules-14380ba0d1e63585c3135ac53418bf1a376c099a.tar.bz2
hercules-14380ba0d1e63585c3135ac53418bf1a376c099a.tar.xz
hercules-14380ba0d1e63585c3135ac53418bf1a376c099a.zip
* Fixed loading of AFMs when no resnametable is found. [Valaris]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@182 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt2
-rw-r--r--conf-tmpl/grf-files.txt3
-rw-r--r--src/common/grfio.c2
-rw-r--r--src/map/map.c17
4 files changed, 8 insertions, 16 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 6769708a9..87917c677 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,7 +1,7 @@
Date Added
11/14
+ * Fixed loading of AFMs when no resnametable is found. [Valaris]
* mob_db.txt: Fixed Golden Thief Bug MVP MOB mode (it wasn't moving/attacking) [Lupus]
-11/14
* Added AFM (Advanced Fusion Map) support, thanks to alexkreuz and fusion. [Valaris]
Use the afm_dir option in grf-files.txt (currently needs a resnametable.txt).
* Initialized password variable in login.c. [Valaris]
diff --git a/conf-tmpl/grf-files.txt b/conf-tmpl/grf-files.txt
index 3926a63b4..f2a29edd5 100644
--- a/conf-tmpl/grf-files.txt
+++ b/conf-tmpl/grf-files.txt
@@ -1,4 +1,5 @@
data: C:\Program Files\Gravity\RO\data.grf
sdata: C:\Program Files\Gravity\RO\sdata.grf
//adata: C:\Program Files\Gravity\RO\adata.grf
-//data_dir: C:\Program Files\Gravity\RO\ \ No newline at end of file
+//data_dir: C:\Program Files\Gravity\RO\
+//afm_dir: afm \ No newline at end of file
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 0c305773d..ff01b6e76 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -417,7 +417,7 @@ char* grfio_resnametable(char* fname, char *lfname)
fp = fopen(restable,"rb");
if(fp==NULL) {
printf("%s not found (grfio_resnametable)\n",restable);
- exit(1); // 1:not found error
+ return NULL; // 1:not found error
}
while(fgets(line,508,fp)){
diff --git a/src/map/map.c b/src/map/map.c
index 4c6bcaed0..7ecc3eb2a 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1613,16 +1613,6 @@ int map_readallmap(void) {
// 先に全部のャbプの存在を確認
for(i=0;i<map_num;i++){
- if(strstr(map[i].name,".gat")==NULL)
- continue;
- sprintf(fn,"data\\%s",map[i].name);
- if(grfio_size(fn) == -1) {
- map_delmap(map[i].name);
- maps_removed++;
- }
- }
-
- for(i=0;i<map_num;i++){
char afm_name[256] = "";
strncpy(afm_name, map[i].name, strlen(map[i].name) - 4);
strcat(afm_name, ".afm");
@@ -1631,7 +1621,7 @@ int map_readallmap(void) {
afm_file = fopen(fn, "r");
if (afm_file != NULL) {
map_readafm(i,fn);
- }
+ }
else if(strstr(map[i].name,".gat")!=NULL) {
char *p = strstr(map[i].name, ">"); // [MouseJstr]
if (p != NULL) {
@@ -1640,13 +1630,13 @@ int map_readallmap(void) {
strcpy(alias, map[i].name);
strcpy(map[i].name, p + 1);
sprintf(fn,"data\\%s",map[i].name);
- if(map_readmap(i,fn, alias) == -1) {
+ if(grfio_size(fn) == -1 || map_readmap(i,fn, alias) == -1) {
map_delmap(map[i].name);
maps_removed++;
}
} else {
sprintf(fn,"data\\%s",map[i].name);
- if(map_readmap(i,fn, NULL) == -1) {
+ if(grfio_size(fn) == -1 || map_readmap(i,fn, NULL) == -1) {
map_delmap(map[i].name);
maps_removed++;
}
@@ -1685,6 +1675,7 @@ int map_addmap(char *mapname) {
*------------------------------------------
*/
int map_delmap(char *mapname) {
+
int i;
if (strcmpi(mapname, "all") == 0) {