SHARE
TWEET

Untitled

a guest Jan 13th, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     /* Best guess lifetime profits based on vehicle age and last year profits */
  2.     if (IsSavegameVersionBefore(SLV_LIFETIME_PROFIT)) {
  3.         for (Vehicle *v : Vehicle::Iterate()) {
  4.             /* Renewing vehicles resets lifetime profits to zero and
  5.              * inherits last year profits from their past vehicles.
  6.              * Using their last year profits to best guess lifetime
  7.              * profits falls into the wrong side, unless the vehicles
  8.              * have already gone through one entire calendar year. */
  9.             YearMonthDay cur_date;
  10.             ConvertDateToYMD(_date, &cur_date);
  11.             YearMonthDay birth_date;
  12.             ConvertDateToYMD(_date - v->age, &birth_date);
  13.             if (cur_date.year - birth_date.year >= 2) {
  14.                 v->profit_lifetime = v->profit_last_year;
  15.             } else {
  16.                 v->profit_lifetime = 0;
  17.             }
  18.         }
  19.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top