View Single Post
Unread 12-03-12, 06:06 PM   #20
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,290
Don't forget friendly fire. If you've already got the sourceFlags, though, it's just easier to check those than to try to account for a bunch of special exceptions, since that's exactly what they're there for. Try this:

Code:
local HOSTILE_PLAYER = bit_bor(COMBATLOG_OBJECT_REACTION_HOSTILE, COMBATLOG_OBJECT_CONTROL_PLAYER)

if bit_band(sourceFlags, HOSTILE_PLAYER) ~= 0 then
    -- source is a hostile player
end
You can find a complete list of combat log bitmasks here:
http://wow.go-hero.net/framexml/16309/Constants.lua#374
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!

Last edited by Phanx : 12-04-12 at 11:27 PM.
Phanx is offline   Reply With Quote