GetClassName

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
Not really a bug, but a problem that causes a lot of grief sometimes. The method of VESSEL class GetClassName returns NULL when a vessel doesn't have a class name. This has caused me a lot of headaches because you normally don't expect for a function that returns a string to return NULL. It would be appreciated if instead of the classname, this function returns the vessel name for the vessels without a class.
 

Bj

Addon Developer
Addon Developer
Donator
Joined
Oct 16, 2007
Messages
1,886
Reaction score
11
Points
0
Location
USA-WA
Website
www.orbiter-forum.com
Not really a bug, but a problem that causes a lot of grief sometimes. The method of VESSEL class GetClassName returns NULL when a vessel doesn't have a class name. This has caused me a lot of headaches because you normally don't expect for a function that returns a string to return NULL. It would be appreciated if instead of the classname, this function returns the vessel name for the vessels without a class.


it sounds like its the programming of the orbiter sim itself, you can send a message to Martin if their is no workaround :)

:cheers:
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
I have had a conversation with Martin about this very thing before. He said that he would make the function return the vessel name if there is no classname in the next orbiter beta. I'll make a test module and build it against the latest orbiter beta to see if the change has been made. There is a very easy workaround for this problem, except you sometimes forget to implement it because of the nature of the problem. Take my spotlight add-on for example. It checks if a certain vessel is made up of spacecraft3.dll. The function isSpacecraft has to get the classname of the vessel being scanned. I forget to check if the return value of GetClassName was NULL, and MIR was in the scenario, so orbiter kept crashing, and I had no idea where the bug resided.
 
Top