Fix hardcoded resource path preventing client from starting on Unix (#265)

* Fix hardcoded resource path preventing client from starting on Unix

* also fix this unit test path

* okay actually fix it because I'm dumb
This commit is contained in:
sood
2017-07-09 11:47:50 -07:00
committed by Pieter-Jan Briers
parent 2f2aa40362
commit 822070dfdc
2 changed files with 5 additions and 6 deletions

View File

@@ -91,7 +91,7 @@ namespace SS14.Client.Resources
{
var cfgMgr = _configurationManager;
cfgMgr.RegisterCVar("res.pack", @"../../Resources/ResourcePack.zip", CVarFlags.ARCHIVE);
cfgMgr.RegisterCVar("res.pack", Path.Combine("..","..","Resources","ResourcePack.zip"), CVarFlags.ARCHIVE);
cfgMgr.RegisterCVar("res.password", String.Empty, CVarFlags.SERVER | CVarFlags.REPLICATED);
string zipPath = path ?? _configurationManager.GetCVar<string>("res.pack");
@@ -99,9 +99,8 @@ namespace SS14.Client.Resources
if (AppDomain.CurrentDomain.GetAssemblyByName("SS14.UnitTesting") != null)
{
string debugPath = "..\\";
debugPath += zipPath;
zipPath = debugPath;
string debugPath = "..";
zipPath = Path.Combine(debugPath, zipPath);
}
zipPath = PathHelpers.ExecutableRelativeFile(zipPath);

View File

@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using System;
using System.Reflection;
using System.Collections.Generic;
@@ -22,7 +22,7 @@ namespace SS14.Shared.Utility
/// </summary>
public static string ExecutableRelativeFile(string file)
{
return Path.Combine(GetExecutableDirectory(), file);
return Path.GetFullPath(Path.Combine(GetExecutableDirectory(), file));
}
public static string AssemblyRelativeFile(string file, Assembly assembly)