comparison Main.lua @ 59:059341095e99

Apparently in MoP it is not possible for InstanceType in GetInstanceInfo() to return nil.
author James D. Callahan III <jcallahan@curse.com>
date Wed, 04 Jul 2012 16:01:11 -0500
parents 63f7286e5d13
children 3a6693c99bb3
comparison
equal deleted inserted replaced
58:63f7286e5d13 59:059341095e99
123 end -- do-block 123 end -- do-block
124 124
125 125
126 local function InstanceDifficultyToken() 126 local function InstanceDifficultyToken()
127 local _, instance_type, instance_difficulty, difficulty_name, _, _, is_dynamic = _G.GetInstanceInfo() 127 local _, instance_type, instance_difficulty, difficulty_name, _, _, is_dynamic = _G.GetInstanceInfo()
128 if difficulty_name == "" then 128 if not difficulty_name or difficulty_name == "" then
129 difficulty_name = "NONE" 129 difficulty_name = "NONE"
130 end
131
132 if not instance_type or instance_type == "" then
133 instance_type = "NONE"
130 end 134 end
131 return ("%s:%s:%s"):format(instance_type:upper(), difficulty_name:upper():gsub(" ", "_"), _G.tostring(is_dynamic)) 135 return ("%s:%s:%s"):format(instance_type:upper(), difficulty_name:upper():gsub(" ", "_"), _G.tostring(is_dynamic))
132 end 136 end
133 137
134 138