From 913ccf0df50000487fe8990116484853bbf507c5 Mon Sep 17 00:00:00 2001 From: "F16Gaming (Laptop)" Date: Thu, 10 May 2012 12:56:46 +0200 Subject: [PATCH] Optimized AddonComm a bit. --- AddonComm.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/AddonComm.lua b/AddonComm.lua index cb103a8..d8c5b33 100644 --- a/AddonComm.lua +++ b/AddonComm.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 . --]] @@ -112,13 +112,12 @@ function AC:Init() end function AC:LoadSavedVars() - + end function AC:Receive(msgType, msg, channel, sender) if sender == UnitName("player") or not msg then return end if msgType ~= self.Prefix then return end - log:Debug("[AddonComm] " .. msg) msgType, msg = msg:match(self.Pattern.Message) if msgType == self.Type.VersionUpdate then local ver = tonumber(msg) @@ -225,6 +224,7 @@ function AC:Send(msgType, msg, channel, target) end function AC:UpdateGroup() + if self.GroupRunning then return end if not GT:IsGroup() then if self.InGroup then log:Normal(L("AC_GROUP_LEFT")) @@ -267,6 +267,7 @@ function AC:UpdateGroup() end function AC:UpdateGuild() + if self.GuildRunning then return end if not IsInGuild() then self.InGuild = false self.GuildChecked = false @@ -317,7 +318,7 @@ end function AC:CheckGroupRoster() for i,v in ipairs(self.GroupMembers) do - if not GT:IsInGroup(v) then + if not GT:IsInGroup(v) or not GT:IsOnline(v) then log:Normal(L("AC_GROUP_REMOVE"):format(v)) table.remove(self.GroupMembers, i) if self.GroupMembers[1] == UnitName("player") then -- 1.7.9.5