Looking at the code some more I think line 174 is necessary/there for circumstances where the player has already launched when the Timer fires - it just resets the attack so that next time you dock there will be an attack. However it does cause problems if the station attack mission screen has been inadvertently shown and the player accepted the bug fight before the Timer has fired. Commenting it out could potentially reduce the number of attacks overall if you are in the habit of docking, doing stuff quick and launching again in less than 60 seconds.
I've changed a few lines in my local copy which seems to solve the continual loop I've described whilst maintaining the other behaviour of the script. It stops the station attack mission screen being shown before the delay timer has fired in the event that
this.missionScreenOpportunity
is fired again independently of the the delay timer.In the section below
delete this.attackTimer;
is new.Code: Select all
this.stationAttack = function (){ // Delayed missionoffer, called by a timer
delete this.attackTimer;
if (guiScreen === "GUI_SCREEN_MISSION" || guiScreen === "GUI_SCREEN_REPORT" || guiScreen === "GUI_SCREEN_SAVE") return;
if (player.ship.docked) this.missionScreenOpportunity(); // force a delayed evaluation.
missionVariables.thargoidwars_station_attack = "POSSIBLE";
}
Code: Select all
if (station_attack === "ATTACKED"){
Code: Select all
if (station_attack === "ATTACKED" && !this.attackTimer){