Add universal key (#1624)

* Add universal key

* Address issues
This commit is contained in:
Morb
2025-08-07 01:11:37 -07:00
committed by GitHub
parent 98ae6b22e6
commit 58c40c39ad
5 changed files with 38 additions and 5 deletions

View File

@@ -481,7 +481,18 @@ public sealed class SharedCP14LockKeySystem : EntitySystem
if (keyShape == null || lockShape == null)
return;
if (keyShape.SequenceEqual(lockShape))
var isEqual = keyShape.SequenceEqual(lockShape);
if (HasComp<CP14KeyUniversalComponent>(key) && !isEqual)
{
// Make new shape for key and force equality for this use
_popup.PopupClient(Loc.GetString("cp14-lock-key-transforming"), key, user);
key.Comp.LockShape = new List<int>(lockShape);
DirtyField(key, key.Comp, nameof(CP14KeyComponent.LockShape));
isEqual = true;
}
if (isEqual)
{
if (lockComp.Locked)
{