Fix excavator capacity bullshit
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Mafi;
|
using Mafi;
|
||||||
@@ -22,6 +23,7 @@ using Mafi.Core.Ports.Io;
|
|||||||
using Mafi.Core.Products;
|
using Mafi.Core.Products;
|
||||||
using Mafi.Core.Prototypes;
|
using Mafi.Core.Prototypes;
|
||||||
using Mafi.Core.Terrain;
|
using Mafi.Core.Terrain;
|
||||||
|
using Mafi.Core.Vehicles.Excavators;
|
||||||
using Mafi.Core.World.Entities;
|
using Mafi.Core.World.Entities;
|
||||||
|
|
||||||
namespace CykaOfIndustry {
|
namespace CykaOfIndustry {
|
||||||
@@ -462,4 +464,20 @@ namespace CykaOfIndustry {
|
|||||||
(int)(__instance.CargoCapacity.Value * Main.shipyardCargoMultiplier.Value)));
|
(int)(__instance.CargoCapacity.Value * Main.shipyardCargoMultiplier.Value)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(Excavator), "MineMixedAt")]
|
||||||
|
public class MineMixedAtPatch {
|
||||||
|
public static Dictionary<Excavator, Quantity> originalCapacity = new Dictionary<Excavator, Quantity>();
|
||||||
|
|
||||||
|
static void Prefix(ref Excavator __instance) {
|
||||||
|
if (!originalCapacity.ContainsKey(__instance)) {
|
||||||
|
originalCapacity.Add(__instance, __instance.Prototype.Capacity);
|
||||||
|
}
|
||||||
|
|
||||||
|
var trav = Traverse.Create(__instance.Prototype);
|
||||||
|
trav.Field("Capacity")
|
||||||
|
.SetValue(new Quantity(originalCapacity[__instance].Value * Main.excavatorCapacityMultiplier.Value));
|
||||||
|
Console.WriteLine("IndustrialCyka: Excavator capacity: {0}", __instance.Prototype.Capacity.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user