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:
@@ -468,7 +468,7 @@
|
||||
<Content Include="Content\Characters\Husk\legs.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Characters\TigerThresher\damagedtigerthresher.png">
|
||||
<Content Include="Content\Characters\Tigerthresher\damagedtigerthresher.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Characters\Watcher\watcher.xml">
|
||||
@@ -641,10 +641,10 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Content\Characters\TigerThresher\tigerthresher.png">
|
||||
<Content Include="Content\Characters\Tigerthresher\tigerthresher.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Characters\TigerThresher\tigerthresher.xml">
|
||||
<Content Include="Content\Characters\Tigerthresher\tigerthresher.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
|
||||
@@ -393,7 +393,34 @@ namespace Barotrauma
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -1645,7 +1645,7 @@ namespace Barotrauma
|
||||
#if DEBUG
|
||||
System.Diagnostics.Debug.Assert(body != null, "Tried to send a PhysicsBodyPosition message for an item that has no physics body ("+Name+")");
|
||||
#else
|
||||
if (body == null) return;
|
||||
if (body == null) return false;
|
||||
#endif
|
||||
|
||||
body.FillNetworkData(message);
|
||||
|
||||
Reference in New Issue
Block a user