Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 2023-11-20-msg
Browse files Browse the repository at this point in the history
  • Loading branch information
metalgearsloth committed Nov 20, 2023
2 parents 5373d8d + c21b6c9 commit 98bdfa7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
10 changes: 7 additions & 3 deletions Robust.Server/BaseServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -660,10 +660,14 @@ public void Cleanup()
{
// Write down exception log
var logPath = _config.GetCVar(CVars.LogPath);
var relPath = PathHelpers.ExecutableRelativeFile(logPath);
Directory.CreateDirectory(relPath);
var pathToWrite = Path.Combine(relPath,
if (!Path.IsPathRooted(logPath))
{
logPath = PathHelpers.ExecutableRelativeFile(logPath);
}

var pathToWrite = Path.Combine(logPath,
"Runtime-" + DateTime.Now.ToString("yyyy-MM-dd-THH-mm-ss") + ".txt");
Directory.CreateDirectory(logPath);
File.WriteAllText(pathToWrite, _runtimeLog.Display(), EncodingHelpers.UTF8);
}

Expand Down
10 changes: 7 additions & 3 deletions Robust.Shared/Console/Commands/MapCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)

internal sealed class ListMapsCommand : LocalizedCommands
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IMapManager _map = default!;

public override string Command => "lsmap";
Expand All @@ -144,10 +145,13 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)

foreach (var mapId in _map.GetAllMapIds().OrderBy(id => id.Value))
{
msg.AppendFormat("{0}: init: {1}, paused: {2}, ent: {3}, grids: {4}\n",
mapId, _map.IsMapInitialized(mapId),
var mapUid = _map.GetMapEntityId(mapId);

msg.AppendFormat("{0}: {1}, init: {2}, paused: {3}, nent: {4}, grids: {5}\n",
mapId, _entManager.GetComponent<MetaDataComponent>(mapUid).EntityName,
_map.IsMapInitialized(mapId),
_map.IsMapPaused(mapId),
_map.GetMapEntityId(mapId),
_entManager.GetNetEntity(_map.GetMapEntityId(mapId)),
string.Join(",", _map.GetAllGrids(mapId).Select(grid => grid.Owner)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/

using System.Numerics;
using Robust.Shared.Maths;
using Robust.Shared.Physics.Collision;

namespace Robust.Shared.Physics.Dynamics.Contacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/

using System.Numerics;
using Robust.Shared.Maths;

namespace Robust.Shared.Physics.Dynamics.Contacts
{
Expand Down
10 changes: 3 additions & 7 deletions Robust.Shared/Physics/Systems/SharedPhysicsSystem.Solver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,8 @@ private void ResetSolver(
velocityConstraint.TangentSpeed = contact.TangentSpeed;
velocityConstraint.IndexA = bodyA.IslandIndex[island.Index];
velocityConstraint.IndexB = bodyB.IslandIndex[island.Index];
velocityConstraint.Points = new VelocityConstraintPoint[2];

for (var j = 0; j < 2; j++)
{
velocityConstraint.Points[j] = new VelocityConstraintPoint();
}
Array.Resize(ref velocityConstraint.Points, 2);
// Don't need to reset point data as it all gets set below.

var (invMassA, invMassB) = GetInvMass(bodyA, bodyB);

Expand All @@ -91,7 +87,7 @@ private void ResetSolver(
(positionConstraint.InvMassA, positionConstraint.InvMassB) = (invMassA, invMassB);
positionConstraint.LocalCenterA = bodyA.LocalCenter;
positionConstraint.LocalCenterB = bodyB.LocalCenter;
positionConstraint.LocalPoints = new Vector2[2];
Array.Resize(ref positionConstraint.LocalPoints, 2);

positionConstraint.InvIA = bodyA.InvI;
positionConstraint.InvIB = bodyB.InvI;
Expand Down

0 comments on commit 98bdfa7

Please sign in to comment.