Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
Although it looks pretty nice, I really hate hex grids :p
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
11-10-2013, 07:56 AM
(This post was last modified: 11-10-2013, 08:01 AM by NiLSPACE.)
How can I create an callback function that I can use in C++ for the cWorld::ForEachEntity function?
Posts: 254
Threads: 16
Joined: Oct 2013
Thanks: 3
Given 20 thank(s) in 18 post(s)
11-10-2013, 08:30 AM
(This post was last modified: 11-10-2013, 08:31 AM by SamJBarney.)
It looks like you would have to subclass cEntityCallback and override the Item function. Its based on the template class located in Globals.h at line 210 or so.
The Item member function is the main and only entry into the class. It gets passed a pointer to the entity it will work on.
At least that what I see from browsing over the code momentarily.
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
How can i convert an cPlayer to a *cEntity in C++?
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
Why would you want to do that? That doesn't make any sense to me :o
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
I'm now working on wolves, and I had an idea for plugins where wolfs can get an different Entity as owner. For example a wolf has an zombie as owner. But the OnRightClicked function only gives an cPlayer object so I have to convert it into a cEntity to make it work.