- Added support for hexadecimal values in the const.txt file.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8321 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
1079f53d4c
commit
00f4aecb26
@ -78,8 +78,8 @@ Job_Star_Gladiator 4047
|
|||||||
Job_Star_Gladiator2 4048
|
Job_Star_Gladiator2 4048
|
||||||
Job_Soul_Linker 4049
|
Job_Soul_Linker 4049
|
||||||
|
|
||||||
Option_Wedding 4096
|
Option_Wedding 0x1000
|
||||||
Option_Xmas 131072
|
Option_Xmas 0x20000
|
||||||
|
|
||||||
bc_all 0
|
bc_all 0
|
||||||
bc_map 1
|
bc_map 1
|
||||||
|
@ -1479,8 +1479,8 @@ static void add_buildin_func(void)
|
|||||||
static void read_constdb(void)
|
static void read_constdb(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char line[1024],name[1024];
|
char line[1024],name[1024],val[1024];
|
||||||
int val,n,i,type;
|
int n,i,type;
|
||||||
|
|
||||||
sprintf(line, "%s/const.txt", db_path);
|
sprintf(line, "%s/const.txt", db_path);
|
||||||
fp=fopen(line, "r");
|
fp=fopen(line, "r");
|
||||||
@ -1492,8 +1492,9 @@ static void read_constdb(void)
|
|||||||
if(line[0]=='/' && line[1]=='/')
|
if(line[0]=='/' && line[1]=='/')
|
||||||
continue;
|
continue;
|
||||||
type=0;
|
type=0;
|
||||||
if(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_] %d %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++)
|
for(i=0;name[i];i++)
|
||||||
name[i]=tolower(name[i]);
|
name[i]=tolower(name[i]);
|
||||||
n=add_str((const unsigned char *) name);
|
n=add_str((const unsigned char *) name);
|
||||||
@ -1501,7 +1502,7 @@ static void read_constdb(void)
|
|||||||
str_data[n].type=C_INT;
|
str_data[n].type=C_INT;
|
||||||
else
|
else
|
||||||
str_data[n].type=C_PARAM;
|
str_data[n].type=C_PARAM;
|
||||||
str_data[n].val=val;
|
str_data[n].val= (int)strtol(val,NULL,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user