Update content for PhysicsMapComponent (#4462)

* Update content for PhysicsMapComponent

* Fix command

* Cache broadphasesystem
This commit is contained in:
metalgearsloth
2021-08-23 15:02:03 +10:00
committed by GitHub
parent c0e9dd1f47
commit 8878f4dc8f
3 changed files with 11 additions and 9 deletions

View File

@@ -113,9 +113,10 @@ namespace Content.Server.Physics
private void SetupPlayer(MapId mapId, IConsoleShell shell, IPlayerSession? player, IMapManager mapManager)
{
if (mapId == MapId.Nullspace) return;
var pauseManager = IoCManager.Resolve<IPauseManager>();
pauseManager.SetMapPaused(mapId, false);
var map = EntitySystem.Get<SharedPhysicsSystem>().Maps[mapId].Gravity = new Vector2(0, -4.9f);
IoCManager.Resolve<IMapManager>().GetMapEntity(mapId).GetComponent<SharedPhysicsMapComponent>().Gravity = new Vector2(0, -4.9f);
return;
}
@@ -353,9 +354,7 @@ namespace Content.Server.Physics
// Box2D has this as 800 which is jesus christo.
// Wouldn't recommend higher than 100 in debug and higher than 300 on release unless
// you really want a profile.
var count = 50;
EntitySystem.Get<SharedPhysicsSystem>().Maps[mapId].Gravity = new Vector2(0f, -9.8f);
var count = 200;
var mapManager = IoCManager.Resolve<IMapManager>();
for (var i = 0; i < count; i++)