Networking bugfixes & optimization

This commit is contained in:
Regalis
2015-08-18 18:13:40 +03:00
parent bc4ea098f7
commit 00c64f0b20
35 changed files with 320 additions and 188 deletions

View File

@@ -17,7 +17,9 @@ namespace Subsurface
public static float Round(float value, float div)
{
return (float)Math.Floor(value / div) * div;
return (value < 0.0f) ?
(float)Math.Ceiling(value / div) * div :
(float)Math.Floor(value / div) * div;
}
public static float VectorToAngle(Vector2 vector)

View File

@@ -55,11 +55,16 @@ namespace Subsurface
{
DebugConsole.ThrowError("Error saving gamesession", e);
}
//Game1.GameSession.crewManager.Save(directory+"\\crew.xml");
try
{
CompressDirectory(tempPath, fileName+".save", null);
}
CompressDirectory(tempPath, fileName+".save", null);
//Directory.Delete(tempPath, true);
catch (Exception e)
{
DebugConsole.ThrowError("Error compressing save file", e);
}
}
public static void LoadGame(string fileName)