Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Set lifetime vehicle profits */
- if (IsSavegameVersionBefore(SLV_LIFETIME_PROFIT)) {
- for (Vehicle *v : Vehicle::Iterate()) {
- if (v->age / DAYS_IN_LEAP_YEAR >= 2) {
- v->profit_lifetime = v->profit_last_year;
- } else if (v->age / DAYS_IN_LEAP_YEAR == 1) {
- YearMonthDay cur_date;
- ConvertDateToYMD(_date, &cur_date);
- YearMonthDay birth_date;
- ConvertDateToYMD(_date - v->age, &birth_date);
- if (cur_date.year - birth_date.year >= 2) {
- v->profit_lifetime = v->profit_last_year;
- } else {
- v->profit_lifetime = 0;
- }
- } else {
- v->profit_lifetime = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement