Merge remote-tracking branch 'refs/remotes/upstream/master' into ed-13-05-2024-upstream

# Conflicts:
#	Content.Shared/Lock/LockSystem.cs
#	Resources/Prototypes/Maps/oasis.yml
This commit is contained in:
Ed
2024-05-13 18:32:59 +03:00
624 changed files with 43352 additions and 25174 deletions

View File

@@ -64,12 +64,12 @@ public sealed class LockSystem : EntitySystem
//CrystallPunk LockSystem Adapt
// Only attempt an unlock by default on Activate
//if (lockComp.Locked)
//if (lockComp.Locked && lockComp.UnlockOnClick)
//{
// TryUnlock(uid, args.User, lockComp);
// args.Handled = true;
//}
//else if (lockComp.LockOnClick)
//else if (!lockComp.Locked && lockComp.LockOnClick)
//{
// TryLock(uid, args.User, lockComp);
// args.Handled = true;
@@ -228,6 +228,18 @@ public sealed class LockSystem : EntitySystem
return true;
}
/// <summary>
/// Returns true if the entity is locked.
/// Entities with no lock component are considered unlocked.
/// </summary>
public bool IsLocked(Entity<LockComponent?> ent)
{
if (!Resolve(ent, ref ent.Comp, false))
return false;
return ent.Comp.Locked;
}
/// <summary>
/// Raises an event for other components to check whether or not
/// the entity can be locked in its current state.