Code: Select all
Warning (strict mode): reference to undefined property ship.missiles[i].primaryRole
Active script: oolite-populator 1.89
oolite-populator.js, line 2306:
if (ship.missiles[i].primaryRole == "EQ_MISSILE" && chance < Math.random())
Code: Select all
Warning (strict mode): reference to undefined property market[commodity].marketMaskPrice
Active script: Oolite Trader AI 1.89
oolite-priorityai.js, line 2543:
var adjust = market[commodity].marketEcoAdjustPrice * multiplier * quantity / market[commodity].marketMaskPrice;
Warning (strict mode): reference to undefined property market[commodity].marketEcoAdjustPrice
Active script: Oolite Trader AI 1.89
oolite-priorityai.js, line 2543:
var adjust = market[commodity].marketEcoAdjustPrice * multiplier * quantity / market[commodity].marketMaskPrice;
I think it could be fixed by enclosing lines 2543 and 2544 in an if block like this:
Code: Select all
if (market[commodity].marketEcoAdjustPrice && market[commodity].marketMaskPrice) // defined and non-zero (for division)
{
var adjust = market[commodity].marketEcoAdjustPrice * multiplier * quantity / market[commodity].marketMaskPrice;
profit += adjust;
}
Code: Select all
Warning (strict mode): reference to undefined property this.__ltcache.oolite_homeStation
Active script: YAH patrol AI 4.5.1
oolite-priorityai.js, line 903:
if (this.__ltcache.oolite_homeStation === null)
Code: Select all
PriorityAIController.prototype.homeStation = function()
{
if (this.__ltcache.oolite_homeStation !== undefined)
{
if (this.__ltcache.oolite_homeStation === null)
{
return null;
}
if (this.__ltcache.oolite_homeStation.isValid)
{
return this.__ltcache.oolite_homeStation;
}
}
// home station has not been assigned yet (property undefined)
// home station might be the owner of the ship, or might just
// be a group member
if (this.ship.owner && this.ship.owner.isStation && this.friendlyStation(this.ship.owner))
{
this.__ltcache.oolite_homeStation = this.ship.owner;
return this.ship.owner;
}
if (this.ship.group)
{
var gs = this.ship.group.ships;
for (var i = gs.length-1 ; i >= 0 ; i--)
{
if (gs[i] != this.ship && gs[i].isStation && this.friendlyStation(gs[i]))
{
this.__ltcache.oolite_homeStation = gs[i];
return gs[i];
}
}
}
this.__ltcache.oolite_homeStation = null;
return null;
}
Code: Select all
Warning (strict mode): reference to undefined property this.ship.group.leader.AIScript.oolite_intership.cargodemanded
Active script: Oolite Pirate AI 1.89
oolite-priorityai.js, line 2039:
if (this.ship.group.leader && this.ship.group.leader.AIScript.oolite_intership && this.ship.group.leader.AIScript.oolite_intership.cargodemanded > 0)
Warning (strict mode): reference to undefined property this.ship.group.ships[0].AIScript.oolite_intership.cargodemanded
Active script: Oolite Pirate AI 1.89
oolite-priorityai.js, line 2048:
else if (this.ship.group.ships[0].AIScript.oolite_intership && this.ship.group.ships[0].AIScript.oolite_intership.cargodemanded > 0)
if (this.ship.group.leader && this.ship.group.leader.AIScript.oolite_intership && (this.ship.group.leader.AIScript.oolite_intership.cargodemanded || 0) > 0)
With this, if this.ship.group.leader.AIScript.oolite_intership.cargodemanded is undefined, the || 0 replaces it with zero. The result of 0 > 0 is false. undefined > 0 also is false, but also triggers a warning.