Skip to content

Commit

Permalink
Fixed C# specifc code #62
Browse files Browse the repository at this point in the history
Changed C#6 specific code back to CS#5 as it doesn't work with the build script.
Something to be addressed later.
  • Loading branch information
midspace committed Apr 7, 2016
1 parent 640cba1 commit 414948c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Main/SEToolbox/SEToolbox/Interop/SpaceEngineersRepair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public static string RepairSandBox(WorldResource world)
?? repairWorld.FindPilotCharacter().Pilot;

var inventoryBase = character.ComponentContainer.Components.FirstOrDefault(e => e.TypeId == "MyInventoryBase");
MyObjectBuilder_Inventory inventory = inventoryBase?.Component as MyObjectBuilder_Inventory;
MyObjectBuilder_Inventory inventory = inventoryBase == null ? null : inventoryBase.Component as MyObjectBuilder_Inventory;

if (inventory != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ public override void UpdateGeneralFromEntityBase()
{
DisplayName = friendlyName;
Units = (decimal)FloatingObject.Item.Amount;
Volume = cd?.Volume == null ? 0 : cd.Volume.Value * (double)FloatingObject.Item.Amount;
Volume = (cd == null || cd.Volume == null) ? 0 : cd.Volume.Value * (double)FloatingObject.Item.Amount;
Mass = cd == null ? 0 : cd.Mass * (double)FloatingObject.Item.Amount;
Description = string.Format("{0:#,##0.00} Kg", Mass);
}
else if (FloatingObject.Item.PhysicalContent is MyObjectBuilder_Ingot)
{
DisplayName = friendlyName;
Units = (decimal)FloatingObject.Item.Amount;
Volume = cd?.Volume == null ? 0 : cd.Volume.Value * (double)FloatingObject.Item.Amount;
Volume = (cd == null || cd.Volume == null) ? 0 : cd.Volume.Value * (double)FloatingObject.Item.Amount;
Mass = cd == null ? 0 : cd.Mass * (double)FloatingObject.Item.Amount;
Description = string.Format("{0:#,##0.00} Kg", Mass);
}
Expand All @@ -140,7 +140,7 @@ public override void UpdateGeneralFromEntityBase()
DisplayName = friendlyName;
Description = string.Format("x {0}", FloatingObject.Item.Amount);
Units = (decimal)FloatingObject.Item.Amount;
Volume = cd?.Volume == null ? 0 : cd.Volume.Value * (double)FloatingObject.Item.Amount;
Volume = (cd == null || cd.Volume == null) ? 0 : cd.Volume.Value * (double)FloatingObject.Item.Amount;
Mass = cd == null ? 0 : cd.Mass * (double)FloatingObject.Item.Amount;
}
}
Expand Down
1 change: 1 addition & 0 deletions Main/SEToolbox/SEToolbox/SEToolbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
Expand Down

0 comments on commit 414948c

Please sign in to comment.