summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-09 02:27:33 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-09 02:27:33 +0000
commit9cb21bac409ae46c0f4aa12732579f4f24141278 (patch)
tree6765e1d816c0637f6176c55c2c17c825fc8b4da7
parent9d695a9fec70d038b0edaa8e969e5002e713eb1f (diff)
downloadhercules-9cb21bac409ae46c0f4aa12732579f4f24141278.tar.gz
hercules-9cb21bac409ae46c0f4aa12732579f4f24141278.tar.bz2
hercules-9cb21bac409ae46c0f4aa12732579f4f24141278.tar.xz
hercules-9cb21bac409ae46c0f4aa12732579f4f24141278.zip
Fixed bugreport:6209 / Follow up r16867 : updated mapcache to write onto its proper map_cache.dat depending on the instance's #RENEWAL
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16884 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/tool/Makefile.in6
-rw-r--r--src/tool/mapcache.c13
-rw-r--r--vcproj-10/mapcache.vcxproj1
-rw-r--r--vcproj-9/mapcache.vcproj4
4 files changed, 21 insertions, 3 deletions
diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in
index 9d9a8668f..d72ef5405 100644
--- a/src/tool/Makefile.in
+++ b/src/tool/Makefile.in
@@ -4,7 +4,7 @@ COMMON_OBJ = ../common/obj_all/minicore.o ../common/obj_all/malloc.o \
../common/obj_all/utils.o ../common/obj_all/des.o ../common/obj_all/grfio.o
COMMON_H = ../common/core.h ../common/mmo.h \
../common/malloc.h ../common/showmsg.h ../common/strlib.h \
- ../common/utils.h ../common/cbasetypes.h ../common/des.h ../common/grfio.h
+ ../common/utils.h ../common/cbasetypes.h ../common/des.h ../common/grfio.h ../config/renewal.h
LIBCONFIG_OBJ = ../../3rdparty/libconfig/libconfig.o ../../3rdparty/libconfig/grammar.o \
../../3rdparty/libconfig/scanctx.o ../../3rdparty/libconfig/scanner.o ../../3rdparty/libconfig/strbuf.o
@@ -13,6 +13,8 @@ LIBCONFIG_H = ../../3rdparty/libconfig/libconfig.h ../../3rdparty/libconfig/gram
../../3rdparty/libconfig/strbuf.h ../../3rdparty/libconfig/wincompat.h
LIBCONFIG_INCLUDE = -I../../3rdparty/libconfig
+OTHER_H = ../config/renewal.h
+
MAPCACHE_OBJ = obj_all/mapcache.o
@SET_MAKE@
@@ -42,7 +44,7 @@ help:
obj_all:
-mkdir obj_all
-obj_all/%.o: %.c $(COMMON_H) $(LIBCONFIG_H)
+obj_all/%.o: %.c $(COMMON_H) $(OTHER_H) $(LIBCONFIG_H)
@echo " CC $<"
@@CC@ @CFLAGS@ $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c
index 9c4fd2cbf..9cb1d792c 100644
--- a/src/tool/mapcache.c
+++ b/src/tool/mapcache.c
@@ -7,6 +7,8 @@
#include "../common/mmo.h"
#include "../common/showmsg.h"
+#include "../config/renewal.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -19,7 +21,7 @@
char grf_list_file[256] = "conf/grf-files.txt";
char map_list_file[256] = "db/map_index.txt";
-char map_cache_file[256] = "db/map_cache.dat";
+char map_cache_file[256];
int rebuild = 0;
FILE *map_cache_fp;
@@ -254,6 +256,15 @@ int do_init(int argc, char** argv)
struct map_data map;
char name[MAP_NAME_LENGTH_EXT];
+ /* setup pre-defined, #define-dependant */
+ sprintf(map_cache_file,"db/%s/map_cache.dat",
+#ifndef RENEWAL
+ "re"
+#else
+ "pre-re"
+#endif
+ );
+
// Process the command-line arguments
process_args(argc, argv);
diff --git a/vcproj-10/mapcache.vcxproj b/vcproj-10/mapcache.vcxproj
index 3f277143f..f2f5fec95 100644
--- a/vcproj-10/mapcache.vcxproj
+++ b/vcproj-10/mapcache.vcxproj
@@ -143,6 +143,7 @@
<ClInclude Include="..\src\common\strlib.h" />
<ClInclude Include="..\src\common\utils.h" />
<ClInclude Include="..\src\common\winapi.h" />
+ <ClInclude Include="..\src\config\renewal.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/vcproj-9/mapcache.vcproj b/vcproj-9/mapcache.vcproj
index 5fdac3d5b..45d40a004 100644
--- a/vcproj-9/mapcache.vcproj
+++ b/vcproj-9/mapcache.vcproj
@@ -278,6 +278,10 @@
RelativePath="..\src\tool\mapcache.c"
>
</File>
+ <File
+ RelativePath="..\src\config\renewal.h"
+ >
+ </File>
</Filter>
</Files>
<Globals>