[Help] Lilith - Extra bonuses(from rA -> Herc)

apuadofrancisco

New member
Messages
67
Points
0
Location
Philippines
Github
apuadofrancisco
Emulator
2>..srcmapitemdb.c(948): warning C4013: 'parse_script' undefined; assuming extern returning int
2>..srcmapitemdb.c(948): warning C4047: '=' : 'script_code *' differs in levels of indirection from 'int'
 
 static int itemdb_readbonus(void)
{
char* filename = "extra_bonuses.txt";
uint32 lines = 0, count = 1;
char line[1024], path[256];
FILE* fp;

sprintf(path, "%s/%s", map->db_path, filename);
fp = fopen(path, "r");
if( fp == NULL )
{
ShowWarning("itemdb_readbonus: File not found "%s", skipping.n", path);
return 0;
}

while(fgets(line, sizeof(line), fp))
{
char *str, *p;
lines++;
if(line[0] == '/' && line[1] == '/')
continue;
str = "0";
p = line;
while( ISSPACE(*p) )
++p;
if( *p == '0' )
continue;
if( *p != '{' )
{
ShowError("itemdb_readbonus: Invalid format in line %d of "%s", skipping.n", lines, path);
continue;
}
str = p;
p = strstr(p+1,"}");
if ( strchr(p,',') != NULL )
{
ShowError("itemdb_readbonus: Extra columns in line %d of "%s", skipping.n", lines, path);
continue;
}
extra_bonus[count].script = parse_script(str, path, lines, 0);
count++;
}

fclose(fp);

ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.n", count-1, filename);
 
return 0;
}
and this....

2>..srcmapstatus.c(2245): warning C4047: 'function' : 'int64' differs in levels of indirection from 'char [12]'
4>  core.c
2>..srcmapstatus.c(2245): warning C4024: 'function through pointer' : different types for formal and actual parameter 2
2>..srcmapstatus.c(2245): warning C4047: 'function' : 'int64' differs in levels of indirection from 'char [12]'
2>..srcmapstatus.c(2245): warning C4024: 'function through pointer' : different types for formal and actual parameter 2
2>..srcmapstatus.c(2246): warning C4013: 'run_script' undefined; assuming extern returning int
2>..srcmapstatus.c(2246): warning C4047: 'function' : 'int64' differs in levels of indirection from 'char [12]'
2>..srcmapstatus.c(2246): warning C4024: 'function through pointer' : different types for formal and actual parameter 2
 
 if(battle_config.enable_extra_bonus){
if(battle_config.enable_extra_bonus == 2){
if(pc_readglobalreg(sd,"extra_bonus") && extra_bonus[pc_readglobalreg(sd,"extra_bonus")].script)
run_script(extra_bonus[pc_readglobalreg(sd,"extra_bonus")].script,0,sd->bl.id,0);
if (!calculating)
return 1;
} else {
for(i=1;i<ARRAYLENGTH(extra_bonus);i++) {
if(extra_bonus.script)
run_script(extra_bonus.script,0,sd->bl.id,0);
if (!calculating)
return 1;
}
}
}
 

 

The red lines are the one stated in warning compilation... 

 

Thank you


 

 
first error:

extra_bonus[count].script = script->parse(str, path, lines, 0, NULL); 
2nd:

Code:
            if(pc_readglobalreg(sd,script->add_str("extra_bonus")) && extra_bonus[pc_readglobalreg(sd,script->add_str("extra_bonus"))].script)               script->run(extra_bonus[pc_readglobalreg(sd,script->add_str("extra_bonus"))].script,0,sd->bl.id,0); 
 
@@Gerz

Ill try to debug this first
default_biggrin.png
 

First error:

2>..srcmapitemdb.c(948): error C2065: 'parse' : undeclared identifier
2>..srcmapitemdb.c(948): error C2223: left of '->script' must point to struct/union

Second error:

 2>..srcmapstatus.c(2244): warning C4047: '==' : 'int' differs in levels of indirection from 'char [2]'
2>..srcmapstatus.c(2252): warning C4013: 'run_script' undefined; assuming extern returning int
 
Last edited by a moderator:
first error check again your full code, it's not my fault

second, not my fault again... it's another error in lower red line code

fix..

Code:
                if(extra_bonus[i].script)                    script->run(extra_bonus[i].script,0,sd->bl.id,0); 
 
Back
Top