Adds crowbar function to force-open doors...

***except the Door component ignores the damn requireditem and allows bare fukken hands to open it goddamnit***
This commit is contained in:
Alex Noir
2017-12-15 16:47:10 +03:00
parent 31153ebb20
commit 18d75c620f
7 changed files with 31 additions and 13 deletions
@@ -13,7 +13,7 @@ using Barotrauma.Lights;
namespace Barotrauma.Items.Components
{
partial class Door : ItemComponent, IDrawableComponent, IServerSerializable
partial class Door : Pickable, IDrawableComponent, IServerSerializable
{
private Gap linkedGap;
@@ -203,12 +203,10 @@ namespace Barotrauma.Items.Components
#endif
}
public override bool Pick(Character picker)
public override bool OnPicked(Character picker)
{
isOpen = !isOpen;
return true;
SetState(predictedState == null ? !isOpen : !predictedState.Value, false, true); //crowbar function
return false;
}
public override bool Select(Character character)
@@ -224,7 +224,7 @@ namespace Barotrauma.Items.Components
}
}
protected override bool OnPicked(Character picker)
public override bool OnPicked(Character picker)
{
if (base.OnPicked(picker))
{
@@ -70,7 +70,7 @@ namespace Barotrauma.Items.Components
}
}
protected virtual bool OnPicked(Character picker)
public virtual bool OnPicked(Character picker)
{
if (picker.Inventory.TryPutItem(item, picker, allowedSlots))
{