global to local var in farming.generate_tree to fix error message in latest mt