Page 1 of 1

Lua-API description bug?

Posted: Fri Jun 12, 2020 10:15 pm
by Pi-C
In the description of the on_entity_damaged event, there is this:
final_health :: float: The health of the entity after the damage was applied.
I've been logging some data on entering the event script:

Code: Select all

36505.401 Script @__WaterTurret__/control.lua:754: event.entity.health: 12.310014724731445
36505.401 Script @__WaterTurret__/control.lua:754: event.entity.prototype.max_health: 15
36505.402 Script @__WaterTurret__/control.lua:754: event.final_health: 0.82066762447357178
The damaged entity doesn't look like it had less than 1 health left, but the value of event.final_health looks conspicuously like the quotient of event.entity.health / event.entity.prototype.max_health. So I think the description "health after the damage was applied" is misleading. It should be noted that this isn't the absolute value, but a ratio.

Re: Lua-API description bug?

Posted: Sun Jun 28, 2020 6:57 pm
by Muppet9010
Just hit this myself and so bugged for either a code fix or documentation update depending on what the devs meant it to be :)
viewtopic.php?f=7&t=86411