Fixed attachable items becoming detachable without any tools after they've been detached once
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using FarseerPhysics;
|
using FarseerPhysics;
|
||||||
using Lidgren.Network;
|
using Lidgren.Network;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace Barotrauma.Items.Components
|
namespace Barotrauma.Items.Components
|
||||||
@@ -13,6 +14,7 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
private InputType prevPickKey;
|
private InputType prevPickKey;
|
||||||
private string prevMsg;
|
private string prevMsg;
|
||||||
|
private List<RelatedItem> prevRequiredItems;
|
||||||
|
|
||||||
//the distance from the holding characters elbow to center of the physics body of the item
|
//the distance from the holding characters elbow to center of the physics body of the item
|
||||||
protected Vector2 holdPos;
|
protected Vector2 holdPos;
|
||||||
@@ -92,6 +94,8 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
canBePicked = true;
|
canBePicked = true;
|
||||||
|
|
||||||
|
prevRequiredItems = new List<RelatedItem>(requiredItems);
|
||||||
|
|
||||||
if (attachable)
|
if (attachable)
|
||||||
{
|
{
|
||||||
prevMsg = Msg;
|
prevMsg = Msg;
|
||||||
@@ -238,6 +242,7 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
Msg = prevMsg;
|
Msg = prevMsg;
|
||||||
PickKey = prevPickKey;
|
PickKey = prevPickKey;
|
||||||
|
requiredItems = new List<RelatedItem>(prevRequiredItems);
|
||||||
|
|
||||||
attached = true;
|
attached = true;
|
||||||
}
|
}
|
||||||
@@ -304,7 +309,7 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
public override void OnMapLoaded()
|
public override void OnMapLoaded()
|
||||||
{
|
{
|
||||||
//prevRequiredItems = new List<RelatedItem>(requiredItems);
|
prevRequiredItems = new List<RelatedItem>(requiredItems);
|
||||||
|
|
||||||
if (!attachable) return;
|
if (!attachable) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user