Fix https://github.com/ascott18/TellMeWhen/issues/1907 - We can't use feature detection for combo points because GetComboPoints is still defined on retail for some reason.

Partially reverts f845e20c05
This commit is contained in:
Andrew Scott
2021-08-24 19:58:43 -07:00
parent ca58775bc8
commit a2b3c73085

View File

@ -13,18 +13,19 @@ DogTag_Unit_funcs[#DogTag_Unit_funcs+1] = function(DogTag_Unit, DogTag)
local L = DogTag_Unit.L
local wow_ver = select(4, GetBuildInfo())
local wow_600 = wow_ver >= 60000
local wow_700 = wow_ver >= 70000
DogTag:AddTag("Unit", "Combos", {
code = function (unit, target)
if unit and target then
if not GetComboPoints then
if wow_600 then
return UnitPower(unit, 4)
else
return GetComboPoints(unit, target)
end
else
if not GetComboPoints then
if wow_600 then
return UnitPower((UnitHasVehicleUI and UnitHasVehicleUI("player")) and "vehicle" or "player", 4)
else
return GetComboPoints((UnitHasVehicleUI and UnitHasVehicleUI("player")) and "vehicle" or "player", "target")