(db4f4a55b) HasRequiredItems method is used for different purposes. Thus we shouldn't return true if the door is damaged but not broken, because it would cause issues for example in steering. Similarly I don't think we should use the canBePicked here, because it could be possible that the door should be interactable but not pickable.

This commit is contained in:
Joonas Rikkonen
2019-05-06 11:22:20 +03:00
parent e4adc47dad
commit b797d112b7
13 changed files with 133 additions and 261 deletions
@@ -227,9 +227,8 @@ namespace Barotrauma.Items.Components
{
msg = msg ?? (HasIntegratedButtons ? accessDeniedTxt : cannotOpenText);
}
if (item.Condition <= RepairThreshold) { return true; }
//this is a bit pointless atm because if canBePicked is false it won't allow you to do Pick() anyway, however it's still good for future-proofing.
return requiredItems.Any() ? base.HasRequiredItems(character, addMessage, msg) : canBePicked;
if (isBroken) { return true; }
return base.HasRequiredItems(character, addMessage, msg);
}
public override bool Pick(Character picker)
@@ -86,7 +86,17 @@ namespace Barotrauma.Items.Components
{
get { return zoom; }
}
//TODO: remove, only for testing
#if DEBUG
[Serialize(false, false), Editable]
public bool DynamicDockingIndicator
{
get;
set;
}
#endif
public override bool IsActive
{
get