diff --git a/Resources/Scripts/oolite-priorityai.js b/Resources/Scripts/oolite-priorityai.js index dba8242c..7053c2fc 100644 --- a/Resources/Scripts/oolite-priorityai.js +++ b/Resources/Scripts/oolite-priorityai.js @@ -332,6 +332,11 @@ this.PriorityAIController = function(ship) this.communicate = function(key,params,priority) { + if (!worldScripts["oolite-libPriorityAI"].$commsAllowed) + { + // comms temporarily disabled + return; + } if (priority > 1) { var send = clock.adjustedSeconds - lastCommSent; @@ -6173,6 +6178,7 @@ this.startUp = function() { // initial definition is just essential communications for now this.$commsSettings = {}; + this.$commsAllowed = true; this._setCommunications({ generic: { generic: { @@ -6241,6 +6247,19 @@ this.startUp = function() +/* Event handler pair to prevent comms from being received while in + * witchspace tunnel */ +this.shipWillEnterWitchspace = function() +{ + this.$commsAllowed = false; +} + +this.shipExitedWitchspace = function() +{ + this.$commsAllowed = true; +} + + /* Search through communications from most specific to least specific. * role+personality