Ok for some reason this code is crashing while I am loading the path for the pics in no idea why really... I do know all the functions for the NPC class work I tested those first thing... I just don't see any reason it should crash while reading art/man.bmp into a 250 char array or that is where it is crashing apparently. Ideas on what might be causing this problem?
Code:
char input[250];
ofstream feed;
ifstream load;
Code:
load>>NumNPC;
feed<<"NUM NPC: "<<NumNPC<<endl;
npclist = new NPC*[NumNPC];
int nx,ny,sn;
for(int lnpc = 0;lnpc < NumNPC;lnpc++)
{
load>>nx>>ny>>sn;
feed<<"NX NY SN "<<nx<<" "<<ny<<" "<<sn<<endl;
npclist[lnpc]->SetXYSN(nx,ny,sn);
load>>input;//crashes here
feed<<"IGPIC: "<<input;
npclist[lnpc]->SetIGPic(input);
load>>input;
feed<<"DIAPIC: "<<input;
npclist[lnpc]->SetDialoguePic(input);
}
feed.close();
Part of the load file where the problem is occuring.
Code:
#NPC 2
5 5 0 art/man.bmp art/ness_t.bmp
9 9 1 art/woman.bmp art/darokin.bmp
#ENDNPC
The feedback file I have it dumping into.
Code:
NUM NPC: 2
NX NY SN 5 5 0
Bah stupid me left a line out since I was using a NPC ** I forgot to make the loop sorry about that. Here is what I was missing.
Code:
load>>NumNPC;
feed<<"NUM NPC: "<<NumNPC<<endl;
npclist = new NPC*[NumNPC];
for(int m=0;m<NumNPC;m++)
{
npclist[m] = new NPC;
}
int nx,ny,sn;