Error message if a character config file isn't found, Linux version tries to search for "Characterfolder" if "characterfolder" isn't found

This commit is contained in:
Regalis
2016-08-11 21:30:05 +03:00
parent 7716b5e9d4
commit ab923c47e3
3 changed files with 32 additions and 5 deletions
+3 -3
View File
@@ -468,7 +468,7 @@
<Content Include="Content\Characters\Husk\legs.png"> <Content Include="Content\Characters\Husk\legs.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Characters\TigerThresher\damagedtigerthresher.png"> <Content Include="Content\Characters\Tigerthresher\damagedtigerthresher.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Characters\Watcher\watcher.xml"> <Content Include="Content\Characters\Watcher\watcher.xml">
@@ -641,10 +641,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Content> </Content>
<Content Include="Content\Characters\TigerThresher\tigerthresher.png"> <Content Include="Content\Characters\Tigerthresher\tigerthresher.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Characters\TigerThresher\tigerthresher.xml"> <Content Include="Content\Characters\Tigerthresher\tigerthresher.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Content> </Content>
+28 -1
View File
@@ -393,7 +393,34 @@ namespace Barotrauma
public static Character Create(string file, Vector2 position, CharacterInfo characterInfo = null, bool isNetworkPlayer = false, bool hasAi=true) public static Character Create(string file, Vector2 position, CharacterInfo characterInfo = null, bool isNetworkPlayer = false, bool hasAi=true)
{ {
if (!System.IO.File.Exists(file)) return null; #if LINUX
if (!System.IO.File.Exists(file))
{
//if the file was not found, attempt to convert the name of the folder to upper case
var splitPath = file.Split('/');
if (splitPath.Length > 2)
{
splitPath[splitPath.Length-2] =
splitPath[splitPath.Length-2].First().ToString().ToUpper() + splitPath[splitPath.Length-2].Substring(1);
file = string.Join("/", splitPath);
}
if (!System.IO.File.Exists(file))
{
DebugConsole.ThrowError("Spawning a character failed - file ''"+file+"'' not found!");
return null;
}
}
#else
if (!System.IO.File.Exists(file))
{
DebugConsole.ThrowError("Spawning a character failed - file ''"+file+"'' not found!");
return null;
}
#endif
if (file != humanConfigFile) if (file != humanConfigFile)
{ {
+1 -1
View File
@@ -1645,7 +1645,7 @@ namespace Barotrauma
#if DEBUG #if DEBUG
System.Diagnostics.Debug.Assert(body != null, "Tried to send a PhysicsBodyPosition message for an item that has no physics body ("+Name+")"); System.Diagnostics.Debug.Assert(body != null, "Tried to send a PhysicsBodyPosition message for an item that has no physics body ("+Name+")");
#else #else
if (body == null) return; if (body == null) return false;
#endif #endif
body.FillNetworkData(message); body.FillNetworkData(message);