I was simply wondering if this function leaks/if there is a better way to do this (the part I'm wondering about is the floating text).
Any help would be greatly appreciated.
-Thanks
Any help would be greatly appreciated.
JASS:
function damageUnit takes unit attacker, unit target, integer damage, attacktype atype, integer dtype, boolean considerArmor, integer splDmgCoeff returns nothing
// find real damage
set damage = R2I(damage + udg_spellDamage[GetPlayerId(GetOwningPlayer(attacker))] * splDmgCoeff)
// deal the damage
call UnitDamageTargetEx(attacker, target, damage, atype, dtype, considerArmor)
// show dmg to attacker
call CreateTextTagUnitBJ(I2S(damage), attacker, 0, 10, 0.00, 0.00, 100.00, 0)
call SetTextTagVelocity(bj_lastCreatedTextTag, 100, 0)
call ShowTextTagForceBJ(false, bj_lastCreatedTextTag, bj_FORCE_ALL_PLAYERS)
call ShowTextTagForceBJ(true, bj_lastCreatedTextTag, GetForceOfPlayer(GetOwningPlayer(attacker)))
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagFadepoint(bj_lastCreatedTextTag, 0.50)
call SetTextTagLifespan(bj_lastCreatedTextTag, .75)
// show dmg to target
call CreateTextTagUnitBJ(I2S(damage), target, 0, 10, 0.00, 0.00, 100.00, 0)
call SetTextTagVelocity(bj_lastCreatedTextTag, 100, 0)
call ShowTextTagForceBJ(false, bj_lastCreatedTextTag, bj_FORCE_ALL_PLAYERS)
call ShowTextTagForceBJ(true, bj_lastCreatedTextTag, GetForceOfPlayer(GetOwningPlayer(target)))
call SetTextTagPermanent(bj_lastCreatedTextTag, false)
call SetTextTagFadepoint(bj_lastCreatedTextTag, 0.50)
call SetTextTagLifespan(bj_lastCreatedTextTag, .75)
endfunction
-Thanks