API Question Get Vessel Type

n72.75

Seize the means of computation
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,872
Reaction score
1,714
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
If I wanted to check whether or not each vessel in a simulation was a Deltaglider (or any other type), what's the proper way to do it?

Code:
for (int i = 0; i < oapiGetVesselCount(); i++)
{
    OBJHANDLE hVessel = oapiGetVesselByIndex(i);
    //if(????)
    {

    }
}
 
Code:
VESSEL* pVessel = oapiGetVesselInterface( hVessel );
if (!_strnicmp( pVessel->GetClassName(), "DeltaGlider", 11 ))...

You should check if the DG class is exactly "DeltaGlider".
 
Last edited:
Back
Top