Eric Walch wrote:Note that the part:
is not part of the release version. You probably added it yourself to absolutely make sure the timer is stopped. It won't hurt and ensures the timer is not firing again by an hypothetical oolite bug.
Perhaps the link here:
http://www.box.com/shared/5e46br3nus
...that I downloaded from has the wrong or corrupted file/s?
Is the release version hosted somewhere else?
Eric Walch wrote:To me it looks more like a double installation of the oxp. You can double check that by adding a log line.
I did better, I added 2 log lines to the this.addBuoys section:
Code: Select all
this.addBuoys = function ()
{
log(this.name,"Adding Buoys!");
this.buoy = (player.ship.equipmentStatus("EQ_ROCKHERMIT_SCANNER") === "EQUIPMENT_OK") ? "rockbeacon" : "rockbeacof";
function addIfRockHermit(ships, buoy)
{
for (var i = 0; i < ships.length; i++)
{
if (ships[i].name === "Rock Hermit")
{
log(this.name,"Adding Buoy for: "+ships[i].name+" #: "+i);
if (0 < oolite.compareVersion("1.75"))
system.addShips(buoy, 1, ships[i].position.add(ships[i].orientation.vectorForward().multiply(10E3)), 1);
else
system.addShips(buoy, 1, ships[i].position.add(ships[i].vectorForward.multiply(10E3)), 1);
}
}
}
addIfRockHermit(system.shipsWithPrimaryRole("rockhermit"), this.buoy);
addIfRockHermit(system.shipsWithPrimaryRole("pirate-cove"), this.buoy);
this.buoysAdded = true;
if (this.buoyTimer) {this.buoyTimer.stop(); delete this.buoyTimer};
};
I caught probably how/why duplicate Buoys are being created thanks to the logging.
...A Pirate Cove being added at an odd moment!
But the output from it is downright bizarre:
Code: Select all
13:41:43.937 [rockHermit_Locator]: Adding Buoys!
13:41:43.937 [undefined]: Adding Buoy for: Rock Hermit #: 0
13:41:45.968 [deep_space_pirates]: Adding trader convoy to dangerous system! Total traders 7
13:41:45.984 [deep_space_pirates]: Added Pirate Cove to dangerous system!
13:41:46.859 [rockHermit_Locator]: Adding Buoys!
13:41:46.859 [undefined]: Adding Buoy for: Rock Hermit #: 0
13:41:46.859 [undefined]: Adding Buoy for: Rock Hermit #: 0
this.name
changed from
rockHermit_Locator
to
undefined
in the span of 8 lines of code. And why is the variable i equal to 0 in all 2(3?) cases?!