From 0d66f33809faebf82c507ea68d3dbefab852e307 Mon Sep 17 00:00:00 2001 From: cim Date: Thu, 12 Dec 2013 20:56:39 +0000 Subject: [PATCH] Make attacks on cargo, buoys, etc. less likely --- Resources/Scripts/oolite-priorityai.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Resources/Scripts/oolite-priorityai.js b/Resources/Scripts/oolite-priorityai.js index efc701cd..9da08bb2 100644 --- a/Resources/Scripts/oolite-priorityai.js +++ b/Resources/Scripts/oolite-priorityai.js @@ -2036,7 +2036,7 @@ PriorityAIController.prototype.conditionScannerContainsFineableOffender = functi PriorityAIController.prototype.conditionScannerContainsFugitive = function() { return this.checkScannerWithPredicate(function(s) { - return s.isInSpace && s.bounty > 50 && s.scanClass != "CLASS_CARGO" && s.scanClass != "CLASS_ROCK"; + return s.isInSpace && s.bounty > 50 && s.scanClass != "CLASS_CARGO" && s.scanClass != "CLASS_ROCK" && s.scanClass != "CLASS_BUOY"; }); } @@ -2044,7 +2044,7 @@ PriorityAIController.prototype.conditionScannerContainsHuntableOffender = functi { return this.checkScannerWithPredicate(function(s) { var threshold = this.fineThreshold() / 2; - return s.isInSpace && s.bounty > threshold && s.scanClass != "CLASS_CARGO" && s.scanClass != "CLASS_ROCK"; + return s.isInSpace && s.bounty > threshold && s.scanClass != "CLASS_CARGO" && s.scanClass != "CLASS_ROCK" && s.scanClass != "CLASS_BUOY"; }); } @@ -2053,7 +2053,7 @@ PriorityAIController.prototype.conditionScannerContainsSeriousOffender = functio { return this.checkScannerWithPredicate(function(s) { var threshold = this.fineThreshold(); - return s.isInSpace && s.bounty > threshold && s.scanClass != "CLASS_CARGO" && s.scanClass != "CLASS_ROCK"; + return s.isInSpace && s.bounty > threshold && s.scanClass != "CLASS_CARGO" && s.scanClass != "CLASS_ROCK" && s.scanClass != "CLASS_BUOY"; }); } @@ -3657,8 +3657,9 @@ PriorityAIController.prototype.configurationAcquireCombatTarget = function() this.ship.removeDefenseTarget(target); this.ship.target = null; } - if (target && target.scanClass == "CLASS_CARGO") + if (target && (target.scanClass == "CLASS_CARGO" || target.scanClass == "CLASS_BUOY")) { + this.ship.removeDefenseTarget(target); this.ship.target = null; } /* Iff the ship does not currently have a target, select a new one