So, i'm trying to use Harmony for make the mining ticks been affected by a certain tecnology, but it does not work, i tried a bit but i guess is better to try to ask here:
Is something wrong?
EDIT: A reference cannot be modified... of course
Code Select
using RimWorld;
using System.Reflection;
using System;
using Verse;
using Harmony;
namespace NoName
{
[HarmonyPatch(typeof(JobDriver_Mine))]
[HarmonyPatch("ResetTicksToPickHit")]
static class JobDriver_Mine_ResearchPatch
{
static void Postfix(JobDriver_Mine __istance, ref int ___ticksToPickHit)
{
float num = 1;
if (ResearchProjectDef.Named("IronWorking").IsFinished)
{
num = 0.5f;
}
___ticksToPickHit = (int)(___ticksToPickHit*num);
}
}
}
Is something wrong?
EDIT: A reference cannot be modified... of course