Fixes crash when playing games with certain file extensions
This commit is contained in:
parent
103d5cecf1
commit
6b0ad3cf8f
@ -183,7 +183,7 @@ extension DatabaseManager
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
let destinationURL = DatabaseManager.gamesDirectoryURL.appendingPathComponent(game.identifier + "." + game.preferredFileExtension)
|
let destinationURL = DatabaseManager.gamesDirectoryURL.appendingPathComponent(filename)
|
||||||
|
|
||||||
if FileManager.default.fileExists(atPath: destinationURL.path)
|
if FileManager.default.fileExists(atPath: destinationURL.path)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -22,15 +22,6 @@ public class Game: _Game, GameProtocol
|
|||||||
|
|
||||||
return fileURL
|
return fileURL
|
||||||
}
|
}
|
||||||
|
|
||||||
public var preferredFileExtension: String {
|
|
||||||
switch self.type
|
|
||||||
{
|
|
||||||
case GameType.snes: return "smc"
|
|
||||||
case GameType.gba: return "gba"
|
|
||||||
default: return "delta"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Game
|
extension Game
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user