View Single Post
12-04-12, 11:05 AM   #21
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Code:
local HOSTILE_PLAYER = bit_bor(COMBAT_LOG_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
Hi Phanx,
I get error if i try to use this code.
I am not very confident in the COMBAT_LOG_REACTION_HOSTILE var name global.

I have added:

local bit_bor = bit.bor
local COMBAT_LOG_REACTION_HOSTILE = COMBAT_LOG_REACTION_HOSTILE

to my addon code but I always get an error like:

Lua Code:
  1. bad argument #1 to "bit_bor" (number expected, got nil)

Again, thanks really very much to you and to every reader and poster :-)
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote