-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #643 from starfi5h/pr-0.9.0bugfix1
Fix SetFilter error when client placing blueprint of storagebox on remote planets
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#region | ||
|
||
using HarmonyLib; | ||
using NebulaWorld; | ||
|
||
#endregion | ||
|
||
namespace NebulaPatcher.Patches.Dynamic; | ||
|
||
[HarmonyPatch(typeof(BuildingParameters))] | ||
internal class BuildingParameters_Patch | ||
{ | ||
[HarmonyPrefix] | ||
[HarmonyPatch(nameof(BuildingParameters.ApplyPrebuildParametersToEntity))] | ||
[HarmonyPatch(nameof(BuildingParameters.PasteToFactoryObject))] | ||
public static void ApplyPrebuildParametersToEntity_Prefix() | ||
{ | ||
if (Multiplayer.IsActive) | ||
{ | ||
// Let the upper patch handle the SetBans, SetFilter syncing | ||
Multiplayer.Session.Storage.IsHumanInput = false; | ||
} | ||
} | ||
|
||
[HarmonyPostfix] | ||
[HarmonyPatch(nameof(BuildingParameters.ApplyPrebuildParametersToEntity))] | ||
[HarmonyPatch(nameof(BuildingParameters.PasteToFactoryObject))] | ||
public static void ApplyPrebuildParametersToEntity_Postfix() | ||
{ | ||
if (Multiplayer.IsActive) | ||
{ | ||
Multiplayer.Session.Storage.IsHumanInput = true; | ||
} | ||
} | ||
} |
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