From 7b76344b3067f99ab64fa108f703ba78b89551f9 Mon Sep 17 00:00:00 2001 From: ldicker83 Date: Sun, 20 Jan 2019 22:35:52 -0500 Subject: [PATCH] Bulldozer placement now does a transfer simulation and warns the user if there isn't enough storage space for transferring all products in the bulldozed warehouse. If the user clicks the "No" button the bulldozer placement is canceled. Closes issue #42 --- CHANGELOG.md | 5 +++-- src/States/MapViewState.cpp | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14c8a1658..7897e7c70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ # Change Log This is the changelog for OutpostHD. -## [0.7.9] - UNKNOWN +## [0.7.9] - 2019-01-20 -User interface overhaul. +User interface overhaul and maintenance. ### Added - CheckBox Control. @@ -21,6 +21,7 @@ User interface overhaul. - Setting minimum resolution to 1000x700. I know, kind of a weird one but this is intended mostly for windowed modes to run properly on low-resolution displays (1366x768). - Structures that are disabled now indicate why they were disabled. - Buldozing a mine facility on top of a completely exhausted mine will also remove all of the mine shafts underneath. +- Bulldozing a Warehouse will ask the user to confirm if there isn't enough storage space to move products to other Warehouses. ### Fixed - Fixed an issue that prevented the planet description from displaying. diff --git a/src/States/MapViewState.cpp b/src/States/MapViewState.cpp index 1dd7c2ade..c6982d348 100644 --- a/src/States/MapViewState.cpp +++ b/src/States/MapViewState.cpp @@ -823,7 +823,11 @@ void MapViewState::placeRobot() if (_s->isRobotCommand()) { deleteRobotsInRCC(r, static_cast(_s), mRobotPool, mRobotList, tile); } if (_s->isFactory() && static_cast(_s) == mFactoryProduction.factory()) { mFactoryProduction.hide(); } - if (_s->isWarehouse()) { moveProducts(static_cast(_s)); } + if (_s->isWarehouse()) + { + if (simulateMoveProducts(static_cast(_s))) { moveProducts(static_cast(_s)); } + else { return; } // Don't continue with the bulldoze if the user says no. + } /** * \fixme Since the StructureTranslator class will be deprecated in the future, there needs to be a better