mirror of
https://github.com/Xevion/RimWorld-Hydroponics-Expanded.git
synced 2025-12-08 18:08:35 -06:00
Fix uses of private internal stage variable, damage plants sitting atop container while unpowered
This commit is contained in:
@@ -180,17 +180,20 @@ namespace HydroponicsExpanded {
|
|||||||
|
|
||||||
public override void TickRare() {
|
public override void TickRare() {
|
||||||
// Tick the current stage.
|
// Tick the current stage.
|
||||||
HydroponicsStage initialStage = _stage;
|
HydroponicsStage initialStage = Stage;
|
||||||
TickStage(_stage);
|
TickStage(Stage);
|
||||||
|
|
||||||
// If the stage changed, re-run the next tick. This can allow for instant Grow -> Harvest transition.
|
// If the stage changed, re-run the next tick. This can allow for instant Grow -> Harvest transition.
|
||||||
if (_stage != initialStage)
|
if (_stage != initialStage)
|
||||||
TickStage(_stage);
|
TickStage(Stage);
|
||||||
|
|
||||||
// Apply rotting damage to all plants while power is cut.
|
// Apply rotting damage to all plants while power is cut.
|
||||||
if (!base.CanAcceptSowNow())
|
if (!base.CanAcceptSowNow()) {
|
||||||
foreach (Thing thing in _innerContainer)
|
foreach (Thing thing in _innerContainer)
|
||||||
((Plant)thing).TakeDamage(new DamageInfo(DamageDefOf.Rotting, 1f));
|
((Plant)thing).TakeDamage(new DamageInfo(DamageDefOf.Rotting, 1f));
|
||||||
|
foreach (Plant plant in PlantsOnMe)
|
||||||
|
plant.TakeDamage(new DamageInfo(DamageDefOf.Rotting, 1f));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly Material HydroponicPoweredFillMaterial =
|
private static readonly Material HydroponicPoweredFillMaterial =
|
||||||
|
|||||||
Reference in New Issue
Block a user