Unstable 0.1300.0.10

This commit is contained in:
Markus Isberg
2021-04-16 15:51:16 +03:00
parent f48dfb5862
commit 245b48c3a3
29 changed files with 289 additions and 84 deletions
@@ -1102,6 +1102,27 @@ namespace Barotrauma
if (findNewHull) { FindHull(); }
}
/// <summary>
/// Is dropping the item allowed when trying to swap it with the other item
/// </summary>
public bool AllowDroppingOnSwapWith(Item otherItem)
{
if (!Prefab.AllowDroppingOnSwap || otherItem == null) { return false; }
if (Prefab.AllowDroppingOnSwapWith.Any())
{
foreach (string tagOrIdentifier in Prefab.AllowDroppingOnSwapWith)
{
if (otherItem.prefab.Identifier.Equals(tagOrIdentifier, StringComparison.OrdinalIgnoreCase)) { return true; }
if (otherItem.HasTag(tagOrIdentifier)) { return true; }
}
return false;
}
else
{
return true;
}
}
public void SetActiveSprite()
{
SetActiveSpriteProjSpecific();