SHARE
TWEET

Untitled

a guest Jan 13th, 2020 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     /* Set lifetime vehicle profits */
  2.     if (IsSavegameVersionBefore(SLV_LIFETIME_PROFIT)) {
  3.         for (Vehicle *v : Vehicle::Iterate()) {
  4.             if (v->age / DAYS_IN_LEAP_YEAR >= 2) {
  5.                 v->profit_lifetime = v->profit_last_year;
  6.             } else if (v->age / DAYS_IN_LEAP_YEAR == 1) {
  7.                 YearMonthDay cur_date;
  8.                 ConvertDateToYMD(_date, &cur_date);
  9.                 YearMonthDay birth_date;
  10.                 ConvertDateToYMD(_date - v->age, &birth_date);
  11.                 if (cur_date.year - birth_date.year >= 2) {
  12.                     v->profit_lifetime = v->profit_last_year;
  13.                 } else {
  14.                     v->profit_lifetime = 0;
  15.                 }
  16.             } else {
  17.                 v->profit_lifetime = 0;
  18.             }
  19.         }
  20.     }
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