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.
pull/13/head
Brandon McGriff 2020-11-09 16:06:09 -08:00
parent 6a295cad59
commit cf32474898
1 changed files with 6 additions and 2 deletions

View File

@ -19,8 +19,12 @@ if string.sub(source, -5) == ".love" or love.filesystem.isFused() then
source = love.filesystem.getSourceBaseDirectory()
end
if osname == "Linux" or osname == "OS X" or osname == "Windows" then
discordRPClib = ffi.load(source.."/libs/discord-rpc")
if osname == "Linux" then
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 it crashes later on
error(string.format("Discord rpc not supported on platform (%s)", osname))