diff --git a/Subsurface/Source/Map/Entity.cs b/Subsurface/Source/Map/Entity.cs index 1b0ed6019..b63650196 100644 --- a/Subsurface/Source/Map/Entity.cs +++ b/Subsurface/Source/Map/Entity.cs @@ -18,7 +18,10 @@ namespace Barotrauma public ushort ID { - get { return id; } + get + { + return id; + } set { Entity thisEntity; @@ -122,5 +125,34 @@ namespace Barotrauma { dictionary.Remove(ID); } + + public static void DumpIds(int count) + { + List e = new List(); + + foreach (Entity ent in dictionary.Values) + { + int index = 0; + for (int i = 0; i < e.Count; i++) + { + if (e[i].id < ent.id) + { + index = i; + break; + } + } + + e.Insert(index, ent); + } + + int c = 0; + foreach (Entity ent in e) + { + if (c>count) break; + + DebugConsole.ThrowError(ent.id+": "+ent.ToString()); + c++; + } + } } } diff --git a/Subsurface/Source/Map/Submarine.cs b/Subsurface/Source/Map/Submarine.cs index c9f080fb2..d5ea1d62b 100644 --- a/Subsurface/Source/Map/Submarine.cs +++ b/Subsurface/Source/Map/Submarine.cs @@ -168,6 +168,11 @@ namespace Barotrauma get { return subBody == null ? false : subBody.AtDamageDepth; } } + public override string ToString() + { + return "Barotrauma.Submarine ("+name+")"; + } + //constructors & generation ---------------------------------------------------- public Submarine(string filePath, string hash = "") : base(null) @@ -199,8 +204,8 @@ namespace Barotrauma //this.mapHash = new MapHash(md5Hash); } - base.Remove(); ID = ushort.MaxValue; + base.Remove(); } //drawing ---------------------------------------------------- @@ -218,7 +223,7 @@ namespace Barotrauma for (int i = 0; i < MapEntity.mapEntityList.Count(); i++) { if (MapEntity.mapEntityList[i].Sprite == null || MapEntity.mapEntityList[i].Sprite.Depth < 0.5f) - MapEntity.mapEntityList[i].Draw(spriteBatch, editing); + MapEntity.mapEntityList[i].Draw(spriteBatch, editing, false); } @@ -242,7 +247,7 @@ namespace Barotrauma for (int i = 0; i < MapEntity.mapEntityList.Count(); i++) { if (MapEntity.mapEntityList[i].Sprite == null || MapEntity.mapEntityList[i].Sprite.Depth >= 0.5f) - MapEntity.mapEntityList[i].Draw(spriteBatch, editing); + MapEntity.mapEntityList[i].Draw(spriteBatch, editing, true); } } @@ -680,8 +685,7 @@ namespace Barotrauma GameMain.LightManager.OnMapLoaded(); - ID = ushort.MaxValue-10; - + ID = ushort.MaxValue; } public static Submarine Load(string fileName)