ppDisplayableObjects is an array or base pointers, right? so try this?
const ThreeDCubePlayer* const cubePlayer = m_ppDisplayableObjects[0]; char mapEntry = GetMapEntry( cubePlayer->GetMapX(), cubePlayer->GetMapY() );
GetMapX etc. should return (unsigned) int? and not a pointer to int? (no negs? so unsigned?)
I would like all other comments on casting to be added, they are a sign that your hierarchy is not working correctly, but ... but if you need to quit, then think about which C ++ casting you will need for Using this is a useful exercise, it also means that if you want to revise / tighten your code, all throws are easier to search and delete.
ps - create your constant where you can and add arrays, etc. to some kind of owner class, possibly singleton, if you know that you only have
also IMHO ... (sorry) write yourself a Coords class so you can do something like GetMapEntry (const Coords and coords) instead of getting the x and y values separately, it will save you when you exchange them the wrong way and etc. :)
source share