For test results, bug reports, announcements of new builds etc.
Moderators: winston , another_commander , Getafix
Smivs
Retired Assassin
Posts: 8408 Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:
Post
by Smivs » Mon Mar 07, 2011 8:09 pm
While working on an OXP project, I have discovered a problem with the cloaking device script (oolite-cloaking-device-pod.js)
Code: Select all
this.name = "oolite-cloaking-device-pod";
this.author = "Jens Ayton";
this.copyright = "© 2007-2011 the Oolite team.";
this.version = "1.75";
this.shipWasScooped = function (scooper)
{
if (scooper.isPlayer)
{
if (player.ship.equipmentStatus("EQ_CLOAKING_DEVICE") !== "EQUIPMENT_OK")
{
player.ship.awardEquipment("EQ_CLOAKING_DEVICE");
// Should we make it possible to repair?
// EquipmentInfo.infoForKey("EQ_CLOAKING_DEVICE").effectiveTechLevel = 14;
}
else
{
player.ship.awardCargo("Gold", 100);
}
}
// Should probably award 100 gold to non-player ships too, but they don’t have awardCargo at the moment.
};
The
is apparently no longer used.
Eric Walch
Slightly Grand Rear Admiral
Posts: 5536 Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands
Post
by Eric Walch » Mon Mar 07, 2011 8:58 pm
Smivs wrote: While working on an OXP project, I have discovered a problem with the cloaking device script (oolite-cloaking-device-pod.js)
The
is apparently no longer used.
Bad thing if you even can not thrust Oolites own code
Fixed now to:
Code: Select all
player.ship.manifest["gold"] += 100;
But I think that code-line will rarely be triggered because it assumes the player got a cloaking device in another way.
EDIT: Thinking about it.... The device should be much more valuable than just 100 kgs of gold.
Commander McLane
---- E L I T E ----
Posts: 9520 Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:
Post
by Commander McLane » Mon Mar 07, 2011 9:50 pm
@ Smivs: good catch!
Eric Walch wrote: EDIT: Thinking about it.... The device should be much more valuable than just 100 kgs of gold.
Perhaps, but this is a very old feature. I wouldn't want to change it. And as you already noted, the player isn't really supposed to get his cloaking device in another way.
Smivs
Retired Assassin
Posts: 8408 Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:
Post
by Smivs » Mon Mar 07, 2011 9:56 pm
I should point out to be fair, it was McLane who told me "player.ship.awardCargo" was no longer used. A collaborative bug-report
Switeck
---- E L I T E ----
Posts: 2411 Joined: Mon May 31, 2010 11:11 pm
Post
by Switeck » Tue Mar 08, 2011 2:33 am
Then award 1000 kg of Platinum instead.
(about 80k credits)