Results are documented in attached picture
Trade ships ask DistanceTo nearest starport and then
decide if hyperspace or reach starport
try to kill a trade ship: you could use attached save game
Pioneer version: January 2017, on Linux/Ubuntu x86_64
@mike-f1 This will solve the problem.
@@ -786,7 +786,7 @@
if trader.no_jump ~= true then
if #starports == 0 then
trader['no_jump'] = true -- it already tried in onEnterSystem
- elseif Engine.rand:Number(1) < trader.chance then
+ elseif trader.starport and Engine.rand:Number(1) < trader.chance then
local distance = ship:DistanceTo(trader.starport)
if distance > 149598000 * (2 - trader.chance) then -- 149,598,000km = 1AU
if getSystemAndJump(ship) then
@walterar It work! :) ...this needs to be pushed in master I think
@walterar , do you want me to open a new PR for this?
@mike-f1 Yes, do it yourself, I do not get along with github, excuse me.
Ok, this needs to remains open because we don't know exactly what it happens...
Needs further investigations