summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/const.txt4
-rw-r--r--src/map/script.c11
2 files changed, 8 insertions, 7 deletions
diff --git a/db/const.txt b/db/const.txt
index 5f5ae470a..c97bb2c59 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -78,8 +78,8 @@ Job_Star_Gladiator 4047
Job_Star_Gladiator2 4048
Job_Soul_Linker 4049
-Option_Wedding 4096
-Option_Xmas 131072
+Option_Wedding 0x1000
+Option_Xmas 0x20000
bc_all 0
bc_map 1
diff --git a/src/map/script.c b/src/map/script.c
index 46a73fbd7..a8bedd633 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -1479,8 +1479,8 @@ static void add_buildin_func(void)
static void read_constdb(void)
{
FILE *fp;
- char line[1024],name[1024];
- int val,n,i,type;
+ char line[1024],name[1024],val[1024];
+ int n,i,type;
sprintf(line, "%s/const.txt", db_path);
fp=fopen(line, "r");
@@ -1492,8 +1492,9 @@ static void read_constdb(void)
if(line[0]=='/' && line[1]=='/')
continue;
type=0;
- if(sscanf(line,"%[A-Za-z0-9_],%d,%d",name,&val,&type)>=2 ||
- sscanf(line,"%[A-Za-z0-9_] %d %d",name,&val,&type)>=2){
+ if(sscanf(line,"%[A-Za-z0-9_],%[0-9xXA-Fa-f],%d",name,val,&type)>=2 ||
+ sscanf(line,"%[A-Za-z0-9_] %[0-9xXA-Fa-f] %d",name,val,&type)>=2){
+
for(i=0;name[i];i++)
name[i]=tolower(name[i]);
n=add_str((const unsigned char *) name);
@@ -1501,7 +1502,7 @@ static void read_constdb(void)
str_data[n].type=C_INT;
else
str_data[n].type=C_PARAM;
- str_data[n].val=val;
+ str_data[n].val= (int)strtol(val,NULL,0);
}
}
fclose(fp);