When a trader-courier or trader-smuggler is created, it runs the
this._nearbySystem
function to determine what the home system and destination system will be for the ship. It passes a "range" parameter to this function, but "range" is never used in the function. So, regardless of whether "7" or "25" is passed to the function (at lines 1435, 1441, 1457, 1464, 1466, 1493, 1498) it will only ever return a system ID that is in range, as the $populatorLocals
variable is always set to system.info.systemsInRange();
Is my logic correct here?
I think the _nearbySystem function should actually look like this:
Code: Select all
this._nearbySystem = function(range)
{
if (range != 7)
{
var poss = system.info.systemsInRange(range);
}
else
{
var poss = this.$populatorLocals;
}
if (poss.length == 0)
{
return system.ID;
}
return poss[Math.floor(Math.random()*poss.length)].systemID;
}