Rework employee speed perk patch
This commit is contained in:
@@ -64,15 +64,15 @@ namespace CykaMod {
|
|||||||
AccessTools.PropertyGetter(typeof(Main).GetField("employeePerPerk").FieldType, "Value")));
|
AccessTools.PropertyGetter(typeof(Main).GetField("employeePerPerk").FieldType, "Value")));
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (codeInstruction.opcode == OpCodes.Ldc_R4) {
|
if (codeInstruction.opcode == OpCodes.Ldfld && codeInstruction.operand?.ToString() == "System.Single extraEmployeeSpeedFactor") {
|
||||||
// Console.WriteLine("Found Ldc_R4");
|
Console.WriteLine($"Found {codeInstruction.operand}");
|
||||||
// codeInstruction.opcode = OpCodes.Nop;
|
codes[i + 1].opcode = OpCodes.Nop;
|
||||||
// codes.Insert(i + 1,
|
codes.Insert(i + 2,
|
||||||
// new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(Main), "employeeSpeedPerk")));
|
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(Main), "employeeSpeedPerk")));
|
||||||
// codes.Insert(i + 2,
|
codes.Insert(i + 3,
|
||||||
// new CodeInstruction(OpCodes.Call,
|
new CodeInstruction(OpCodes.Call,
|
||||||
// AccessTools.PropertyGetter(typeof(Main).GetField("employeeSpeedPerk").FieldType, "Value")));
|
AccessTools.PropertyGetter(typeof(Main).GetField("employeeSpeedPerk").FieldType, "Value")));
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return codes.AsEnumerable();
|
return codes.AsEnumerable();
|
||||||
|
Reference in New Issue
Block a user