Lua-API description bug?
Posted: Fri Jun 12, 2020 10:15 pm
In the description of the on_entity_damaged event, there is this:
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.
I've been logging some data on entering the event script:final_health :: float: The health of the entity after the damage was applied.
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