Jump to content
  • 0
Sign in to follow this  
apuadofrancisco

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

Question

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

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

first error:

 

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

2nd:

            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); 

 

Share this post


Link to post
Share on other sites
  • 0

@@Gerz

Ill try to debug this first :D 

 

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
Edited by apuadofrancisco

Share this post


Link to post
Share on other sites
  • 0

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..

 

 

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

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.