le funzioni interessate sono le seguenti:
void NPG::decodifica(const char* file,short int x,short int y)
{
INI info;
string temp;
NPG::x = x;
NPG::y = y;
info.carica(file);
if(info.StringGetValue("Main","Type") == "NPG")
{
NPG::head = info.IntGetValue("Main","Head");
NPG::armatura = info.IntGetValue("Main","Body");
NPG::name = info.StringGetValue("Info","name");
NPG::lvl =info.IntGetValue("Info","lvl");
NPG::exp =info.IntGetValue("Info","exp");
NPG::vit = info.IntGetValue("Info","vit");
NPG::inte = info.IntGetValue("Info","int");
NPG::vel = info.IntGetValue("Info","vel");
NPG::str =info.IntGetValue("Info","str");
NPG::rex =info.IntGetValue("Info","rex");
temp = info.StringGetValue("Dialog","Event");
if(temp == "ON")
{
NPG::dialogo.talk(true);
}
else if(temp == "OFF")
{
NPG::dialogo.talk(false);
}
}
cout<<"fine dec(funz)\n";
}
void STORY::decodifica_msty(const char* msty)
{
INI file_msty;
string temp,npg;
int tx,ty;//temp x,temp y
file_msty.carica(msty);
if(file_msty.StringGetValue("Main","Type") == "MSTY")
{
num_npg = file_msty.IntGetValue("Main","NumeroNPG");
np = new NPG[num_npg];
for(int i=0;i<num_npg;i++)
{
temp = "NPG";
temp.append(STORY::int_to_str(i+1));
npg = file_msty.StringGetValue(temp.c_str(),"npg");
tx = file_msty.IntGetValue(temp.c_str(),"x");
ty = file_msty.IntGetValue(temp.c_str(),"y");
np[i].decodifica(npg.c_str(),tx,ty);
cout<<"fine dec\n";
}
}
}
void STORY::decodifica_story(const char* file)
{
INI fstoria;
string temp;
int k;
fstoria.carica(file);
if(fstoria.StringGetValue("Main","Type") == "STORY")
{
num_map = fstoria.IntGetValue("Main","MapSty");
map = new string[num_map];
for(int i=0; i<num_map;i++)
{
temp = "Map";
temp.append(STORY::int_to_str(i+1));
map[i] = fstoria.StringGetValue("Map",temp.c_str());
}
k = fstoria.IntGetValue("Main","MapIn");
decodifica_msty(map[k-1].c_str());
cout<<"fine\n";
}
}
ad esempio io ora riesco solo a vedere sul prompt "fine dec(funz)\n" e finisce l'esecuzione, ma la stessa cosa capita se evito di chiamare la 1°funzione nella seconda, cioè riesco a vedere sul prompt "fine" e finisce l'esecuzione del programma e anche la terza infine se non chiamo la seconda è lo stesso, cioè mi fa vedere anche qui "fine" nel prompt ma finisce l'esecuzione; quando poi dopo la chiamata della 3° funzione ci sono molte altre istruzioni.
PS: non mi da nessun errore termina semplicemente e per questo è anche un po strano