Attachable items aren't automatically attached when loading a sub in edit screen, bunch of new item sprites, Aegir Mark II, client reconnect bugfixes

This commit is contained in:
Regalis
2015-09-27 15:46:55 +03:00
parent da00b083ed
commit c8ee9e085f
30 changed files with 249 additions and 149 deletions
@@ -101,7 +101,7 @@ namespace Subsurface.Items.Components
Msg = "";
}
if (attachedByDefault || Screen.Selected == GameMain.EditMapScreen) Use(1.0f);
if (attachedByDefault || (Screen.Selected == GameMain.EditMapScreen && Submarine.Loaded!=null)) Use(1.0f);
//holdAngle = ToolBox.GetAttributeFloat(element, "holdangle", 0.0f);
@@ -131,9 +131,9 @@ namespace Subsurface.Items.Components
public override bool Use(float deltaTime, Character activator = null)
{
if (character.SelectedConstruction != item)
if (activator.SelectedConstruction != item)
{
character = null;
activator = null;
return false;
}
@@ -299,7 +299,7 @@ namespace Subsurface.Items.Components
if (selectedNodeIndex == null && !MapEntity.SelectedAny)
{
if (PlayerInput.LeftButtonDown())
if (PlayerInput.LeftButtonDown() && PlayerInput.GetOldMouseState.LeftButton == Microsoft.Xna.Framework.Input.ButtonState.Released)
{
MapEntity.SelectEntity(item);
selectedNodeIndex = i;
@@ -130,10 +130,14 @@ namespace Subsurface.Items.Components
{
base.Update(deltaTime, cam);
item.SetTransform(picker.SimPosition, 0.0f);
Item[] containedItems = item.ContainedItems;
ApplyStatusEffects(ActionType.OnWearing, deltaTime, picker);
PlaySound(ActionType.OnWearing, picker.Position);
if (containedItems == null) return;
for (int j = 0; j<containedItems.Length; j++)
{