diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj index 96c031f73..d268371f8 100644 --- a/Subsurface/Barotrauma.csproj +++ b/Subsurface/Barotrauma.csproj @@ -60,6 +60,8 @@ + + @@ -90,6 +92,7 @@ + @@ -868,6 +871,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Subsurface/Content/Items/Diving/DivingSuit.png b/Subsurface/Content/Items/Diving/DivingSuit.png index ece1b6d2a..dd3b89846 100644 Binary files a/Subsurface/Content/Items/Diving/DivingSuit.png and b/Subsurface/Content/Items/Diving/DivingSuit.png differ diff --git a/Subsurface/Content/Items/Diving/divinggear.xml b/Subsurface/Content/Items/Diving/divinggear.xml index 1fe544707..23bc6013d 100644 --- a/Subsurface/Content/Items/Diving/divinggear.xml +++ b/Subsurface/Content/Items/Diving/divinggear.xml @@ -40,7 +40,6 @@ - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Subsurface/Content/Items/Diving/scooter.ogg b/Subsurface/Content/Items/Diving/scooter.ogg new file mode 100644 index 000000000..523b453f7 Binary files /dev/null and b/Subsurface/Content/Items/Diving/scooter.ogg differ diff --git a/Subsurface/Content/Items/Tools/tools.xml b/Subsurface/Content/Items/Tools/tools.xml index d321b66eb..1704af206 100644 --- a/Subsurface/Content/Items/Tools/tools.xml +++ b/Subsurface/Content/Items/Tools/tools.xml @@ -12,7 +12,7 @@ - @@ -56,7 +56,7 @@ - diff --git a/Subsurface/Content/Items/Weapons/weapons.xml b/Subsurface/Content/Items/Weapons/weapons.xml index b4a5ff050..5d5bb074a 100644 --- a/Subsurface/Content/Items/Weapons/weapons.xml +++ b/Subsurface/Content/Items/Weapons/weapons.xml @@ -26,7 +26,8 @@ - + diff --git a/Subsurface/Content/Lights/visioncircle.png b/Subsurface/Content/Lights/visioncircle.png index 39ff2ecb3..1d6985101 100644 Binary files a/Subsurface/Content/Lights/visioncircle.png and b/Subsurface/Content/Lights/visioncircle.png differ diff --git a/Subsurface/Source/Characters/AI/Objectives/AIObjective.cs b/Subsurface/Source/Characters/AI/Objectives/AIObjective.cs new file mode 100644 index 000000000..f073fb06a --- /dev/null +++ b/Subsurface/Source/Characters/AI/Objectives/AIObjective.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Barotrauma +{ + class AIObjective + { + protected List subObjectives; + + public virtual bool IsCompleted() + { + return true; + } + + public AIObjective() + { + subObjectives = new List(); + } + + /// + /// makes the character act according to the objective, or according to any subobjectives that + /// need to be completed before this one (starting from the one with the highest priority) + /// + /// the character who's trying to achieve the objective + public void TryComplete(float deltaTime, Character character) + { + foreach (AIObjective objective in subObjectives) + { + if (objective.IsCompleted()) continue; + + objective.TryComplete(deltaTime, character); + return; + } + + Act(deltaTime, character); + } + + protected virtual void Act(float deltaTime, Character character) { } + } +} diff --git a/Subsurface/Source/Characters/AI/Objectives/AIObjectiveOperateItem.cs b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveOperateItem.cs new file mode 100644 index 000000000..f1459595a --- /dev/null +++ b/Subsurface/Source/Characters/AI/Objectives/AIObjectiveOperateItem.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Barotrauma +{ + class AIObjectiveOperateItem : AIObjective + { + private Item targetItem; + + public AIObjectiveOperateItem(Item item) + { + targetItem = item; + } + + protected override void Act(float deltaTime, Character character) + { + //item.AIOperate(float deltaTime, Character character) or something + } + } +} diff --git a/Subsurface/Source/Characters/HumanoidAnimController.cs b/Subsurface/Source/Characters/HumanoidAnimController.cs index 23f622cc1..2e60657b6 100644 --- a/Subsurface/Source/Characters/HumanoidAnimController.cs +++ b/Subsurface/Source/Characters/HumanoidAnimController.cs @@ -787,6 +787,8 @@ namespace Barotrauma public override void HoldItem(float deltaTime, Item item, Vector2[] handlePos, Vector2 holdPos, Vector2 aimPos, bool aim, float holdAngle) { + Holdable holdable = item.GetComponent(); + //calculate the handle positions Matrix itemTransfrom = Matrix.CreateRotationZ(item.body.Rotation); Vector2[] transformedHandlePos = new Vector2[2]; @@ -808,19 +810,23 @@ namespace Barotrauma Vector2 diff = (mousePos - torso.SimPosition) * Dir; holdAngle = MathUtils.VectorToAngle(new Vector2(diff.X, diff.Y * Dir)) - torso.body.Rotation * Dir; - holdAngle = MathHelper.Clamp(MathUtils.WrapAnglePi(holdAngle), -1.3f, 1.0f); + //holdAngle = MathHelper.Clamp(MathUtils.WrapAnglePi(holdAngle), -1.3f, 1.0f); itemAngle = (torso.body.Rotation + holdAngle * Dir); - head.body.SmoothRotate(itemAngle); - - if (TargetMovement == Vector2.Zero && inWater) + if (holdable.ControlPose) { - torso.body.AngularVelocity -= torso.body.AngularVelocity * 0.1f; - torso.body.ApplyForce(torso.body.LinearVelocity * -0.5f); + head.body.SmoothRotate(itemAngle); + + if (TargetMovement == Vector2.Zero && inWater) + { + torso.body.AngularVelocity -= torso.body.AngularVelocity * 0.1f; + torso.body.ApplyForce(torso.body.LinearVelocity * -0.5f); + } + + aiming = true; } - aiming = true; } else { @@ -945,23 +951,25 @@ namespace Barotrauma } } - foreach (Limb l in Limbs) + foreach (Limb limb in Limbs) { - switch (l.type) + switch (limb.type) { case LimbType.LeftHand: case LimbType.LeftArm: case LimbType.RightHand: case LimbType.RightArm: - difference = l.body.SimPosition - torso.SimPosition; + difference = limb.body.SimPosition - torso.SimPosition; difference = Vector2.Transform(difference, torsoTransform); difference.Y = -difference.Y; - l.body.SetTransform(torso.SimPosition + Vector2.Transform(difference, -torsoTransform), -l.body.Rotation); + TrySetLimbPosition(limb, limb.SimPosition, torso.SimPosition + Vector2.Transform(difference, -torsoTransform)); + + limb.body.SetTransform(limb.body.SimPosition, -limb.body.Rotation); break; default: - if (!inWater) l.body.SetTransform(l.body.SimPosition, - MathUtils.WrapAnglePi(l.body.Rotation * (l.DoesFlip ? -1.0f : 1.0f))); + if (!inWater) limb.body.SetTransform(limb.body.SimPosition, + MathUtils.WrapAnglePi(limb.body.Rotation * (limb.DoesFlip ? -1.0f : 1.0f))); break; } } diff --git a/Subsurface/Source/Characters/Ragdoll.cs b/Subsurface/Source/Characters/Ragdoll.cs index d22e94010..b135b5da1 100644 --- a/Subsurface/Source/Characters/Ragdoll.cs +++ b/Subsurface/Source/Characters/Ragdoll.cs @@ -671,7 +671,7 @@ namespace Barotrauma } } - private void TrySetLimbPosition(Limb limb, Vector2 original, Vector2 simPosition) + protected void TrySetLimbPosition(Limb limb, Vector2 original, Vector2 simPosition) { if (original == simPosition) return; diff --git a/Subsurface/Source/DebugConsole.cs b/Subsurface/Source/DebugConsole.cs index 494f40452..0cc60d9fc 100644 --- a/Subsurface/Source/DebugConsole.cs +++ b/Subsurface/Source/DebugConsole.cs @@ -305,6 +305,7 @@ namespace Barotrauma case "loadsub": case "load": if (commands.Length < 2) break; + Submarine.Load(string.Join(" ", commands.Skip(1))); break; case "cleansub": diff --git a/Subsurface/Source/Items/CharacterInventory.cs b/Subsurface/Source/Items/CharacterInventory.cs index 3ba043613..844f127da 100644 --- a/Subsurface/Source/Items/CharacterInventory.cs +++ b/Subsurface/Source/Items/CharacterInventory.cs @@ -357,17 +357,11 @@ namespace Barotrauma public override bool FillNetworkData(NetworkEventType type, NetBuffer message, object data) { - for (int i = 0; i < 5; i++ ) + for (int i = 0; i < capacity; i++) { message.Write(items[i]==null ? (ushort)0 : (ushort)items[i].ID); } - - for (int i = 5; i < capacity; i++) - { - if (items[i] == null) continue; - message.Write((ushort)items[i].ID); - } - + return true; } @@ -375,7 +369,7 @@ namespace Barotrauma { character.ClearInput(InputType.Use); - for (int i = 0; i<5; i++) + for (int i = 0; i newItemIDs = new List(); - - for (int i = 5; i < capacity; i++) - { - newItemIDs.Add(message.ReadUInt16()); - } - - - for (int i = 5; i < capacity; i++) - { - if (items[i] == null) continue; - if (!newItemIDs.Contains(items[i].ID)) - { - items[i].Drop(null, false); - continue; - } - } - foreach (ushort itemId in newItemIDs) - { - Item item = Entity.FindEntityByID(itemId) as Item; - if (item == null) continue; - - TryPutItem(item, LimbSlot.Any, false); - } } } diff --git a/Subsurface/Source/Items/Components/Holdable/Holdable.cs b/Subsurface/Source/Items/Components/Holdable/Holdable.cs index e381d9b36..f71137add 100644 --- a/Subsurface/Source/Items/Components/Holdable/Holdable.cs +++ b/Subsurface/Source/Items/Components/Holdable/Holdable.cs @@ -19,7 +19,7 @@ namespace Barotrauma.Items.Components protected Vector2 aimPos; - protected bool aimable; + //protected bool aimable; private bool attachable, attached, attachedByDefault; private PhysicsBody body; @@ -35,10 +35,10 @@ namespace Barotrauma.Items.Components } [HasDefaultValue(false, false)] - public bool Aimable + public bool ControlPose { - get { return aimable; } - set { aimable = value; } + get; + set; } [HasDefaultValue(false, false)] diff --git a/Subsurface/Source/Items/Components/Holdable/Propulsion.cs b/Subsurface/Source/Items/Components/Holdable/Propulsion.cs new file mode 100644 index 000000000..308db79e7 --- /dev/null +++ b/Subsurface/Source/Items/Components/Holdable/Propulsion.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Xml.Linq; +using FarseerPhysics; +using FarseerPhysics.Dynamics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Barotrauma.Particles; + +namespace Barotrauma.Items.Components +{ + class Propulsion : ItemComponent + { + private float force; + + private string particles; + + private ParticlePrefab.DrawTargetType usableIn; + + [HasDefaultValue(0.0f, false)] + public float Force + { + get { return force; } + set { force = value; } + } + + [HasDefaultValue("", false)] + public string Particles + { + get { return particles; } + set { particles = value; } + } + + public Propulsion(Item item, XElement element) + : base(item,element) + { + switch (ToolBox.GetAttributeString(element, "usablein", "air").ToLower()) + { + case "air": + usableIn = ParticlePrefab.DrawTargetType.Air; + break; + case "water": + usableIn = ParticlePrefab.DrawTargetType.Water; + break; + default: + usableIn = ParticlePrefab.DrawTargetType.Both; + break; + } + } + + public override bool Use(float deltaTime, Character character = null) + { + if (character == null) return false; + if (!character.IsKeyDown(InputType.Aim)) return false; + + if (item.InWater) + { + if (usableIn == ParticlePrefab.DrawTargetType.Air) return true; + } + else + { + if (usableIn == ParticlePrefab.DrawTargetType.Water) return true; + } + + Vector2 dir = Vector2.Normalize(character.CursorPosition - character.Position); + + Vector2 propulsion = dir * force; + + if (character.AnimController.InWater) character.AnimController.TargetMovement = dir; + + if (item.body.Enabled && false) + { + item.body.ApplyForce(propulsion); + } + else + { + foreach (Limb limb in character.AnimController.Limbs) + { + if (limb.WearingItem==null || limb.WearingItem.Item != item) continue; + + limb.body.ApplyForce(propulsion); + } + + if (character.SelectedItems[0] == item) character.AnimController.GetLimb(LimbType.RightHand).body.ApplyForce(propulsion); + + if (character.SelectedItems[1] == item) character.AnimController.GetLimb(LimbType.LeftHand).body.ApplyForce(propulsion); + } + + if (!string.IsNullOrWhiteSpace(particles)) + { + GameMain.ParticleManager.CreateParticle(particles, item.Position, + item.body.Rotation + ((item.body.Dir > 0.0f) ? 0.0f : MathHelper.Pi), 0.0f); + } + + return true; + } + + public override void Draw(SpriteBatch spriteBatch, bool editing) + { + if (!IsActive) return; + + //Vector2 particleSpeed = new Vector2( + // (float)Math.Cos(item.body.Rotation), + // (float)Math.Sin(item.body.Rotation)) *item.body.Dir * 0.1f; + + + + + //Vector2 startPos = ConvertUnits.ToDisplayUnits(item.body.Position); + //Vector2 endPos = ConvertUnits.ToDisplayUnits(pickedPosition); + //endPos = new Vector2(endPos.X + Game1.localRandom.Next(-2, 2), endPos.Y + Game1.localRandom.Next(-2, 2)); + + //GUI.DrawLine(spriteBatch, startPos, endPos, Color.Orange, 0.0f); + + IsActive = false; + } + + + } +} diff --git a/Subsurface/Source/Items/Components/Signal/WaterDetector.cs b/Subsurface/Source/Items/Components/Signal/WaterDetector.cs index 8aab2f40f..9bd7de3f3 100644 --- a/Subsurface/Source/Items/Components/Signal/WaterDetector.cs +++ b/Subsurface/Source/Items/Components/Signal/WaterDetector.cs @@ -4,35 +4,15 @@ namespace Barotrauma.Items.Components { class WaterDetector : ItemComponent { - private Hull hull; - public WaterDetector(Item item, XElement element) : base (item, element) { - hull = Hull.FindHull(item.Position); - IsActive = true; } - public override void OnMapLoaded() - { - hull = Hull.FindHull(item.Position); - } - - public override void Move(Microsoft.Xna.Framework.Vector2 amount) - { - hull = Hull.FindHull(item.Position); - } - public override void Update(float deltaTime, Camera cam) { - if (hull == null) return; - - float waterDepth = hull.Volume / hull.Size.X; - - bool underWater = (hull.Rect.Y-hull.Rect.Height + waterDepth)>item.Position.Y; - - item.SendSignal(underWater ? "1" : "0", "signal_out"); + item.SendSignal(item.InWater ? "1" : "0", "signal_out"); } } } diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index 1868bee07..9ef58891a 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -58,6 +58,8 @@ namespace Barotrauma private float condition; + private bool inWater; + //the inventory in which the item is contained in public Inventory inventory; @@ -153,6 +155,18 @@ namespace Barotrauma get { return prefab.FireProof; } } + public bool InWater + { + get + { + //if the item has an active physics body, inWater is updated in the Update method + if (body != null && body.Enabled) return inWater; + + //if not, we'll just have to check + return IsInWater(); + } + } + public bool Updated { set @@ -501,6 +515,15 @@ namespace Barotrauma return new AttackResult(damageAmount, 0.0f, false); } + private bool IsInWater() + { + if (CurrentHull == null) return true; + + float surfaceY = CurrentHull.Surface; + + return Position.Y < surfaceY; + } + public override void Update(Camera cam, float deltaTime) { @@ -545,30 +568,7 @@ namespace Barotrauma body.SetToTargetPosition(); - bool inWater = true; - - if (CurrentHull != null) - { - float surfaceY = ConvertUnits.ToSimUnits(CurrentHull.Surface); - - if (body.SimPosition.Y < surfaceY ) - { - inWater = true; - - //the item has gone through the surface of the water -> apply an impulse which serves as surface tension - //if (body.SimPosition.Y - (body.LinearVelocity.Y / 60.0f) < surfaceY) - //{ - // Vector2 impulse = -body.LinearVelocity * (body.Mass / body.Density); - // body.ApplyLinearImpulse(impulse); - // int n = (int)((ConvertUnits.ToDisplayUnits(body.SimPosition.X) - CurrentHull.Rect.X) / Hull.WaveWidth); - // CurrentHull.WaveVel[n] = impulse.Y * 10.0f; - //} - } - else - { - inWater = false; - } - } + inWater = IsInWater(); if (!inWater) return; diff --git a/Subsurface/Source/Map/Lights/LightManager.cs b/Subsurface/Source/Map/Lights/LightManager.cs index 88538b3bd..8633e2722 100644 --- a/Subsurface/Source/Map/Lights/LightManager.cs +++ b/Subsurface/Source/Map/Lights/LightManager.cs @@ -169,7 +169,7 @@ namespace Barotrauma.Lights Vector2 scale = new Vector2(MathHelper.Clamp(diff.Length()/256.0f, 2.0f, 5.0f), 2.0f); - spriteBatch.Draw(LightSource.LightTexture, new Vector2(ViewPos.X, -ViewPos.Y), null, Color.White, rotation, + spriteBatch.Draw(visionCircle, new Vector2(ViewPos.X, -ViewPos.Y), null, Color.White, rotation, new Vector2(LightSource.LightTexture.Width*0.2f, LightSource.LightTexture.Height/2), scale, SpriteEffects.None, 0.0f); spriteBatch.End(); diff --git a/Subsurface/Source/Networking/GameClient.cs b/Subsurface/Source/Networking/GameClient.cs index 4f7f772b2..98b0b11ff 100644 --- a/Subsurface/Source/Networking/GameClient.cs +++ b/Subsurface/Source/Networking/GameClient.cs @@ -682,7 +682,7 @@ namespace Barotrauma.Networking public bool SpectateClicked(GUIButton button, object userData) { NetOutgoingMessage msg = client.CreateMessage(); - msg.Write((byte)PacketTypes.Spectate); + msg.Write((byte)PacketTypes.SpectateRequest); client.SendMessage(msg, NetDeliveryMethod.ReliableUnordered); diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 2cecb332f..2343dab0c 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -460,11 +460,13 @@ namespace Barotrauma.Networking case (byte)PacketTypes.Vote: Voting.RegisterVote(inc, ConnectedClients); break; - case (byte)PacketTypes.Spectate: + case (byte)PacketTypes.SpectateRequest: if (gameStarted) { var startMessage = CreateStartMessage(roundStartSeed, Submarine.Loaded, GameMain.GameSession.gameMode.Preset); server.SendMessage(startMessage, inc.SenderConnection, NetDeliveryMethod.ReliableUnordered); + + dataSender.Spectating = true; } break; } @@ -674,9 +676,6 @@ namespace Barotrauma.Networking GameMain.GameSession = new GameSession(selectedSub, "", selectedMode); GameMain.GameSession.StartShift(GameMain.NetLobbyScreen.LevelSeed); - var startMessage = CreateStartMessage(roundStartSeed, Submarine.Loaded, GameMain.GameSession.gameMode.Preset); - SendMessage(startMessage, NetDeliveryMethod.ReliableUnordered); - yield return CoroutineStatus.Running; List characterInfos = new List(); @@ -717,6 +716,10 @@ namespace Barotrauma.Networking myCharacter.GiveJobItems(assignedWayPoints[assignedWayPoints.Length - 1]); } + var startMessage = CreateStartMessage(roundStartSeed, Submarine.Loaded, GameMain.GameSession.gameMode.Preset); + SendMessage(startMessage, NetDeliveryMethod.ReliableUnordered); + + yield return CoroutineStatus.Running; UpdateCrewFrame(); @@ -761,7 +764,7 @@ namespace Barotrauma.Networking if (myCharacter != null) { msg.Write(-1); - WriteCharacterData(msg, myCharacter.Info.Name, Character.Controlled); + WriteCharacterData(msg, myCharacter.Info.Name, myCharacter); } return msg; @@ -799,6 +802,7 @@ namespace Barotrauma.Networking foreach (Client client in ConnectedClients) { + client.Spectating = false; client.Character = null; client.inGame = false; } @@ -1328,6 +1332,8 @@ namespace Barotrauma.Networking public List jobPreferences; public JobPrefab assignedJob; + public bool Spectating; + public ReliableChannel ReliableChannel; public float deleteDisconnectedTimer; diff --git a/Subsurface/Source/Networking/NetworkEvent.cs b/Subsurface/Source/Networking/NetworkEvent.cs index 14a930ea9..f14824c73 100644 --- a/Subsurface/Source/Networking/NetworkEvent.cs +++ b/Subsurface/Source/Networking/NetworkEvent.cs @@ -192,7 +192,6 @@ namespace Barotrauma.Networking } Entity e = Entity.FindEntityByID(id); - System.Diagnostics.Debug.WriteLine(e.ToString()); if (e == null) { #if DEBUG @@ -201,6 +200,9 @@ namespace Barotrauma.Networking return false; } + + System.Diagnostics.Debug.WriteLine(e.ToString()); + object data; try diff --git a/Subsurface/Source/Networking/NetworkMember.cs b/Subsurface/Source/Networking/NetworkMember.cs index e8b967505..f194caf36 100644 --- a/Subsurface/Source/Networking/NetworkMember.cs +++ b/Subsurface/Source/Networking/NetworkMember.cs @@ -29,7 +29,7 @@ namespace Barotrauma.Networking ResendRequest, ReliableMessage, LatestMessageID, - Spectate + SpectateRequest } enum VoteType diff --git a/Subsurface/Source/Particles/Particle.cs b/Subsurface/Source/Particles/Particle.cs index 0d9f15e22..f335ba4b4 100644 --- a/Subsurface/Source/Particles/Particle.cs +++ b/Subsurface/Source/Particles/Particle.cs @@ -160,15 +160,7 @@ namespace Barotrauma.Particles if ((prefab.DeleteOnCollision || prefab.CollidesWithWalls) && currentHull!=null) { - Vector2 edgePos = position + prefab.Sprites[spriteIndex].SourceRect.Width * Vector2.Normalize(velocity) * size.X; - //bool insideHull = false; - //foreach (Hull hull in hullLimits) - //{ - // if (!Submarine.RectContains(hull.Rect, edgePos)) continue; - - // insideHull = true; - // break; - //} + Vector2 edgePos = position + prefab.CollisionRadius * Vector2.Normalize(velocity) * size.X; if (!Submarine.RectContains(currentHull.Rect, edgePos)) { diff --git a/Subsurface/Source/Particles/ParticlePrefab.cs b/Subsurface/Source/Particles/ParticlePrefab.cs index 0a8be8995..7ac47323f 100644 --- a/Subsurface/Source/Particles/ParticlePrefab.cs +++ b/Subsurface/Source/Particles/ParticlePrefab.cs @@ -29,6 +29,7 @@ namespace Barotrauma.Particles public readonly float GrowTime; + public readonly float CollisionRadius; public readonly bool DeleteOnCollision; public readonly bool CollidesWithWalls; @@ -122,7 +123,9 @@ namespace Barotrauma.Particles StartAlpha = ToolBox.GetAttributeFloat(element, "startalpha", 1.0f); DeleteOnCollision = ToolBox.GetAttributeBool(element, "deleteoncollision", false); - CollidesWithWalls = ToolBox.GetAttributeBool(element, "collideswithwalls", false); + CollidesWithWalls = ToolBox.GetAttributeBool(element, "collideswithwalls", false); + + CollisionRadius = ToolBox.GetAttributeFloat(element, "collisionradius", Sprites[0].SourceRect.Width/2.0f); ColorChange = ToolBox.GetAttributeVector4(element, "colorchange", Vector4.Zero); diff --git a/Subsurface/Source/Screens/EditMapScreen.cs b/Subsurface/Source/Screens/EditMapScreen.cs index c354f30e2..e20bb27b9 100644 --- a/Subsurface/Source/Screens/EditMapScreen.cs +++ b/Subsurface/Source/Screens/EditMapScreen.cs @@ -221,6 +221,11 @@ namespace Barotrauma if (characterMode) { + if (Entity.FindEntityByID(dummyCharacter.ID)!=dummyCharacter) + { + ToggleCharacterMode(null, null); + } + foreach (MapEntity me in MapEntity.mapEntityList) { me.IsHighlighted = false; diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 0637bc213..24d32ac2e 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ