Skip to content

Bench Patches

NathanIkola edited this page Aug 8, 2022 · 3 revisions

EnableAndDisableTelevisions

Patched Type Patched Method Call Frequency
JobDriver_WatchBuilding TryMakePreToilReservations When a pawn initially starts a building-view job

Description

The game triggers this patch when a pawn begins any job that involves watching a building, such as televisions or art. This patch will check if the building in question is a television; if it is a television, it will enable the television if the pawn is already at the target cell. The NotifyPatherArrived patch below is not guaranteed trigger if the pawn is already at the target location (such as a patient sleeping in a bed).

Note

This patch works in conjunction with the below patch to guarantee support for televisions. If this patch didn't require the pawn to already be at the target viewing location, it would make the TV begin pulling power the moment the pawn starts heading to the TV, even if it's across the map. Joining these patches together allows this patch to guarantee the TV is activated when the NotifyPatherArrived patch would otherwise fail to trigger, and the other patch to handle the case where the pawn is heading to the desired location. This problem does not appear to be the case for normal benches.

TriggerOnPawnArrivedToBench

Patched Type Patched Method Call Frequency
JobDriver Notify_PatherArrived Only when a pawn arrives at the target of a job

Description

The game triggers this patch when a pawn arrives at the target of their current job. When triggered, this patch checks if the target of their job is a workbench, research bench, or television and causes it to resume drawing power if so.

Note

This patch is not guaranteed to trigger for Televisions if the pawn is already at the desired location (such would be the case for pawns resting in hospital beds); see the above patch for how I solved this problem.

Clone this wiki locally