@@ -156,20 +156,21 @@ def __call__(self, day):
156156
157157 # end of the crop cycle
158158 finish_type = None
159- # Check if crop_end_date is reached for CROP_END_TYPE harvest/earliest
160- if self .crop_end_type in ["harvest" , "earliest" ]:
161- if day == self .crop_end_date :
162- finish_type = "harvest"
159+ if self .in_crop_cycle :
160+ # Check if crop_end_date is reached for CROP_END_TYPE harvest/earliest
161+ if self .crop_end_type in ["harvest" , "earliest" ]:
162+ if day == self .crop_end_date :
163+ finish_type = "harvest"
163164
164- # Check for forced stop because maximum duration is reached
165- if self .in_crop_cycle and self .duration == self .max_duration :
166- finish_type = "max_duration"
165+ # Check for forced stop because maximum duration is reached
166+ if self .in_crop_cycle and self .duration == self .max_duration :
167+ finish_type = "max_duration"
167168
168169 # If finish condition is reached send a signal to finish the crop
169170 if finish_type is not None :
170171 self .in_crop_cycle = False
171172 self ._send_signal (signal = signals .crop_finish , day = day ,
172- finish = finish_type , crop_delete = True )
173+ finish_type = finish_type , crop_delete = True )
173174
174175 def _on_CROP_FINISH (self ):
175176 """Register that crop has reached the end of its cycle.
0 commit comments