Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaShared/Source/Items/Components/Ladder.cs
Joonas Rikkonen c3b5c414cb 4e002dc...f9e8100
commit f9e8100140d99d30db551c16523f04cf042fb107
Author: Joonas Rikkonen <poe.regalis@gmail.com>
Date:   Sun Mar 24 20:37:23 2019 +0200

    Automatically grab adjacent ladders when the top/bottom of the current ladder is reached. Makes moving through docking ports a little less confusing. Closes #1337

commit 7ad697036299c3dae0145f89dc7e1f4fec22953d
Author: Joonas Rikkonen <poe.regalis@gmail.com>
Date:   Sun Mar 24 20:11:57 2019 +0200

    Fixed windows clients being unable to start a campaign in servers running on Linux. Caused by submarine paths not matching because the clients would use backslash in the filepath while Linux uses a slash. The submarine selection logic also had an additional issue: the clients would assume the submarine is in the default Submarines folder, even though the server may actually store them somewhere else. Now the client communicates the selected sub to the server by sending the name and MD5 hash instead of the path, so mismatching paths shouldn't cause problems anymore. Closes #1332
2019-03-24 20:38:12 +02:00

30 lines
796 B
C#

using System.Collections.Generic;
using System.Xml.Linq;
namespace Barotrauma.Items.Components
{
class Ladder : ItemComponent
{
public static List<Ladder> List { get; } = new List<Ladder>();
public Ladder(Item item, XElement element)
: base(item, element)
{
List.Add(this);
}
public override bool Select(Character character)
{
if (character == null || character.LockHands || character.Removed || !(character.AnimController is HumanoidAnimController)) return false;
character.AnimController.Anim = AnimController.Animation.Climbing;
return true;
}
protected override void RemoveComponentSpecific()
{
List.Remove(this);
}
}
}