Items outside the sub cannot be deattached. Closes #562
This commit is contained in:
@@ -242,6 +242,14 @@ namespace Barotrauma.Items.Components
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
public bool CanBeDeattached()
|
||||
{
|
||||
if (!attachable || !attached) return true;
|
||||
|
||||
//don't allow deattaching if outside hulls and not in sub editor
|
||||
return item.CurrentHull != null || Screen.Selected == GameMain.SubEditorScreen;
|
||||
}
|
||||
|
||||
public override bool Pick(Character picker)
|
||||
{
|
||||
if (!attachable)
|
||||
@@ -249,6 +257,8 @@ namespace Barotrauma.Items.Components
|
||||
return base.Pick(picker);
|
||||
}
|
||||
|
||||
if (!CanBeDeattached()) return false;
|
||||
|
||||
if (Attached)
|
||||
{
|
||||
return base.Pick(picker);
|
||||
|
||||
Reference in New Issue
Block a user