This commit is contained in:
/
2024-12-29 21:15:58 +01:00
commit 547655c326
77 changed files with 7313 additions and 0 deletions

View 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;
}
}
}