Checkin if a scenenode exists

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.
Post Reply
RiChArD_fLoOd
Posts: 11
Joined: Fri Sep 23, 2005 10:32 pm
Location: UK, England, Stockport

Checkin if a scenenode exists

Post by RiChArD_fLoOd »

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 »

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 »

thanks but i was wonderin how to check if it exists
Guest

Post by Guest »

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 »

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 »

cheers people just what i needed, i feel like a right n00b but i guess im learnin tho :)
Post Reply