diff --git a/src/map/site_game_data.h b/src/map/site_game_data.h index b2f456fe1..b6ce382e6 100644 --- a/src/map/site_game_data.h +++ b/src/map/site_game_data.h @@ -293,34 +293,10 @@ class site_game_data final : public QObject } int get_food_demand() const - { - return this->get_population_food_demand() + this->get_unit_food_demand(); - } - - int get_population_food_demand() const { return this->get_population() / site_game_data::population_per_food; } - int get_unit_food_demand() const - { - return this->unit_food_demand; - } - - void set_unit_food_demand(const int food_demand) - { - if (food_demand == this->get_unit_food_demand()) { - return; - } - - this->unit_food_demand = food_demand; - } - - void change_unit_food_demand(const int change) - { - this->set_unit_food_demand(this->get_unit_food_demand() + change); - } - int get_employment_capacity(const employment_type *employment_type) const { const auto find_iterator = this->employment_capacities.find(employment_type); @@ -371,7 +347,6 @@ class site_game_data final : public QObject int64_t population = 0; std::vector> population_units; int food_supply = 0; - int unit_food_demand = 0; employment_type_map employment_capacities; }; diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 16bf763a2..cf35d400c 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -2181,21 +2181,7 @@ void CUnit::set_home_settlement(const wyrmgus::site *settlement) return; } - const wyrmgus::site *old_home_settlement = this->get_home_settlement(); - this->home_settlement = settlement; - - const int food_cost = this->Type->Stats[this->Player->get_index()].Variables[DEMAND_INDEX].Value; - - if (food_cost != 0 && !this->is_under_construction() && this->IsAlive()) { - if (old_home_settlement != nullptr) { - old_home_settlement->get_game_data()->change_unit_food_demand(-food_cost); - } - - if (this->get_home_settlement() != nullptr) { - this->get_home_settlement()->get_game_data()->change_unit_food_demand(food_cost); - } - } } void CUnit::update_home_settlement()