diff --git a/Gruntfile.js b/Gruntfile.js index 5fca45ad..6109d823 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -177,6 +177,7 @@ module.exports = function (grunt) { ["locked", "is"], ["alive", "is"], ["away", "is"], + ["jumping", "is", "isJumping"], ["readyToUse", "is"], ["playing", "is"], ["measuredFromCenter", "is"], @@ -285,7 +286,8 @@ module.exports = function (grunt) { ["revealState"], ["piloted"], ["objectIntensity"], - ["radioSilence"] + ["radioSilence"], + ["jumping", "set", "isJumping"] ].map( function (replacement) { // create the replacements for each simple setter diff --git a/src/config/config.json b/src/config/config.json index 8acfe24b..6857eb11 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -1,5 +1,5 @@ { - "version": "0.5.5-dev:1246 (2024.12.29.)", + "version": "0.5.5-dev:1247 (2024.12.29.)", "debugVersion": false, "logVerbosity": 1, "platform": "web", diff --git a/src/js/armada/logic/ai.js b/src/js/armada/logic/ai.js index 1f52678e..e09d998b 100644 --- a/src/js/armada/logic/ai.js +++ b/src/js/armada/logic/ai.js @@ -761,7 +761,7 @@ define([ */ SpacecraftAI.prototype._sendRadio = function (messageType, delay, priority) { var now = performance.now(), elapsed = now - this._lastRadioTime; - if (!this._radioSilence && (this._radioData.voice >= 0) && (this._spacecraft && this._spacecraft.isAlive() && !this._spacecraft.isAway()) && ( + if (!this._radioSilence && (this._radioData.voice >= 0) && (this._spacecraft && this._spacecraft.isAlive() && !this._spacecraft.isAway() && (!this._spacecraft.isJumping() || (messageType === _radioMessageLeaving))) && ( (messageType !== this._lastRadioType) && (elapsed >= _differentRadioMessageDelay) || (elapsed > _sameRadioMessageDelay) || (delay > 0) || @@ -799,7 +799,7 @@ define([ SpacecraftAI.prototype._handleDelayedRadio = function (dt) { if (this._radioTimeLeft > 0) { this._radioTimeLeft -= dt; - if (this._radioTimeLeft <= 0) { + if ((this._radioTimeLeft <= 0) && ((this._radioData.messageType !== _radioMessageClear) || !this._target)) { this._sendRadio(this._radioData.messageType, 0, 1); } } diff --git a/src/js/armada/logic/spacecraft.js b/src/js/armada/logic/spacecraft.js index 9ac9f752..71a855eb 100644 --- a/src/js/armada/logic/spacecraft.js +++ b/src/js/armada/logic/spacecraft.js @@ -2868,6 +2868,13 @@ define([ Spacecraft.prototype.setJumping = function (value) { this._isJumping = value; }; + /** + * Whether the jump sequence is currently underway. + * @returns {Boolean} + */ + Spacecraft.prototype.isJumping = function () { + return this._isJumping; + }; /** * Engages jump engines to leave the scene of the mission * @param {Boolean} toggle If true, calling the method while the jump out sequence is under way will cancel the jump