xtreampb Posted June 18, 2013 Posted June 18, 2013 So i my code i am registering a collision hook like this this->Full->AddHook(Entity::CollisionHook, (void*)CSColl); this works fine. in this collision hook when a certain statement is true i remove this hook like this this->Full->RemoveHook(Entity::CollisionHook, (void*)CSColl); my problem is that this remove hook throws a runtime error. am i doing this right? Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post!
AggrorJorn Posted June 18, 2013 Posted June 18, 2013 Is the void cast necessary? Have you tried using just CSColl? Quote
ZioRed Posted June 18, 2013 Posted June 18, 2013 I don't know why, but on the documentation it says "expect an error when you run this", don't know why or if it matters your issue. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com
xtreampb Posted June 19, 2013 Author Posted June 19, 2013 @Aggror i've tried with out the void pointer cast and it throws compiler errors just like if i didn't do the void pointer cast when I add the hood. @ZioRed thanks for that I didn't even see the warning in the comments Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post!
ZioRed Posted June 19, 2013 Posted June 19, 2013 A function that is expected to raise an exception when it's called is definitely superb! I hope the doc is wrong and it's NOT expected to raise exceptions, once that you'll discover how to use, else I wonder what should be its utility. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com
xtreampb Posted June 19, 2013 Author Posted June 19, 2013 no it raises errors...i've been trying to use it to remove a collision hook as shown above. How are we supposed to use it @Josh Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.