Add CykUtil for checking player tank ownership
This commit is contained in:
15
Projects/TerraTech/TerraTech/CykUtil.cs
Normal file
15
Projects/TerraTech/TerraTech/CykUtil.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
@@ -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">
|
||||
|
Reference in New Issue
Block a user