Unstable 1.2.1.0

This commit is contained in:
Markus Isberg
2023-11-10 17:45:19 +02:00
parent 2ea58c58a7
commit 8a2e2ea0ae
268 changed files with 4076 additions and 1843 deletions
@@ -624,7 +624,7 @@ namespace Barotrauma
//math/physics stuff ----------------------------------------------------
public static Vector2 VectorToWorldGrid(Vector2 position, bool round = false)
public static Vector2 VectorToWorldGrid(Vector2 position, Submarine sub = null, bool round = false)
{
if (round)
{
@@ -636,6 +636,12 @@ namespace Barotrauma
position.X = MathF.Floor(position.X / GridSize.X) * GridSize.X;
position.Y = MathF.Ceiling(position.Y / GridSize.Y) * GridSize.Y;
}
if (sub != null)
{
position.X += sub.Position.X % GridSize.X;
position.Y += sub.Position.Y % GridSize.Y;
}
return position;
}
@@ -1840,6 +1846,7 @@ namespace Barotrauma
FilePath = filePath,
OutpostModuleInfo = Info.OutpostModuleInfo != null ? new OutpostModuleInfo(Info.OutpostModuleInfo) : null,
BeaconStationInfo = Info.BeaconStationInfo != null ? new BeaconStationInfo(Info.BeaconStationInfo) : null,
WreckInfo = Info.WreckInfo != null ? new WreckInfo(Info.WreckInfo) : null,
Name = Path.GetFileNameWithoutExtension(filePath)
};
#if CLIENT