Track income by cargo type in company economy stats
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "cm_game.hpp"
|
||||
|
||||
#include "../company_base.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
namespace citymania {
|
||||
@@ -78,6 +80,10 @@ Game::Game() {
|
||||
town->cm.real_population += HouseSpec::Get(house_id)->population;
|
||||
}
|
||||
});
|
||||
|
||||
this->events.listen<event::CargoAccepted>([this] (const event::CargoAccepted &event) {
|
||||
event.company->cur_economy.cm.cargo_income[event.cargo_type] += event.profit;
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace citymania
|
||||
Reference in New Issue
Block a user