alienari / bitfighter

Automatically exported from code.google.com/p/bitfighter
Other
0 stars 0 forks source link

[Lua] Killing players with setHealth(0) generates a faulty onShipKilled() event #525

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Subscribe to ShipKilled event
2. Kill a ship with ship:setHealth(0)
3. Check out the onShipKilled event

What is the expected output? What do you see instead?
In inShipKilled(ship, damigingObject, shooterObject), you would expect the 
following arguments:

ship = the dead ship
damigingObject = nil
shooterObejct = nil

But instead you get this:

ship = number: 0
damigingObject = userdata: 0x023eeea0
shooterObject = nil

Funny thing is, damigingObject is actually the dead ship! ship should be 
userdata: 0x023eeea0, not damigingObject.

What version of the product are you using? On what operating system?

Please provide any additional information below.
Does this with players and bots

Original issue reported on code.google.com by corteocarl on 5 Jul 2015 at 11:10

GoogleCodeExporter commented 9 years ago
*What version of the product are you using? On what operating system?
019e Windows 64-bit

Original comment by corteocarl on 5 Jul 2015 at 11:11

GoogleCodeExporter commented 9 years ago
Does this only happen when doing the setHealth(0) call?  And, are you saying 
that the return list is offset by one somehow?

Original comment by buckyballreaction on 5 Jul 2015 at 11:48

GoogleCodeExporter commented 9 years ago
Fixed!

Original comment by buckyballreaction on 10 Jul 2015 at 2:24