File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828#include < sstream>
2929#include < fstream>
3030#include < algorithm>
31+ #include < climits>
3132#include < yaml-cpp/yaml.h>
3233#include " Exception.h"
3334#include " Logger.h"
@@ -544,7 +545,7 @@ std::string getString(const std::string& id)
544545int getInt (const std::string& id)
545546{
546547 std::stringstream ss;
547- int value;
548+ int value = INT_MAX ;
548549 ss << std::dec << _options[id];
549550 ss >> std::dec >> value;
550551 return value;
Original file line number Diff line number Diff line change 4444#include " ../Engine/Action.h"
4545#include " ../Engine/Options.h"
4646#include " ../Basescape/CraftInfoState.h"
47+ #include < climits>
4748
4849namespace OpenXcom
4950{
@@ -344,8 +345,12 @@ void NewBattleState::initSave()
344345 if (rule->getBattleType () != BT_NONE && !rule->isFixed () && (*i).substr (0 , 8 ) != " STR_HWP_" )
345346 {
346347 int amount = Options::getInt (" NewBattle_" + rule->getName ());
347- amount = std::max (0 , std::min (100 , amount));
348-
348+ if (amount = INT_MAX )
349+ {
350+ amount=0 ;
351+ Options::setInt (" NewBattle_" + rule->getName (), 0 );
352+ }
353+ amount = std::max (0 , std::min (amount, 100 ));
349354 _craft->getItems ()->addItem (*i, amount);
350355 }
351356 }
You can’t perform that action at this time.
0 commit comments