From 5397560ccc4c10743e02c632428786d04644d289 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sat, 15 Jun 2019 19:45:52 +0300 Subject: [PATCH] (ef7ca3225) Added a debug-only command for teleporting the sub to the start or end of the level. --- Barotrauma/BarotraumaShared/Source/DebugConsole.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs index bc79f5f24..9b84bcb61 100644 --- a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs @@ -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);