Not sure if this is a bug but the newer BlzUnitCancelTimedLife native function kills the unit rather than just aborting the timer and this is not very useful because it could already be done before by removing the buff of the timed life.
Description
With the UnitApplyTimedLife native function, one can add an expiration timer to a unit like summoned units use, which kills the unit after a given amount of game time and displays a decreasing bar in its user interface. From a mapmaking perspective, there has been the desire to be able to abort the timer, avoiding the unit’s death, to change the duration, change the caption etc. afterwards but, before, there was only the UnitPauseTimedLife native function to stop/resume an expiration timer and to finish the timer prematurely by removing the buff with UnitRemoveAbility(unit, buffId), which also kills the unit.
Additional information:
Timed life buffs can be interleaved, i.e., if you apply a “Healing Ward” buff first, then “Water Elemental”, the user interface will still display “Healing Ward” with the corresponding bar, even if the “Water Elemental” one will be the first one to expire, but the unit will die on any timer that expires first, which may be a bug/issue in itself. You can even add multiple timers for the same buff.
Thus, if the interleaving capability is intended, it maybe should be considered in methods to abort the timed life, i.e., aborting individual timers instead of every timer.
However, it would be useful enough to have a native function to abort every timer, as interleavings where only one timed life is displayed could be taken care of by the mapmaker. In mapmaking, the value here is mostly to display the bar in the user interface, not to have the unit dying upon expiration.
Expected
The buff and timer are removed, the timed life display in the unit user interface vanishes, revealing again what it might have hidden like the experience bar. The unit keeps living.
Actual
The unit dies.
Reproduction steps
call UnitApplyTimedLife on a unit (for example, use the ‘BTLF’ generic timed life buff)
call BlzUnitCancelTimedLife on the same unit
External URLs
https://us.forums.blizzard.com/en/warcraft3/t/blzunitcanceltimedlife-kills-unit/29117
Summary
Not sure if this is a bug but the newer BlzUnitCancelTimedLife native function kills the unit rather than just aborting the timer and this is not very useful because it could already be done before by removing the buff of the timed life.
Description
With the UnitApplyTimedLife native function, one can add an expiration timer to a unit like summoned units use, which kills the unit after a given amount of game time and displays a decreasing bar in its user interface. From a mapmaking perspective, there has been the desire to be able to abort the timer, avoiding the unit’s death, to change the duration, change the caption etc. afterwards but, before, there was only the UnitPauseTimedLife native function to stop/resume an expiration timer and to finish the timer prematurely by removing the buff with UnitRemoveAbility(unit, buffId), which also kills the unit.
Additional information: Timed life buffs can be interleaved, i.e., if you apply a “Healing Ward” buff first, then “Water Elemental”, the user interface will still display “Healing Ward” with the corresponding bar, even if the “Water Elemental” one will be the first one to expire, but the unit will die on any timer that expires first, which may be a bug/issue in itself. You can even add multiple timers for the same buff.
Thus, if the interleaving capability is intended, it maybe should be considered in methods to abort the timed life, i.e., aborting individual timers instead of every timer.
However, it would be useful enough to have a native function to abort every timer, as interleavings where only one timed life is displayed could be taken care of by the mapmaker. In mapmaking, the value here is mostly to display the bar in the user interface, not to have the unit dying upon expiration.
Expected
Actual
Reproduction steps
Workaround
No response
Screenshots
No response
Game Versions
1.33.0 (1.33.0.18931, 1.33.0.19010, 1.33.0.19019, 1.33.0.19089, 1.33.0.19308)