Check if a building is scheduled to be on

Started by EbonJaeger, September 17, 2019, 08:37:59 PM

Previous topic - Next topic

EbonJaeger

Hello all,

I was wondering how one would check if a building is scheduled to be active and draw power, such as a sun lamp.

I figured out how to get the CompSchedule, but I'm not sure how to get the current time to check if it's in the scheduled time period.

Red192

this.parent.getComp<CompSchedule>().intAllowed ?

I have just begin to modding rimworld, or i'm tring at least, and i'm stuck on find a way to define if a production building is currently used or not

EbonJaeger

CompSchedule#Allowed works perfectly. I'm honestly not sure why I didn't think to just try that... derp. Thanks!

Finding if a worktable building is being used isn't too complicated:
building.Map.reservationManager.IsReservedByAnyoneOf(building, building.Faction)
Where `building` is an object of type Building.