From 27a45679b9b259c0f7c84986493cc5d5c1cfd532 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Fri, 9 Apr 2010 00:01:55 -0400 Subject: [PATCH] In Player:IsCorrectFaction(): Replaced raw bit.band() use with recipe:IsFlagged() --- Player.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Player.lua b/Player.lua index c0b088f..6eeb0a8 100644 --- a/Player.lua +++ b/Player.lua @@ -120,12 +120,12 @@ function Player:HasProperRepLevel(rep_data) end function Player:IsCorrectFaction(recipe) - local flags = recipe.flags.common1 - local C1 = private.common_flags_word1 + local flagged_horde = recipe:IsFlagged("common1", "HORDE") + local flagged_alliance = recipe:IsFlagged("common1", "ALLIANCE") - if self.faction == BFAC["Alliance"] and bit.band(flags, C1.HORDE) == C1.HORDE and bit.band(flags, C1.ALLIANCE) ~= C1.ALLIANCE then + if self.faction == BFAC["Alliance"] and flagged_horde and not flagged_alliance then return false - elseif self.faction == BFAC["Horde"] and bit.band(flags, C1.ALLIANCE) == C1.ALLIANCE and bit.band(flags, C1.HORDE) ~= C1.HORDE then + elseif self.faction == BFAC["Horde"] and flagged_alliance and not flagged_horde then return false end return true -- 1.7.9.5