SDK Question planet or moon oapi?

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,664
Reaction score
115
Points
78
Hi all,

I looked in the api docs but couldn't find any api that tells automatically if the reference planet is an actual planet or a moon of another planet.

I'll see if there is a way to find it out anyway, but it could be a good to have.

:cheers:
Fred
 
Last edited:
I looked in the api docs but couldn't find any api that tells automatically if the reference planet is an actual planet or a moon of another planet.

In OMP, I ended up parsing the solar system configuration file.
 
Thanks guys,

I just did this, it works!

Code:
bool RadioProc::IsMoon(OBJHANDLE hplanet)
{
	CELBODY *cb;
	cb=oapiGetCelbodyInterface(hplanet);
	int Version=cb->Version();
	if(Version==2)
	{
		OBJHANDLE h_sun=((CELBODY2*)cb)->GetParent();
		CELBODY *cbsun;
		cbsun=oapiGetCelbodyInterface(h_sun);
		int Version_sun=cbsun->Version();
		if(Version_sun==2)
		{
			OBJHANDLE h_null=((CELBODY2*)cbsun)->GetParent();
			if(h_null!=NULL)
			{
				return TRUE;
			}
		}
	}
	return FALSE;
}
 
Back
Top