forked from Exiled-Official/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
EXILED/Exiled.Events/Patches/Fixes/ServerHubMicroHidFix.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="ServerHubMicroHidFix.cs" company="ExMod Team"> | ||
// Copyright (c) ExMod Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.Events.Patches.Fixes | ||
{ | ||
#pragma warning disable SA1313 | ||
using API.Features.Items; | ||
using Exiled.API.Features; | ||
|
||
using HarmonyLib; | ||
|
||
using InventorySystem.Items.Autosync; | ||
using InventorySystem.Items.MicroHID.Modules; | ||
using InventorySystem.Items.Pickups; | ||
using InventorySystem.Items.Usables.Scp330; | ||
|
||
/// <summary> | ||
/// Patches <see cref="CycleSyncModule.Update()"/> to fix phantom <see cref="MicroHid"/> for <see cref="Item.Create(ItemType, API.Features.Player)"/>. | ||
/// </summary> | ||
[HarmonyPatch(typeof(CycleSyncModule), nameof(CycleSyncModule.Update))] | ||
internal static class ServerHubMicroHidFix | ||
{ | ||
private static bool Prefix(CycleSyncModule __instance) | ||
{ | ||
return __instance.MicroHid.InstantiationStatus == AutosyncInstantiationStatus.InventoryInstance; | ||
} | ||
} | ||
} |