Add CykUtil for checking player tank ownership

This commit is contained in:
2025-02-24 15:37:42 +01:00
parent 106afee250
commit af0c47e9e5
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
namespace TerraTech {
public class CykUtil {
public static bool IsPlayerTank(Module module) {
if (module == null)
return false;
TankBlock block = module.block;
if (block == null)
return false;
Tank tank = block.tank;
if (tank == null)
return false;
return tank.ControllableByLocalPlayer;
}
}
}

View File

@@ -55,6 +55,7 @@
<Compile Include="ModuleWheelsManager.cs" />
<Compile Include="TankBeamManager.cs" />
<Compile Include="ModuleWeaponManager.cs" />
<Compile Include="CykUtil.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">