Fixed libs/discordRPC.lua so Discord RPC loads on Linux.

I changed how the library was loaded before, but turns out that way only
worked on Windows. Changed it back to how it was, so it works on Linux
for me, and presumably macOS.
This commit is contained in:
Brandon McGriff 2020-11-09 16:06:09 -08:00
parent 6a295cad59
commit cf32474898

View File

@ -19,8 +19,12 @@ if string.sub(source, -5) == ".love" or love.filesystem.isFused() then
source = love.filesystem.getSourceBaseDirectory() source = love.filesystem.getSourceBaseDirectory()
end end
if osname == "Linux" or osname == "OS X" or osname == "Windows" then if osname == "Linux" then
discordRPClib = ffi.load(source.."/libs/discord-rpc") discordRPClib = ffi.load(source.."/libs/discord-rpc.so")
elseif osname == "OS X" then
discordRPClib = ffi.load(source.."/libs/discord-rpc.dylib")
elseif osname == "Windows" then
discordRPClib = ffi.load(source.."/libs/discord-rpc.dll")
else else
-- Else it crashes later on -- Else it crashes later on
error(string.format("Discord rpc not supported on platform (%s)", osname)) error(string.format("Discord rpc not supported on platform (%s)", osname))