Page 3 of 3

Re: Bug produced by trunk + Randomhits

Posted: Mon May 23, 2011 7:37 am
by Eric Walch
maik wrote:
I just ran into this as well (on a certainly fast enough computer). Relevant log excerpt:
Yes, it seems that the code was not interrupted because of the speed, but because of an error.

I just wonder why that command returned 'null'. I anticipated that there would always be a solution. It happens in the selection of a suitable system. I filter a list with all systems were "government < 6" and "range > 5" and "range < 33". I assumed there will always be such a system. Did you find a super safe area in the galaxy, or missed I an other rare exception.

I probably have to add an extra test and create a "no hit mission available" page.

If this is the reason, than it is system specific. In what system/galaxy did this happen, so I can test this further.

Re: Bug produced by trunk + Randomhits

Posted: Mon May 23, 2011 11:57 am
by maik
I'm in galaxy 7. The weird thing is it already did work prior to yesterday. I thought the same that it could be dependent on the system where I am so I flew to two other anarchies but encountered the same behaviour. I'm away from home for this week so can't tell you the name of the system where I am, but maybe the position that is written in my log excerpt helps you. The other two anarchies are close by.

Re: Bug produced by trunk + Randomhits

Posted: Mon May 23, 2011 1:13 pm
by Commander McLane
I'd suppose you're close to the great rift, possibly on the wrong side.

Re: Bug produced by trunk + Randomhits

Posted: Mon May 23, 2011 1:23 pm
by maik
Commander McLane wrote:
I'd suppose you're close to the great rift, possibly on the wrong side.
From memory about in the middle of the map (horizontally), a bit to the left of what probably is the great rift, and about 3/4th down from the top...

Edit: I just looked at the vector map and found the systems: Usxela, Esreates, and Esrire.

Re: Bug produced by trunk + Randomhits

Posted: Mon May 23, 2011 2:11 pm
by Eric Walch
maik wrote:
Edit: I just looked at the vector map and found the systems: Usxela, Esreates, and Esrire.
Thanks for looking up. I just tried docking at the bar in Usxela and got the same result as you. So, it is very likely system specific. I'll add a few additional checks to the code. I suspect it can't find a suitable system in the given range. I can create a greater range in those cases, but easier will probably be to say that there is no hit available. I'll see what I come up with.

Re: Bug produced by trunk + Randomhits

Posted: Mon May 23, 2011 2:17 pm
by maik
Thanks!

Re: Bug produced by trunk + Randomhits

Posted: Mon May 23, 2011 2:44 pm
by Eric Walch
It seems not that there is no system found. Looking in the code I already anticipated that. In that case it selects the current system. I logged the number of suitable target systems. There were enough for all the 3 missions:

Code: Select all

[Random_Hits] OOJSGlobal.m:247: Number of target systems: 38
[Random_Hits] OOJSGlobal.m:247: Number of target systems: 47
[Random_Hits] OOJSGlobal.m:247: Number of target systems: 62
The problem was in System.infoForSystem().routeToSystem(). Apparently this has changed between 1.74 and 1.75. If the route to an isolated system was calculated, 1.74 returned an object but with the distance property null. It seems that 1.75 now returns null for such a route.

I thought I explicit tested this with trunk to see if this behavior was unchanged with the new JS implementation. Or I missed something, or there was another change in trunk after my tests.

Anyhow, I now have a working script that deals with this situation.