From c6b00a5fb38b2bd53ea84f6f953e76a6c7870f5f Mon Sep 17 00:00:00 2001 From: "F16Gaming (Laptop)" Date: Thu, 10 May 2012 12:57:32 +0200 Subject: [PATCH] Improved event handling: Guild addon comm will only refresh if number of online guild members have changed. --- Events.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Events.lua b/Events.lua index 51e2ac0..000ea51 100644 --- a/Events.lua +++ b/Events.lua @@ -1,18 +1,18 @@ --[[ * Copyright (c) 2011-2012 by Adam Hellberg. - * + * * This file is part of Command. - * + * * Command is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * Command is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with Command. If not, see . --]] @@ -113,7 +113,12 @@ function C.Events.PARTY_LEADER_CHANGED(self, ...) AC:UpdateGroup() end +local numGuildMembers = 0 function C.Events.GUILD_ROSTER_UPDATE(self, ...) if AC.GuildRunning then return end - AC:UpdateGuild() + local _, tmpGuildMembers = GetNumGuildMembers() + if numGuildMembers ~= tmpGuildMembers then + numGuildMembers = tmpGuildMembers + AC:UpdateGuild() + end end -- 1.7.9.5