# HG changeset patch # User celestar # Date 1174239927 0 # Node ID 1f207c0b7345c02e2ad5064c160988365c815586 # Parent 34d6438f08c844671a1f16cd95ad7ea70d7ba9f7 (svn r9280) [gamebalance] -Feature: The amount of passengers and mail now depends on the activity of a town. Also note that the general scheme of how passengers (and mail) are generated has been changed: The amount now correlates linearly to the population of a house. diff -r 34d6438f08c8 -r 1f207c0b7345 src/economy_new.h --- a/src/economy_new.h Fri Mar 16 12:05:31 2007 +0000 +++ b/src/economy_new.h Sun Mar 18 17:45:27 2007 +0000 @@ -44,7 +44,7 @@ /** * Handles all the economic data and events */ -class CEconomy : EconomicObject { +class CEconomy : public EconomicObject { private: FixedT m_basic_growth; ///< Basic growth number, depends solely on difficulty setting byte m_long_term_cycle; ///< The period of the long-term cycle suggested by Kondratiev diff -r 34d6438f08c8 -r 1f207c0b7345 src/town_cmd.cpp --- a/src/town_cmd.cpp Fri Mar 16 12:05:31 2007 +0000 +++ b/src/town_cmd.cpp Sun Mar 18 17:45:27 2007 +0000 @@ -32,6 +32,7 @@ #include "date.h" #include "table/town_land.h" #include "genworld.h" +#include "economy_new.h" /** * Called if a new block is added to the town-pool @@ -307,24 +308,18 @@ r = Random(); - if (GB(r, 0, 8) < _housetype_population[house]) { - uint amt = GB(r, 0, 8) / 8 + 1; - uint moved; - - if (_economy.fluct <= 0) amt = (amt + 1) >> 1; + if (GB(r, 0, 8) < (t->GetActivity() * _eco->GetActivity() * 8)) { + int amt = _housetype_population[house] / 8 + 1; t->new_max_pass += amt; - moved = MoveGoodsToStation(tile, 1, 1, CT_PASSENGERS, amt); + int moved = MoveGoodsToStation(tile, 1, 1, CT_PASSENGERS, amt); t->new_act_pass += moved; } - if (GB(r, 8, 8) < _housetype_mailamount[house] ) { - uint amt = GB(r, 8, 8) / 8 + 1; - uint moved; - - if (_economy.fluct <= 0) amt = (amt + 1) >> 1; - t->new_max_mail += amt; - moved = MoveGoodsToStation(tile, 1, 1, CT_MAIL, amt); - t->new_act_mail += moved; + if (GB(r, 8, 8) < (t->GetActivity() * _eco->GetActivity() * 8)) { + int amt = _housetype_mailamount[house] / 8 + 1; + t->new_max_pass += amt; + int moved = MoveGoodsToStation(tile, 1, 1, CT_PASSENGERS, amt); + t->new_act_pass += moved; } if (_house_more_flags[house] & 8 && HASBIT(t->flags12, TOWN_IS_FUNDED) && --t->time_until_rebuild == 0) {