Quantcast

Fix ticket 88 - Threat does not work?

Johnny C. Lam [07-20-13 - 08:46]
Fix ticket 88 - Threat does not work?

Default to checking threat against the current target and fix the
documentation to note that the Threat() condition can take a target
parameter.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@985 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleCondition.lua
diff --git a/OvaleCondition.lua b/OvaleCondition.lua
index 1c8f7f8..3f17bfd 100644
--- a/OvaleCondition.lua
+++ b/OvaleCondition.lua
@@ -3176,6 +3176,9 @@ end
 -- @paramsig number or boolean
 -- @param operator Optional. Comparison operator: equal, less, more.
 -- @param number Optional. The number to compare against.
+-- @param target Optional. Sets the target to check. The target may also be given as a prefix to the condition.
+--     Defaults to target=target.
+--     Valid values: player, target, focus, pet.
 -- @return The amount of threat.
 -- @return A boolean value for the result of the comparison.
 -- @usage
@@ -3183,7 +3186,7 @@ end
 -- if Threat(more 90) Spell(fade)

 OvaleCondition.conditions.threat = function(condition)
-	local isTanking, status, threatpct = API_UnitDetailedThreatSituation("player", GetTarget(condition))
+	local isTanking, status, threatpct = API_UnitDetailedThreatSituation("player", GetTarget(condition, "target"))
 	return Compare(threatpct, condition[1], condition[2])
 end