@@ -127,38 +127,42 @@ end
127127-- functions to retrieve player-names (to hide realm-names)
128128--]]
129129local function retrieveSourceName (info )
130- if db .hideUnitNames or info .sourceName == " " or not info .sourceID then
130+ if db .hideUnitNames or info .sourceName == " " or info .hideCaster then
131131 return " __NONAME__"
132132 end
133133
134- local _ , class , _ , _ , _ , name = GetPlayerInfoByGUID (info .sourceID )
135- if class then
136- if not db .hideRealm then
137- name = info .sourceName
134+ if info .sourceID and info .sourceID ~= " " then
135+ local _ , class , _ , _ , _ , name = GetPlayerInfoByGUID (info .sourceID )
136+ if class then
137+ if not db .hideRealm then
138+ name = info .sourceName
139+ end
140+ if db .classcolor then
141+ name = classColorStrings [class ]:format (name )
142+ end
143+ return name
138144 end
139- if db .classcolor then
140- name = classColorStrings [class ]:format (name )
141- end
142- return name
143145 end
144146
145147 return info .sourceName
146148end
147149
148150local function retrieveDestName (info )
149- if db .hideUnitNames or info .recipientName == " " or not info .recipientID then
151+ if db .hideUnitNames or info .recipientName == " " or info .hideCaster then
150152 return " __NONAME__"
151153 end
152154
153- local _ , class , _ , _ , _ , name = GetPlayerInfoByGUID (info .recipientID )
154- if class then
155- if not db .hideRealm then
156- name = info .recipientName
157- end
158- if db .classcolor then
159- name = classColorStrings [class ]:format (name )
155+ if info .recipientID and info .recipientID ~= " " then
156+ local _ , class , _ , _ , _ , name = GetPlayerInfoByGUID (info .recipientID )
157+ if class then
158+ if not db .hideRealm then
159+ name = info .recipientName
160+ end
161+ if db .classcolor then
162+ name = classColorStrings [class ]:format (name )
163+ end
164+ return name
160165 end
161- return name
162166 end
163167
164168 return info .recipientName
0 commit comments