From 6b0ad3cf8f82d0110b2a81c38b2dca4b27728527 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 22 Nov 2016 19:51:30 -0800 Subject: [PATCH] Fixes crash when playing games with certain file extensions --- Common/Database/DatabaseManager.swift | 2 +- Common/Database/Model/Game.swift | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Common/Database/DatabaseManager.swift b/Common/Database/DatabaseManager.swift index 919e251..06b6e38 100644 --- a/Common/Database/DatabaseManager.swift +++ b/Common/Database/DatabaseManager.swift @@ -183,7 +183,7 @@ extension DatabaseManager do { - let destinationURL = DatabaseManager.gamesDirectoryURL.appendingPathComponent(game.identifier + "." + game.preferredFileExtension) + let destinationURL = DatabaseManager.gamesDirectoryURL.appendingPathComponent(filename) if FileManager.default.fileExists(atPath: destinationURL.path) { diff --git a/Common/Database/Model/Game.swift b/Common/Database/Model/Game.swift index 19c6221..5875c30 100644 --- a/Common/Database/Model/Game.swift +++ b/Common/Database/Model/Game.swift @@ -22,15 +22,6 @@ public class Game: _Game, GameProtocol return fileURL } - - public var preferredFileExtension: String { - switch self.type - { - case GameType.snes: return "smc" - case GameType.gba: return "gba" - default: return "delta" - } - } } extension Game