1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-29 21:56:54 +02:00

Fix error: 'auto' not allowed in non-static struct member

This commit is contained in:
Alexander Wilms 2024-01-17 14:49:28 +00:00
parent 57c51b62fd
commit 7a1cee1a60
3 changed files with 6 additions and 6 deletions

View File

@ -785,7 +785,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
auto moveArmy = [this](const bool leftToRight) -> void
{
auto slotId = std::nullopt;
std::optional<SlotID> slotId = std::nullopt;
if(auto slot = getSelectedSlotID())
slotId = slot->getSlot();
controller.moveArmy(leftToRight, slotId);

View File

@ -1204,8 +1204,8 @@ CSelector JsonUtils::parseSelector(const JsonNode & ability)
ret = ret.And(Selector::subtype()(subtype));
}
value = &ability["sourceType"];
auto src = std::nullopt; //Fixes for GCC false maybe-uninitialized
auto id = std::nullopt;
std::optional<BonusSource> src = std::nullopt; //Fixes for GCC false maybe-uninitialized
std::optional<BonusSourceID> id = std::nullopt;
if(value->isString())
{
auto it = bonusSourceMap.find(value->String());

View File

@ -19,10 +19,10 @@ VCMI_LIB_NAMESPACE_BEGIN
struct DLL_LINKAGE BonusParams {
bool isConverted;
BonusType type = BonusType::NONE;
auto subtype = std::nullopt;
auto valueType = std::nullopt;
std::optional<BonusSubtypeID> subtype = std::nullopt;
std::optional<BonusValueType> valueType = std::nullopt;
std::optional<si32> val = std::nullopt;
auto targetType = std::nullopt;
std::optional<BonusSource> targetType = std::nullopt;
BonusParams(bool isConverted = true) : isConverted(isConverted) {};
BonusParams(std::string deprecatedTypeStr, std::string deprecatedSubtypeStr = "", int deprecatedSubtype = 0);