Fix issues with system ID 0 in trader AIs

This commit is contained in:
cim 2015-04-24 17:53:26 +01:00
parent 9153f5b968
commit 408f8ce19d

View File

@ -2501,14 +2501,14 @@ PriorityAIController.prototype.conditionCargoIsProfitableHere = function()
{ {
// cargo is always considered profitable in the designated // cargo is always considered profitable in the designated
// destination system (assume they have a prepared buyer) // destination system (assume they have a prepared buyer)
if (this.ship.destinationSystem && this.ship.destinationSystem == system.ID) if (this.ship.destinationSystem > -1 && this.ship.destinationSystem == system.ID)
{ {
return true; return true;
} }
// cargo is never considered profitable in the designated source // cargo is never considered profitable in the designated source
// system (or you could get ships launching and immediately // system (or you could get ships launching and immediately
// redocking) // redocking)
if (this.ship.homeSystem && this.ship.homeSystem == system.ID) if (this.ship.homeSystem > -1 && this.ship.homeSystem == system.ID)
{ {
return false; return false;
} }