Fix some lua errors

This commit is contained in:
Eduardo Bart 2012-07-12 22:26:08 -03:00
parent e8abf56b28
commit 9bfd2617e9
3 changed files with 18 additions and 17 deletions

View File

@ -45,7 +45,3 @@ if g_resources.fileExists("/otclientrc.lua") then
dofile("/otclientrc.lua")
end
--g_things.loadOtb("/items.otb")
--g_map.loadOtbm("/forgotten.otbm")

View File

@ -39,9 +39,9 @@ function Client.init()
addEvent(function()
scheduleEvent(function()
-- Play startup music (The Silver Tree, by Mattias Westlund)
g_sounds.playMusic("startup.ogg", 3)
g_sounds.playMusic("/client/startup.ogg", 3)
connect(g_game, { onGameStart = function() g_sounds.stopMusic(3) end })
connect(g_game, { onGameEnd= function() g_sounds.playMusic("startup.ogg", 3) end })
connect(g_game, { onGameEnd= function() g_sounds.playMusic("/client/startup.ogg", 3) end })
end, 100)
end, 0)
end

View File

@ -194,7 +194,12 @@ local function onGameStart()
if(not table.empty(lastChannelsOpen) and lastChannelsOpen[char]) then
for channelName, channelId in ipairs(lastChannelsOpen[char]) do
if(not table.find(channels, channelId)) then g_game.joinChannel(channelId) end
channelId = tonumber(channelId)
if channelId ~= 0 then
if not table.find(channels, channelId) then
g_game.joinChannel(channelId)
end
end
end
end
end