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.
RiChArD_fLoOd
Posts: 11 Joined: Fri Sep 23, 2005 10:32 pm
Location: UK, England, Stockport
Post
by RiChArD_fLoOd » Fri Sep 23, 2005 10:43 pm
hi when i have the code
node->remove()
in my game when i check to see if it has no life but the problem is it checks it every loop so it tries to remove it more than once but it doesnt exists once its been destroyed and crashs the game, plz can any1 help
sudi
Posts: 1686 Joined: Fri Aug 26, 2005 8:38 pm
Post
by sudi » Fri Sep 23, 2005 11:13 pm
simply check if the node exists before u check life....that should be enough
or use a list
RiChArD_fLoOd
Posts: 11 Joined: Fri Sep 23, 2005 10:32 pm
Location: UK, England, Stockport
Post
by RiChArD_fLoOd » Sat Sep 24, 2005 10:12 am
thanks but i was wonderin how to check if it exists
Guest
Post
by Guest » Sat Sep 24, 2005 10:36 am
check it doesn't == null/0
if(node)
node->remove().
pfo
Posts: 370 Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1
Post
by pfo » Sat Sep 24, 2005 8:52 pm
make sure to set the node pointer to NULL after its removed, that way if it tries to remove again, and it's already NULL, it won't.
RiChArD_fLoOd
Posts: 11 Joined: Fri Sep 23, 2005 10:32 pm
Location: UK, England, Stockport
Post
by RiChArD_fLoOd » Sun Sep 25, 2005 10:49 am
cheers people just what i needed, i feel like a right n00b but i guess im learnin tho