This is sort of a continuation of this thread about how to do this. However, it changed with the B19 update and I have hit a roadblock with making it work again.
I now receive this error when harvesting:
This is what used to work prior to B19:
I noticed this change regarding GenPlace.TryPlaceThing within Rimworld's JobDriver_PlantWork using dnSpy:
to
I noticed the changes within Verse's GenPlace for TryPlaceThing as well. I thought maybe adding the second null would fix the problem, but Visual Studio gives the error of cannot convert from '<null>' to 'out Thing'. This where I am stuck and am not sure how to proceed in editing what I have for this to work again in B19. I tried a few ideas of my own, but they proved fruitless and resulted in the same error when harvesting as shown above in the beginning.
Any ideas on how to make this work again?
I now receive this error when harvesting:
Code Select
Exception in JobDriver tick for pawn Joe driver=JobDriver_PlantHarvest_Designated (toilIndex=5) driver.job=(HarvestDesignated (Job_290) A=Thing_WildAppletree37787) lastJobGiver=RimWorld.JobGiver_Work
System.MissingMethodException: Method not found: 'Verse.GenPlace.TryPlaceThing'.
at RimWorld.JobDriver_PlantWork+<MakeNewToils>c__Iterator0+<MakeNewToils>c__AnonStorey1.<>m__1 () [0x00000] in <filename unknown>:0
at Verse.AI.JobDriver.DriverTick () [0x00000] in <filename unknown>:0
This is what used to work prior to B19:
Code Select
public class Apple : Plant
{
public override void PlantCollected()
{
float arg_40_0 = this.def.plant.harvestYield;
float num = Mathf.InverseLerp(this.def.plant.harvestMinGrowth, 1f, this.growthInt);
num = 0.5f + num * 0.5f;
int num2 = GenMath.RoundRandom(arg_40_0 * num * Mathf.Lerp(0.5f, 1f, (float)this.HitPoints / (float)base.MaxHitPoints) * Find.Storyteller.difficulty.cropYieldFactor);
Thing expr_86 = ThingMaker.MakeThing(ThingDef.Named("WoodLog_Apple"), null);
expr_86.stackCount = (int)((float)num2 * 0.5f);
GenPlace.TryPlaceThing(expr_86, base.Position, base.Map, ThingPlaceMode.Near, null);
base.PlantCollected();
}
}
I noticed this change regarding GenPlace.TryPlaceThing within Rimworld's JobDriver_PlantWork using dnSpy:
Code Select
GenPlace.TryPlaceThing(thing, actor.Position, this.Map, ThingPlaceMode.Near, null)
to
Code Select
GenPlace.TryPlaceThing(thing, actor.Position, this.Map, ThingPlaceMode.Near, null, null)
I noticed the changes within Verse's GenPlace for TryPlaceThing as well. I thought maybe adding the second null would fix the problem, but Visual Studio gives the error of cannot convert from '<null>' to 'out Thing'. This where I am stuck and am not sure how to proceed in editing what I have for this to work again in B19. I tried a few ideas of my own, but they proved fruitless and resulted in the same error when harvesting as shown above in the beginning.
Any ideas on how to make this work again?