HandyNotes_Guild

6 - Small correction of GuildNotes.lua to not show own location

What steps will reproduce the problem?
1. Simply log in on a character with the addon enabled
2.
3.

What is the expected output? What do you see instead?
I expect to see guild mates location on the world map thanks to a spot for each of them
I expect NOT to see my own thanks to those spots.
I end up seeing my guild mates properly, but also myself. There is a spot on top of my Arrow, or trying to follow my Arrow.

What version of the product are you using?
1.7

Please provide any additional information below.
I corrected this by adding an if loop in GuildNotes.lua to check wether or not the character for whom we are adding a spot is us or not.
The only affected function is Guild:UpdateMember starting at line 196.
This is what I've changed it to :

function Guild:UpdateMember(event, sender, x, y, zone)
    local myPlayerName = UnitName("player");
    local realmName = string.gsub(GetRealmName()," ","");
    if sender ~= myPlayerName.."-"..realmName then
        if event == "Clear" then
            recycle(database[sender])
            database[sender] = nil
        elseif event == "Position" then
            database[sender].coord = HandyNotes:getCoord(x,y)
            database[sender].zone = zone
        end
        self:SendMessage("HandyNotes_NotifyUpdate", "Guild")
    end
end

There might be a better way to do it, but this does the trick all right so far.

Regards.

User When Change
Kouro Feb 27, 2014 at 09:56 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

Facts

Reported
Feb 27, 2014
Status
New - Issue has not had initial review yet.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees