RacesOfValheim/JotunnModStub/Butler
Ferdinando 03c1006511 fix(butler): the cook's lost meat, the furnace that starved, the coal with nowhere to go
Three tester reports against the Bone Servant, all with the same shape:
the servant was doing what the code said and the code said the wrong
thing. Two vanilla methods were re-read off the IL rather than trusted.

RPC_RemoveDoneItem empties ONE slot per call - it finds the first Done
slot, spawns its item, clears it and returns - not every slot, as the
comment on PullOutput claimed. DoCollect also swept the ground BEFORE
pulling, so each visit collected the previous visit's item and dropped a
fresh one; since Plan() diverts to PlanDelivery the moment the payload is
non-empty, the servant then left for the chest and abandoned what it had
just pulled. A working hearth therefore always had exactly one cooked
meat lying beside it. Now it pulls first, in a loop bounded by a new
ButlerStation.OutputPulls - the slot count for a cooking station, 1
everywhere else, because the fermenter's Ready survives its own tap for
the length of the animation and a bare while(HasOutput) would spam
RPC_Tap.

PlanFuel sat last, behind PlanLoad, and FreeSlots goes back above zero
the instant a furnace eats one ore - so loading always had an answer and
refuelling never got a turn. The blast furnace burned down to nothing.
PlanFuel now runs ahead of PlanLoad, which cannot starve loading in
return because FuelWanted is 0 for a station with no work, and it scores
candidates by the walk the way PlanLoad does now that the choice matters.

PlanDelivery offers the load to the nearest station that will CONSUME it,
as material or as fuel, after the chest search fails and before dropping
it on the floor. UpdateSmelter only calls SpawnProcessed once the ore
queue empties, so the charcoal kiln releases its whole batch at once -
exactly the delivery a nearly full chest cannot absorb. The coal now
walks into the furnace beside it instead of onto the ground.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 08:45:09 +02:00
..
BoneServant.cs warvulture 2026-08-16 07:44:44 +02:00
BoneServantAI.cs fix(butler): the cook's lost meat, the furnace that starved, the coal with nowhere to go 2026-08-29 08:45:09 +02:00
ButlerConfig.cs warvulture 2026-08-16 07:44:44 +02:00
ButlerStation.cs fix(butler): the cook's lost meat, the furnace that starved, the coal with nowhere to go 2026-08-29 08:45:09 +02:00
ServantTableBehaviour.cs warvulture 2026-08-16 07:44:44 +02:00