Ladders can be climbed by holding up/down while standing next to them without having to select them first.

This commit is contained in:
Joonas Rikkonen
2018-03-08 11:01:17 +02:00
parent 4421c8a5de
commit df746db421
2 changed files with 41 additions and 2 deletions
@@ -1,13 +1,20 @@
using System.Xml.Linq;
using System.Collections.Generic;
using System.Xml.Linq;
namespace Barotrauma.Items.Components
{
class Ladder : ItemComponent
{
private static List<Ladder> list = new List<Ladder>();
public static List<Ladder> List
{
get { return list; }
}
public Ladder(Item item, XElement element)
: base(item, element)
{
list.Add(this);
}
public override bool Select(Character character)
@@ -15,9 +22,13 @@ namespace Barotrauma.Items.Components
if (character == null || character.LockHands || character.Removed) return false;
character.AnimController.Anim = AnimController.Animation.Climbing;
//picker.SelectedConstruction = item;
return true;
}
protected override void RemoveComponentSpecific()
{
list.Remove(this);
}
}
}