small glitch in shipBeingAttacked

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- 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:

small glitch in shipBeingAttacked

Post by Commander McLane »

The shipBeingAttacked event handler has a small glitch in connection with its optional "whom" parameter.

The handler fires not only when laser fire hits, but also when plasma bolts from turrets hit. But in this case "whom" is undefined, it seems that the plasma bolts don't carry the information who fired them. Currently this leads to an JS error message, if a script uses the "whom" parameter.

A workaround is to insert the line:

Code: Select all

this.shipBeingAttacked = function(whom)
{
	if(!whom) return
	.
	.
	.
}
A fix would be to give also the plasma turrets the information who fired them.
Post Reply