zz
This commit is contained in:
24
GlobalShared/Patches/MyTerminalBlockPatch.cs
Normal file
24
GlobalShared/Patches/MyTerminalBlockPatch.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using HarmonyLib;
|
||||
using Sandbox.Game.Entities.Cube;
|
||||
using VRage.Game;
|
||||
|
||||
namespace Global.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(MyTerminalBlock))]
|
||||
public class MyTerminalBlockPatch
|
||||
{
|
||||
[HarmonyPatch("HasPlayerAccess")]
|
||||
[HarmonyPrefix]
|
||||
public static bool HasPlayerAccessPrefix(bool __result, long identityId,
|
||||
MyRelationsBetweenPlayerAndBlock defaultNoUser = MyRelationsBetweenPlayerAndBlock.NoOwnership)
|
||||
{
|
||||
if (identityId != 0) return true;
|
||||
|
||||
var defaultIsEnemyNeutralOrNoOwnership = defaultNoUser == MyRelationsBetweenPlayerAndBlock.Enemies ||
|
||||
defaultNoUser == MyRelationsBetweenPlayerAndBlock.Neutral ||
|
||||
defaultNoUser == MyRelationsBetweenPlayerAndBlock.NoOwnership;
|
||||
__result = !defaultIsEnemyNeutralOrNoOwnership;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user