Quantcast

change function names to avoid possible conflicts

Eloi Charpentier [01-16-20 - 00:02]
change function names to avoid possible conflicts
Filename
Kaamelol.lua
diff --git a/Kaamelol.lua b/Kaamelol.lua
index 6fd4262..ce87321 100644
--- a/Kaamelol.lua
+++ b/Kaamelol.lua
@@ -9,14 +9,14 @@ frame:SetScript("OnEvent", function(self, event_name, ...)
     return self[event_name](self, event_name, ...)
 end)

-function play(msg)
+function kaamelol_play(msg)
 	root = "Interface/AddOns/" .. addon_name .. "/sounds/"
 	path = root .. msg .. ".mp3"
 	PlaySoundFile(path, "Master")
     return true
 end

-function broadcast(msg)
+function kaamelol_broadcast(msg)
     chan, rest = strsplit(" ", msg, 2)
 	chan = string.upper(chan)
 	if chan == "WHISPER" then
@@ -28,11 +28,11 @@ function broadcast(msg)
     return true
 end

-function run_command(cmd, args)
+function kaamelol_run_command(cmd, args)
     if cmd == "play" then
-        return play(args)
+        return kaamelol_play(args)
     elseif cmd == "broad" then
-			return broadcast(args)
+		return kaamelol_broadcast(args)
 	else
 		return false
 	end
@@ -41,7 +41,7 @@ end
 SLASH_KAAMELOL1 = cmd_name
 SlashCmdList["KAAMELOL"] = function(msg)
     cmd, args = strsplit(" ", msg, 2)
-    if not run_command(cmd, args) then
+    if not kaamelol_run_command(cmd, args) then
         print(addon_name .. " usage:")
     end
 end
@@ -50,7 +50,7 @@ end
 function frame:CHAT_MSG_ADDON(event, prefix, msg)
 	if prefix == addon_name then
 		print(msg)
-		play(msg)
+		kaamelol_play(msg)
 	end
 end