(svn r24231) [1.2] -Backport from trunk:

- Fix: Immediately do the cargo payment on vehicle crashes instead of when they are cleared [FS#5152] (r24219)
- Fix: The confirmation window to abort world generation was hidden during world generation, so actually you could not abort it [FS#5159] (r24214)
- Fix: If a company is taken over or bankrupts, transfer exclusive transport rights to the new owner respectively cancel them (r24204)
This commit is contained in:
rubidium 2012-05-12 07:46:05 +00:00
parent 7f8b41d956
commit 012871f24c
3 changed files with 15 additions and 2 deletions

View File

@ -360,7 +360,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
}
if (new_owner == INVALID_OWNER) RebuildSubsidisedSourceAndDestinationCache();
/* Take care of rating in towns */
/* Take care of rating and transport rights in towns */
FOR_ALL_TOWNS(t) {
/* If a company takes over, give the ratings to that company. */
if (new_owner != INVALID_OWNER) {
@ -378,6 +378,16 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
/* Reset the ratings for the old owner */
t->ratings[old_owner] = RATING_INITIAL;
ClrBit(t->have_ratings, old_owner);
/* Transfer exclusive rights */
if (t->exclusive_counter > 0 && t->exclusivity == old_owner) {
if (new_owner != INVALID_OWNER) {
t->exclusivity = new_owner;
} else {
t->exclusive_counter = 0;
t->exclusivity = INVALID_COMPANY;
}
}
}
{

View File

@ -194,6 +194,9 @@ uint Vehicle::Crash(bool flooded)
SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
SetWindowDirty(WC_VEHICLE_DEPOT, this->tile);
delete this->cargo_payment;
this->cargo_payment = NULL;
return pass;
}

View File

@ -557,7 +557,7 @@ static bool MayBeShown(const Window *w)
switch (w->window_class) {
case WC_MAIN_WINDOW: ///< The background, i.e. the game.
case WC_MODAL_PROGRESS: ///< The actual progress window.
case WC_QUERY_STRING: ///< The abort window.
case WC_CONFIRM_POPUP_QUERY: ///< The abort window.
return true;
default: