Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rayzerbrain committed Sep 3, 2022
1 parent 2f5eb6c commit 964b9ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 46 deletions.
13 changes: 5 additions & 8 deletions API/Modifiers/KeycardModifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ namespace ItemUtils.API.Modifiers
{
public class KeycardModifier : ItemModifier
{
//Only need to test remote cards

public bool CanBeUsedRemotely { get; set; } = false;
public List<KeycardPermissions> AddedPermissions { get; set; } = new List<KeycardPermissions>();
public List<KeycardPermissions> RemovedPermissions { get; set; } = new List<KeycardPermissions>();
Expand Down Expand Up @@ -46,12 +44,11 @@ private bool CheckPermissions(Player plyr, KeycardPermissions perms, bool oldRes
{
Log.Debug($"Starting check of permissions {perms}", PluginMain.Instance.Config.DebugMode);

if (perms == KeycardPermissions.None)
return true;

if (plyr.IsScp)
if (perms == KeycardPermissions.None || plyr.IsScp)
return oldResult;

perms &= ~KeycardPermissions.ScpOverride;

if (CanBeUsedRemotely)
{
foreach (Item item in plyr.Items)
Expand All @@ -70,8 +67,8 @@ private bool CheckPermissions(Keycard card, KeycardPermissions perms)

if (CanModify(card, card.Owner))
{
newPerms += (ushort)AddedPermissions.Sum((perm) => (ushort)perm);
newPerms -= (ushort)RemovedPermissions.Sum((perm) => (ushort)perm);
newPerms += (ushort)AddedPermissions.Sum(perm => (ushort)perm);
newPerms -= (ushort)RemovedPermissions.Sum(perm => (ushort)perm);
}

Log.Debug($"Checking permission {perms} against card with perms {newPerms}", PluginMain.Instance.Config.DebugMode);
Expand Down
37 changes: 3 additions & 34 deletions ItemUtils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,40 +43,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Downloads\Dev (3)\Assembly-CSharp-Publicized.dll</HintPath>
</Reference>
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\EXILED.5.2.1\lib\net472\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=5.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\EXILED.5.2.1\lib\net472\Exiled.API.dll</HintPath>
</Reference>
<Reference Include="Exiled.Bootstrap, Version=5.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\EXILED.5.2.1\lib\net472\Exiled.Bootstrap.dll</HintPath>
</Reference>
<Reference Include="Exiled.CreditTags, Version=5.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\EXILED.5.2.1\lib\net472\Exiled.CreditTags.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomItems, Version=5.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\EXILED.5.2.1\lib\net472\Exiled.CustomItems.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomRoles, Version=5.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\EXILED.5.2.1\lib\net472\Exiled.CustomRoles.dll</HintPath>
</Reference>
<Reference Include="Exiled.Events, Version=5.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\EXILED.5.2.1\lib\net472\Exiled.Events.dll</HintPath>
</Reference>
<Reference Include="Exiled.Loader, Version=5.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\EXILED.5.2.1\lib\net472\Exiled.Loader.dll</HintPath>
</Reference>
<Reference Include="Exiled.Permissions, Version=5.2.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\EXILED.5.2.1\lib\net472\Exiled.Permissions.dll</HintPath>
</Reference>
<Reference Include="Exiled.Updater, Version=3.1.1.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\EXILED.5.2.1\lib\net472\Exiled.Updater.dll</HintPath>
</Reference>
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="NorthwoodLib, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\EXILED.5.2.1\lib\net472\NorthwoodLib.dll</HintPath>
</Reference>
<Reference Include="SemVer">
<HintPath>..\..\..\Downloads\Exiledsa\EXILED\Plugins\dependencies\SemVer.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -118,7 +85,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="EXILED">
<Version>5.3.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
4 changes: 0 additions & 4 deletions packages.config

This file was deleted.

0 comments on commit 964b9ff

Please sign in to comment.