ship.remove(true) issue - 1.76

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

ship.remove(true) issue - 1.76

Post by Capt. Murphy »

Hi,

I've come across an oddity.

A ship performs a scripted jump to a specific system via ship.exitSystem(systemID).

A seperate worldscript then uses ship.remove(true) just after the wormhole expires. The player is still in the original system. Checking the entities status at that point returns STATUS_DEAD and isValid returns false.

If the player then jumps to the target system, the same ship is there, the status reports as STATUS_IN_FLIGHT and isValid returns true again. However the ship behaves kind of like a derelict. It's moving, but no engine glows, it's throwing sparks and a single laser shot will make it disappear (not explode).

I think this should be fairly easy to reproduce via debug console.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: ship.remove(true) issue - 1.76

Post by Eric Walch »

Capt. Murphy wrote:
I think this should be fairly easy to reproduce via debug console.
Easy to check and easy to fix. Needs just a check to prevent dead ships from being added at the otherside :lol:

E.g. the line:

Code: Select all

if ([ship status] == STATUS_DEAD) continue; // skip dead ships.
in disgorgeShips does the trick. Just tested it with a single ship and an escorted ship. In both cases the ship does not appear at the other side.

Although, the command remove() gives a ship an negative energy of -50000. In my first test to confirm your bug, I got an anaconda venting plasma at the other side. And it blew himself up within a few seconds. :wink:
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: ship.remove(true) issue - 1.76

Post by Capt. Murphy »

Thanks Eric,

The couple of times I witnessed it the ship did hang around for a while, although to be honest I either shot it or quit the game to stare at the script again within about 10 seconds so it may well have quietly died of it's own accord pretty quickly. I'm reinventing (the hopefully slightly more efficient) wheel yet again for the next release of Escort Contracts if you haven't guessed.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Post Reply