--- scripts/restaurant/customer.gd +++ scripts/restaurant/customer.gd @@ -348,7 +348,23 @@ # donnee perdue, pas d'un reglage. On retombe sur la valeur d'auteur. if resolved <= 0.0: resolved = fallback + if phase in [ServicePhase.ORDERING, ServicePhase.AWAITING_MEAL] \ + and restaurant != null and is_instance_valid(restaurant) \ + and restaurant.has_method("order_supply_patience_ratio"): + resolved *= float(restaurant.order_supply_patience_ratio(self)) return maxf(0.1, max_patience * resolved) + +# Adjust the allowance when supply changes without restarting the countdown. +func refresh_order_patience() -> void: + if not has_live_order() or service_phase not in [ServicePhase.ORDERING, ServicePhase.AWAITING_MEAL]: + return + var allowed := phase_patience(service_phase) + if is_equal_approx(allowed, phase_allowed): + return + var spent := maxf(0.0, phase_allowed - patience) + phase_allowed = allowed + patience = maxf(0.0, phase_allowed - spent) + queue_redraw() func phase_is_wait() -> bool: return phase_patience(service_phase) > 0.0