Jump to content

Remove Hook


xtreampb
 Share

Recommended Posts

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?

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!

Link to comment
Share on other sites

@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

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!

Link to comment
Share on other sites

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

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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...