Playing with another "disable drone maintenance" mod, found a bug, which should exist here as well.
It happens when you disable maintenance when drone is underway to repair building, in which case:
obj:ResetMaintenanceRequests() stops the drone(s).
obj.maintenance_phase remains set to "demand".
Then, re-enabling maintenance anytime later will run obj:RequestMaintenance() (both from AccumulateMaintenancePoints() and explicitly in this mod), but RequestMaintenance() has if self.maintenance_phase == false then ... end in it, so won't do anything when maintenance_phase is already set to "demand" (which I think is done to prevent any duplicate requests).
So building stuck with no maintenance requests and maintenance_phase = "demand" will never get fixed - a state which this mod can produce.
Hi,
Playing with another "disable drone maintenance" mod, found a bug, which should exist here as well.
It happens when you disable maintenance when drone is underway to repair building, in which case:
Then, re-enabling maintenance anytime later will run obj:RequestMaintenance() (both from AccumulateMaintenancePoints() and explicitly in this mod), but RequestMaintenance() has
if self.maintenance_phase == false then ... end
in it, so won't do anything when maintenance_phase is already set to "demand" (which I think is done to prevent any duplicate requests).So building stuck with no maintenance requests and maintenance_phase = "demand" will never get fixed - a state which this mod can produce.
Specific fix that I used in a similar mod: https://github.com/mk-fg/games/commit/5dbe69d26db025490f6af163608c7dc0d0396263 Though I'm sure it can be done in other ways, and obj:ResetMaintenanceRequests() there is probably redundant.
Cheers!