Page 1 of 1

Planetfall bug or feature?

Posted: Fri Aug 28, 2009 2:41 am
by wackyman465
It appears I can land on the sun. I didn't try but I got the landing clearance message while sunskimming...

Posted: Fri Aug 28, 2009 6:33 am
by Thargoid
It's a bug if it happens, although there is (or at least should be) code in place to recognise the sun and suppress the message.

What Oolite version, OS and and Planetfall version are you running?

Posted: Fri Aug 28, 2009 3:53 pm
by wackyman465
trunk, OSX 10.5.8, planetfall 1.12

Posted: Fri Aug 28, 2009 3:59 pm
by Thargoid
Try 1.2 that I uploaded yesterday, that works better with 1.73.

I checked the code and there are checks for !isSun before all communications, so it may possibly be something broken in trunk, as it doesn't do this on 1.72.2 on my machine. I will check on 1.73 when I get some time.

As a side-note, please indicate you're using trunk when reporting possible OXP bugs - it sometimes can save a lot of hassle when the problem is in the trunk rather than the OXP.

Posted: Fri Aug 28, 2009 4:04 pm
by Eric Walch
Thargoid wrote:
It's a bug if it happens, although there is (or at least should be) code in place to recognise the sun and suppress the message.

What Oolite version, OS and and Planetfall version are you running?
I think it is your check:

Code: Select all

if(!planet.isSun && !planet.hasOwnProperty("solarGasGiant"))
You probably mend:

Code: Select all

if(!(planet.isSun || planet.hasOwnProperty("solarGasGiant")))
You nowhere in your code define solarGasGiant so currently the check always fails.

Posted: Fri Aug 28, 2009 4:32 pm
by Thargoid
If planet is a regular planet:

if(!planet.isSun && !planet.hasOwnProperty("solarGasGiant")) = true [if (!false && !false) = if (true && true) = if (true)]

if planet is a sun:

if(!planet.isSun && !planet.hasOwnProperty("solarGasGiant")) = false [if (!true && !false) = if (false && true) = if (false) ]

if planet is a gas giant:

if(!planet.isSun && !planet.hasOwnProperty("solarGasGiant")) = false [if (!false && !true) = if (true && false) = if (false) ]

if planet is a gas giant sun:

if(!planet.isSun && !planet.hasOwnProperty("solarGasGiant")) = false [(if !true && !true) = if (false && false) = if (false) ]

I think if you work out the logic the two statements above are actually the same, although yours is clearer than mine.


Posted: Fri Aug 28, 2009 4:40 pm
by Eric Walch
Thargoid wrote:
I think if you work out the logic the two statements above are actually the same, although yours is clearer than mine.
After writing it down I already had my doubts.You are right, they are the same. I was probably to convinced the cause must lie in this line.

Posted: Fri Aug 28, 2009 7:09 pm
by Thargoid
Just tested isSun (working correctly), and also Planetfall 1.2 (also working correctly under WinXP).

So can you describe in exact detail how you got your problem to occur Wacky?

Posted: Fri Aug 28, 2009 9:08 pm
by wackyman465
Erm flew way to close to the sun while skimming as I was carrying 50 tc of narcotics on a transport mission.

Posted: Sat Aug 29, 2009 7:14 am
by Thargoid
I was meaning which system you were in, whether you have any system modifying OXPs (system redux, orbits, farsun etc) in place and *ahem* useful things like that.

I can't replicate your problem on my trunk WinXP using PF 1.2 (and the sun test code hasn't changed there from 1.12), and neither can Eric on his Mac as he kindly tested it for me as a back-up that it wasn't a Mac thing.

Posted: Sat Aug 29, 2009 7:57 am
by wackyman465
Um I forget what system it was in, but it's happened in a few, and I am using system redux but not farsun.