mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 16:19:03 -06:00
Minor change on PR #3 to use the error handling that was already implemented
This commit is contained in:
parent
69a5c0a21a
commit
d946b17e13
@ -2,20 +2,18 @@ local ffi = require "ffi"
|
|||||||
|
|
||||||
|
|
||||||
-- Get the host os to load correct lib
|
-- Get the host os to load correct lib
|
||||||
local os = love.system.getOS()
|
local osname = love.system.getOS()
|
||||||
local discordRPClib = nil
|
local discordRPClib = nil
|
||||||
|
|
||||||
|
if osname == "Linux" then
|
||||||
if os == "Linux" then
|
|
||||||
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.so")
|
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.so")
|
||||||
elseif os == "OS X" then
|
elseif osname == "OS X" then
|
||||||
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.dylib")
|
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.dylib")
|
||||||
elseif os == "Windows" then
|
elseif osname == "Windows" then
|
||||||
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.dll")
|
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.dll")
|
||||||
else
|
else
|
||||||
-- Else it crashes later on
|
-- Else it crashes later on
|
||||||
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.e")
|
error(string.format("Discord rpc not supported on platform (%s)", osname))
|
||||||
print("Discord rpc not supported on platform")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user