diff --git a/Subsurface/Barotrauma.csproj.user b/Subsurface/Barotrauma.csproj.user
index 1782abafa..df35fcf91 100644
--- a/Subsurface/Barotrauma.csproj.user
+++ b/Subsurface/Barotrauma.csproj.user
@@ -9,7 +9,7 @@
en-US
false
- ShowAllFiles
+ ProjectFiles
diff --git a/Subsurface/Content/Characters/TigerThresher/tigerthresher.xml b/Subsurface/Content/Characters/TigerThresher/tigerthresher.xml
index ad1761c38..c401e5d51 100644
--- a/Subsurface/Content/Characters/TigerThresher/tigerthresher.xml
+++ b/Subsurface/Content/Characters/TigerThresher/tigerthresher.xml
@@ -30,7 +30,7 @@
-
+
diff --git a/Subsurface/Content/Items/Button/button.xml b/Subsurface/Content/Items/Button/button.xml
index 47510268a..e89794e0d 100644
--- a/Subsurface/Content/Items/Button/button.xml
+++ b/Subsurface/Content/Items/Button/button.xml
@@ -15,12 +15,12 @@
-
+
-
diff --git a/Subsurface/Content/Items/Door/doors.xml b/Subsurface/Content/Items/Door/doors.xml
index 7e1d1e859..298acf04d 100644
--- a/Subsurface/Content/Items/Door/doors.xml
+++ b/Subsurface/Content/Items/Door/doors.xml
@@ -19,7 +19,7 @@
-
+
@@ -48,7 +48,7 @@
-
+
diff --git a/Subsurface/Content/Items/Electricity/lights.xml b/Subsurface/Content/Items/Electricity/lights.xml
index 34d48a133..85da571ab 100644
--- a/Subsurface/Content/Items/Electricity/lights.xml
+++ b/Subsurface/Content/Items/Electricity/lights.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/Subsurface/Content/Items/Electricity/poweritems.xml b/Subsurface/Content/Items/Electricity/poweritems.xml
index 7f58f6b74..52f63dcc0 100644
--- a/Subsurface/Content/Items/Electricity/poweritems.xml
+++ b/Subsurface/Content/Items/Electricity/poweritems.xml
@@ -17,7 +17,7 @@
-
+
@@ -45,7 +45,7 @@
-
+
@@ -69,7 +69,7 @@
-
+
diff --git a/Subsurface/Content/Items/Electricity/signalitems.xml b/Subsurface/Content/Items/Electricity/signalitems.xml
index 6f4f3ea07..9e138f855 100644
--- a/Subsurface/Content/Items/Electricity/signalitems.xml
+++ b/Subsurface/Content/Items/Electricity/signalitems.xml
@@ -80,13 +80,13 @@
-
-
+
@@ -108,12 +108,12 @@
-
-
+
@@ -135,12 +135,12 @@
-
-
+
@@ -163,11 +163,11 @@
-
+
-
+
@@ -188,12 +188,12 @@
-
-
+
@@ -212,12 +212,12 @@
-
-
+
@@ -239,12 +239,12 @@
-
-
+
@@ -264,12 +264,12 @@
-
-
+
diff --git a/Subsurface/Content/Items/Engine/engine.xml b/Subsurface/Content/Items/Engine/engine.xml
index c1daaaa47..a14c67887 100644
--- a/Subsurface/Content/Items/Engine/engine.xml
+++ b/Subsurface/Content/Items/Engine/engine.xml
@@ -13,7 +13,7 @@
-
+
@@ -38,7 +38,7 @@
-
+
@@ -46,4 +46,23 @@
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Subsurface/Content/Items/MiniMap/item.xml b/Subsurface/Content/Items/MiniMap/item.xml
index b898d70f4..463c391d3 100644
--- a/Subsurface/Content/Items/MiniMap/item.xml
+++ b/Subsurface/Content/Items/MiniMap/item.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/Subsurface/Content/Items/OxygenGenerator/oxygengenerator.xml b/Subsurface/Content/Items/OxygenGenerator/oxygengenerator.xml
index 96501ab14..1fc53de08 100644
--- a/Subsurface/Content/Items/OxygenGenerator/oxygengenerator.xml
+++ b/Subsurface/Content/Items/OxygenGenerator/oxygengenerator.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/Subsurface/Content/Items/Pump/pump.xml b/Subsurface/Content/Items/Pump/pump.xml
index 782671806..8ce2ecfdb 100644
--- a/Subsurface/Content/Items/Pump/pump.xml
+++ b/Subsurface/Content/Items/Pump/pump.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/Subsurface/Content/Items/Reactor/reactor.xml b/Subsurface/Content/Items/Reactor/reactor.xml
index c23c90635..7ace14c21 100644
--- a/Subsurface/Content/Items/Reactor/reactor.xml
+++ b/Subsurface/Content/Items/Reactor/reactor.xml
@@ -31,7 +31,7 @@
-
+
diff --git a/Subsurface/Content/Items/Weapons/explosives.xml b/Subsurface/Content/Items/Weapons/explosives.xml
index f23a12245..b5f5c269a 100644
--- a/Subsurface/Content/Items/Weapons/explosives.xml
+++ b/Subsurface/Content/Items/Weapons/explosives.xml
@@ -12,7 +12,7 @@
-
+
@@ -27,7 +27,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
diff --git a/Subsurface/Properties/AssemblyInfo.cs b/Subsurface/Properties/AssemblyInfo.cs
index 61b22b369..caaef8883 100644
--- a/Subsurface/Properties/AssemblyInfo.cs
+++ b/Subsurface/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.0.0.1")]
-[assembly: AssemblyFileVersion("0.0.0.1")]
+[assembly: AssemblyVersion("0.2.3.0")]
+[assembly: AssemblyFileVersion("0.2.3.0")]
diff --git a/Subsurface/Source/Characters/AICharacter.cs b/Subsurface/Source/Characters/AICharacter.cs
index 442662e78..6ea38dab6 100644
--- a/Subsurface/Source/Characters/AICharacter.cs
+++ b/Subsurface/Source/Characters/AICharacter.cs
@@ -165,8 +165,8 @@ namespace Barotrauma
try
{
targetDir = message.ReadBoolean();
- targetMovement.X = message.ReadRangedSingle(-10.0f, 10.0f, 8);
- targetMovement.Y = message.ReadRangedSingle(-10.0f, 10.0f, 8);
+ targetMovement.X = message.ReadRangedSingle(-10.0f, 10.0f, 16);
+ targetMovement.Y = message.ReadRangedSingle(-10.0f, 10.0f, 16);
}
catch
@@ -236,7 +236,7 @@ namespace Barotrauma
catch { return; }
-
+ //error
AnimController.RefLimb.body.TargetPosition = pos;
AnimController.RefLimb.body.TargetVelocity = vel;
diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs
index d310dfcab..d8e9835a5 100644
--- a/Subsurface/Source/Characters/Character.cs
+++ b/Subsurface/Source/Characters/Character.cs
@@ -626,8 +626,7 @@ namespace Barotrauma
selectedCharacter = null;
- if (createNetworkEvent)
- new NetworkEvent(NetworkEventType.SelectCharacter, ID, true, 0);
+ if (createNetworkEvent) new NetworkEvent(NetworkEventType.SelectCharacter, ID, true, (ushort)0);
}
///
@@ -723,9 +722,10 @@ namespace Barotrauma
if (closestItem != null)
{
closestItem.IsHighlighted = true;
- if (GetInputState(InputType.Select) && closestItem.Pick(this, false))
+ if (closestItem.Pick(this))
{
- new NetworkEvent(NetworkEventType.PickItem, ID, true, closestItem.ID);
+ new NetworkEvent(NetworkEventType.PickItem, ID, true,
+ new int[] { closestItem.ID, GetInputState(InputType.Select) ? 1 : 0, GetInputState(InputType.ActionHit) ? 1 : 0 });
}
}
}
@@ -801,7 +801,7 @@ namespace Barotrauma
if (!(this is AICharacter)) Control(deltaTime, cam);
UpdateSightRange();
- aiTarget.SoundRange = 0.0f;
+ if (aiTarget != null) aiTarget.SoundRange = 0.0f;
lowPassMultiplier = MathHelper.Lerp(lowPassMultiplier, 1.0f, 0.1f);
@@ -830,6 +830,8 @@ namespace Barotrauma
private void UpdateSightRange()
{
+ if (aiTarget == null) return;
+
aiTarget.SightRange = 0.0f;
//distance is approximated based on the mass of the character
@@ -1088,10 +1090,17 @@ namespace Barotrauma
{
if (type == NetworkEventType.PickItem)
{
- message.Write((ushort)data);
+ int[] pickData = (int[])data;
+ if (pickData.Length != 3) return false;
+
+ message.Write((ushort)pickData[0]);
+ message.Write((int)pickData[1] == 1);
+ message.Write((int)pickData[2] == 1);
+ message.WritePadBits();
+
return true;
}
- else if (type== NetworkEventType.SelectCharacter)
+ else if (type == NetworkEventType.SelectCharacter)
{
message.Write((ushort)data);
return true;
@@ -1193,12 +1202,15 @@ namespace Barotrauma
itemId = message.ReadUInt16();
+ bool pickHit = message.ReadBoolean();
+ bool actionHit = message.ReadBoolean();
+
System.Diagnostics.Debug.WriteLine("item id: "+itemId);
Item item = FindEntityByID(itemId) as Item;
if (item != null)
{
- item.Pick(this);
+ item.Pick(this, false, pickHit, actionHit);
}
return;
@@ -1249,9 +1261,9 @@ namespace Barotrauma
bool hasInputs = message.ReadBoolean();
sendingTime = message.ReadFloat();
- if (!hasInputs && sendingTime > LastNetworkUpdate)
+ if (!hasInputs)
{
- ClearInputs();
+ if (sendingTime > LastNetworkUpdate) ClearInputs();
return;
}
@@ -1266,7 +1278,7 @@ namespace Barotrauma
runState = message.ReadBoolean();
}
- catch
+ catch (Exception e)
{
return;
}
@@ -1310,7 +1322,7 @@ namespace Barotrauma
}
if (secondaryKeyState)
{
- cursorPosition = cursorPos;
+ cursorPosition = MathUtils.IsValid(cursorPos) ? cursorPos : Vector2.Zero;
}
else
{
diff --git a/Subsurface/Source/Characters/Ragdoll.cs b/Subsurface/Source/Characters/Ragdoll.cs
index d36eb7595..b2cd94834 100644
--- a/Subsurface/Source/Characters/Ragdoll.cs
+++ b/Subsurface/Source/Characters/Ragdoll.cs
@@ -531,7 +531,15 @@ namespace Barotrauma
{
if (limb.ignoreCollisions) continue;
- limb.body.CollidesWith = collisionCategory;
+ try
+ {
+ limb.body.CollidesWith = collisionCategory;
+ }
+ catch (Exception e)
+ {
+ DebugConsole.ThrowError("Failed to update ragdoll limb collisioncategories", e);
+ }
+
}
}
diff --git a/Subsurface/Source/Events/Quests/Quest.cs b/Subsurface/Source/Events/Quests/Quest.cs
index ed5475533..3e21fab28 100644
--- a/Subsurface/Source/Events/Quests/Quest.cs
+++ b/Subsurface/Source/Events/Quests/Quest.cs
@@ -159,15 +159,15 @@ namespace Barotrauma
public void GiveReward()
{
+ if (!string.IsNullOrWhiteSpace(successMessage))
+ {
+ new GUIMessageBox("Quest completed successfully", successMessage);
+ }
+
var mode = GameMain.GameSession.gameMode as SinglePlayerMode;
if (mode == null) return;
mode.Money += reward;
-
- if (!string.IsNullOrWhiteSpace(successMessage))
- {
- new GUIMessageBox("Quest completed", successMessage);
- }
}
}
}
diff --git a/Subsurface/Source/GUI/GUIComponent.cs b/Subsurface/Source/GUI/GUIComponent.cs
index 0e749962f..b793b4d3b 100644
--- a/Subsurface/Source/GUI/GUIComponent.cs
+++ b/Subsurface/Source/GUI/GUIComponent.cs
@@ -185,10 +185,10 @@ namespace Barotrauma
public bool IsParentOf(GUIComponent component)
{
- foreach (GUIComponent child in children)
+ for(int i = children.Count - 1; i >= 0; i--)
{
- if (child == component) return true;
- if (child.IsParentOf(component)) return true;
+ if (children[i] == component) return true;
+ if (children[i].IsParentOf(component)) return true;
}
return false;
diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs
index 95655eae0..77faa8aa2 100644
--- a/Subsurface/Source/GameMain.cs
+++ b/Subsurface/Source/GameMain.cs
@@ -305,7 +305,8 @@ namespace Barotrauma
if (titleScreenOpen)
{
TitleScreen.Draw(spriteBatch, GraphicsDevice, (float)deltaTime);
- if (TitleScreen.LoadState>=100.0f && (PlayerInput.GetKeyboardState.GetPressedKeys().Length>0 || PlayerInput.LeftButtonClicked()))
+ if (TitleScreen.LoadState>=100.0f &&
+ (!waitForKeyHit || PlayerInput.GetKeyboardState.GetPressedKeys().Length>0 || PlayerInput.LeftButtonClicked()))
{
titleScreenOpen = false;
}
@@ -325,8 +326,10 @@ namespace Barotrauma
Stopwatch sw;
- public static void ShowLoading(IEnumerable