Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Use vehicle model age for station rating calculation #7730

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -1767,7 +1767,7 @@ static void LoadUnloadVehicle(Vehicle *front)

/* if last speed is 0, we treat that as if no vehicle has ever visited the station. */
ge->last_speed = min(t, 255);
ge->last_age = min(_cur_year - front->build_year, 255);
ge->last_age = Clamp((_date - front->GetEngine()->intro_date) / DAYS_IN_YEAR, 0, 255);
ge->time_since_pickup = 0;

assert(v->cargo_cap >= v->cargo.StoredCount());
@@ -248,7 +248,7 @@ struct GoodsEntry {
byte last_speed;

/**
* Age in years (up to 255) of the last vehicle that tried to load this cargo.
* Years (up to 255) since introduction of the last vehicle type that tried to load this cargo.
* This does not imply there was any cargo to load.
*/
byte last_age;
@@ -3548,9 +3548,9 @@ static void UpdateStationRating(Station *st)
if (Company::IsValidID(st->owner) && HasBit(st->town->statues, st->owner)) rating += 26;

byte age = ge->last_age;
if (age < 3) rating += 10;
if (age < 2) rating += 10;
if (age < 1) rating += 13;
if (age < 10) rating += 10;
if (age < 5) rating += 10;
if (age < 2) rating += 13;

This comment has been minimized.

Copy link
@nielsmh

nielsmh Sep 8, 2019

Author Contributor

By the way these age values are entirely arbitrary, I just thought the numbers looked nice.

This comment has been minimized.

Copy link
@LordAro

LordAro Nov 23, 2019

Member

A comment should probably state as such


{
int or_ = ge->rating; // old rating
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.