1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-28 22:54:29 +01:00

(svn r16309) [0.7] -Backport from trunk:

- Fix: Unable to (re)set the desert state for watery tiles [FS#2888] (r16290)
- Fix: Possible (in theory) desync related to autorenew settings (r16287)
- Fix: Crash after using the 'Reset landscape' function and remove all waypoint signs and buoys after resetting landscape (r16280)
- Fix: [NewGRF] Disable multitile houses for which the newgrf does not define proper additional tiles (r16274)
This commit is contained in:
rubidium
2009-05-15 10:17:00 +00:00
parent 139a213d4d
commit 30eff93341
7 changed files with 51 additions and 35 deletions

View File

@@ -22,9 +22,11 @@
#include "textbuf_gui.h"
#include "genworld.h"
#include "tree_map.h"
#include "station_map.h"
#include "landscape_type.h"
#include "tilehighlight_func.h"
#include "settings_type.h"
#include "waypoint.h"
#include "table/sprites.h"
#include "table/strings.h"
@@ -572,24 +574,34 @@ static OnButtonClick * const _editor_terraform_button_proc[] = {
static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
{
if (confirmed) {
Company *c;
/* Set generating_world to true to get instant-green grass after removing
* company property. */
_generating_world = true;
/* Delete all stations owned by a company */
Station *st;
FOR_ALL_STATIONS(st) {
if (IsValidCompanyID(st->owner)) delete st;
}
/* Delete all companies */
Company *c;
FOR_ALL_COMPANIES(c) {
ChangeOwnershipOfCompanyItems(c->index, INVALID_OWNER);
delete c;
}
_generating_world = false;
/* Delete all station signs */
Station *st;
FOR_ALL_STATIONS(st) {
/* There can be buoys, remove them */
if (IsBuoyTile(st->xy)) DoCommand(st->xy, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
delete st;
}
/* The same for waypoints */
Waypoint *wp;
FOR_ALL_WAYPOINTS(wp) {
delete wp;
}
MarkWholeScreenDirty();
}
}