mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 12:06:41 +00:00
Codechange: prefer AutoRestoreBackup over Backup/Restore (#15480)
This commit is contained in:
@@ -604,11 +604,10 @@ public:
|
||||
if (Town::GetNumItems() == 0) {
|
||||
ShowErrorMessage(GetEncodedString(STR_ERROR_CAN_T_GENERATE_INDUSTRIES), GetEncodedString(STR_ERROR_MUST_FOUND_TOWN_FIRST), WL_INFO);
|
||||
} else {
|
||||
Backup<bool> old_generating_world(_generating_world, true);
|
||||
AutoRestoreBackup old_generating_world(_generating_world, true);
|
||||
BasePersistentStorageArray::SwitchMode(PSM_ENTER_GAMELOOP);
|
||||
GenerateIndustries();
|
||||
BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP);
|
||||
old_generating_world.Restore();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user