If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
disanti
Posts: 367 Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:
Post
by disanti » Mon Apr 12, 2004 5:51 am
Code: Select all
//ENEMIES
else if (irr::core::stringw("enemy") == xml->getNodeName())
{
number_baddies++;
//load the baddie
irr::scene::IAnimatedMesh* baddiemesh = 0;
irr::core::stringc file = xml->getAttributeValue(L"file");
baddiemesh = gProc.smgr->getMesh(file.c_str());
if(baddiemesh)
baddies[number_baddies] = gProc.smgr->addOctTreeSceneNode(baddiemesh->getMesh(0)); <- CRASH!!!
baddies[number_baddies]->setPosition(irr::core::vector3df(
xml->getAttributeValueAsInt(L"x"),
xml->getAttributeValueAsInt(L"y"),
xml->getAttributeValueAsInt(L"z")));
//load AI
file = xml->getAttributeValue(L"aiscript");
baddies_AI[number_baddies].Init(file.c_str(), gProc, &droid);
}
Funny... this code crashes when it is in a debug configuration... but it doesn't crash with a release configuration! WHAT IS GOING ON???
________
Hawaii dispensary
Last edited by
disanti on Tue Feb 22, 2011 8:06 am, edited 1 time in total.
niko
Site Admin
Posts: 1759 Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:
Post
by niko » Mon Apr 12, 2004 10:14 am
I just had a short look at that code, but I think it is difficult to say from that part of your code. Seems that you did not initialise some variables. Just check all initialisations.
disanti
Posts: 367 Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:
Post
by disanti » Mon Apr 12, 2004 3:43 pm
I have all of those variables as Private Members of the class that code is in.
Code: Select all
int number_baddies;
AI_Reader baddies_AI[96];
irr::scene::ISceneNode* baddies[96];
I know it isn't very optimized either!
________
Ipod games