(ef7ca3225) Added a debug-only command for teleporting the sub to the start or end of the level.

This commit is contained in:
Joonas Rikkonen
2019-06-15 19:45:52 +03:00
parent 4b6a753947
commit 5397560ccc

View File

@@ -648,6 +648,20 @@ namespace Barotrauma
},null));
#if DEBUG
commands.Add(new Command("teleportsub", "teleportsub [start/end]: Teleport the submarine to the start or end of the level. WARNING: does not take outposts into account, so often leads to physics glitches. Only use for debugging.", (string[] args) =>
{
if (Submarine.MainSub == null || Level.Loaded == null) return;
if (args.Length > 0 && args[0].ToLowerInvariant() == "start")
{
Submarine.MainSub.SetPosition(Level.Loaded.StartPosition);
}
else
{
Submarine.MainSub.SetPosition(Level.Loaded.EndPosition);
}
}, isCheat: true));
commands.Add(new Command("waterphysicsparams", "waterphysicsparams [stiffness] [spread] [damping]: defaults 0.02, 0.05, 0.05", (string[] args) =>
{
Vector2 explosionPos = GameMain.GameScreen.Cam.ScreenToWorld(PlayerInput.MousePosition);