I've got a piece of code that changes some settings and needs to wait until an event indicates that the change was successful. (Refer to my
SetLootThreshold thread to get an idea of what I'm doing.)
My current implementation registers the event in question ("PARTY_LOOT_METHOD_CHANGED" in this case) in my OnLoad function. The problem is that if I'm in a group and someone else triggers the event my addon tries to do it's thing because it's always watching.
I know you can unregister events but I was curious if it's considered "bad coding" to have a function that registers an event, runs code that should trigger the event, and then unregister it or is that exactly what the register/unregister functionality is for?