summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-21 10:24:33 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-21 10:24:33 +0000
commit2448a5c498f13b1da358ddf46c40ed9ca6456fe8 (patch)
tree7dff861ee52a0dbd7978a9cdb84a2a593d9b5e3f /src
parent8ea7fcb1f388e9049029d2c8c77b5894f95d7b3c (diff)
downloadhercules-2448a5c498f13b1da358ddf46c40ed9ca6456fe8.tar.gz
hercules-2448a5c498f13b1da358ddf46c40ed9ca6456fe8.tar.bz2
hercules-2448a5c498f13b1da358ddf46c40ed9ca6456fe8.tar.xz
hercules-2448a5c498f13b1da358ddf46c40ed9ca6456fe8.zip
Fixed battle config loading not applying the side-effects of battle_adjust_conf() side-effect if an import: operation fails.
This is what caused the odd slowdown reported in bugreport:260. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12118 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index c336426a6..cd04f4428 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3729,23 +3729,25 @@ int battle_config_read(const char* cfgName)
count++;
fp = fopen(cfgName,"r");
- if (fp == NULL) {
+ if (fp == NULL)
ShowError("File not found: %s\n", cfgName);
- return 1;
- }
- while(fgets(line, sizeof(line), fp))
+ else
{
- if (line[0] == '/' && line[1] == '/')
- continue;
- if (sscanf(line, "%1023[^:]:%1023s", w1, w2) != 2)
- continue;
- if (strcmpi(w1, "import") == 0)
- battle_config_read(w2);
- else
- if (battle_set_value(w1, w2) == 0)
- ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
+ while(fgets(line, sizeof(line), fp))
+ {
+ if (line[0] == '/' && line[1] == '/')
+ continue;
+ if (sscanf(line, "%1023[^:]:%1023s", w1, w2) != 2)
+ continue;
+ if (strcmpi(w1, "import") == 0)
+ battle_config_read(w2);
+ else
+ if (battle_set_value(w1, w2) == 0)
+ ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
+ }
+
+ fclose(fp);
}
- fclose(fp);
count--;