Testing for the presence of missile and lasers does not work

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Testing for the presence of missile and lasers does not work

Post by Nemoricus »

If you try to run player.ship.hasEquipment(string: name) with any laser or missile, it will always return a false result, regardless of whether one is actually presently.

There could be a few OXPs that could make use of such a test.

On a related note, player.ship.removeEquipment(string: name) does not work with missiles either.
Dream as if you'll live forever
Live as if you'll die tomorrow
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Fixed in r2216–2217.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Thank you, Ahruman. I will check this out and let you know if everything is working as intended.

EDIT: requires_equipment and incompatible_with_equipment are both working. Yet to test hasEquipment and removeEquipment().

EDIT2: hasEquipment() works.
Dream as if you'll live forever
Live as if you'll die tomorrow
metri
Above Average
Above Average
Posts: 26
Joined: Sat Feb 14, 2009 9:01 pm

Post by metri »

What about changing lasers via scripting.
For example activating mine will replace front military laser with mining laser.
The laser temperature should not be changed is such event.
Post Reply