Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using Server.Targeting;
namespace Server.Items
@ -110,7 +109,14 @@ namespace Server.Items
UpdateItemID();
}
public bool ContainsKey(uint keyValue) => Keys.Any(key => key.KeyValue == keyValue);
public bool ContainsKey(uint keyValue)
{
foreach (Key key in Keys)
if (key.KeyValue == keyValue)
return true;
return false;
}
private void UpdateItemID()
{
@ -163,7 +169,9 @@ namespace Server.Items
}
else if (targeted is ILockable o)
{
if (m_KeyRing.Keys.Any(key => key.UseOn(from, o))) return;
foreach (Key key in m_KeyRing.Keys)
if (key.UseOn(from, o))
return;
from.SendLocalizedMessage(1008140); // You do not have a key for that.
}
@ -174,4 +182,4 @@ namespace Server.Items
}
}
}
}
}