diff --git a/src/data/field/choice.cpp b/src/data/field/choice.cpp index 97e1c90d..667e0c48 100644 --- a/src/data/field/choice.cpp +++ b/src/data/field/choice.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include DECLARE_TYPEOF_COLLECTION(ChoiceField::ChoiceP); @@ -303,3 +304,5 @@ bool ChoiceValue::update(Context& ctx) { IMPLEMENT_REFLECTION_NAMELESS(ChoiceValue) { if (fieldP->save_value || tag.scripting() || tag.reading()) REFLECT_NAMELESS(value); } + +INSTANTIATE_REFLECTION_NAMELESS(ChoiceValue) diff --git a/src/data/pack.cpp b/src/data/pack.cpp index a69e70b9..5f1c2a8d 100644 --- a/src/data/pack.cpp +++ b/src/data/pack.cpp @@ -376,7 +376,7 @@ void PackInstance::generate(vector* out) { if (pack_type.select == SELECT_ALL) { // add all cards generate_all(out, requested_copies); - + } else if (pack_type.select == SELECT_REPLACE || pack_type.select == SELECT_PROPORTIONAL || pack_type.select == SELECT_NONEMPTY) { @@ -384,7 +384,7 @@ void PackInstance::generate(vector* out) { for (size_t i = 0 ; i < requested_copies ; ++i) { generate_one_random(out); } - + } else if (pack_type.select == SELECT_NO_REPLACE) { if (!pack_type.items.empty()) { throw Error(_("'select:no replace' is not yet supported in combination with 'items', only with 'filter'.")); @@ -402,7 +402,7 @@ void PackInstance::generate(vector* out) { rem -= max_per_batch; } } - + } else if (pack_type.select == SELECT_EQUAL || pack_type.select == SELECT_EQUAL_PROPORTIONAL || pack_type.select == SELECT_EQUAL_NONEMPTY) { @@ -419,7 +419,7 @@ void PackInstance::generate(vector* out) { if (pack_type.select == SELECT_EQUAL_PROPORTIONAL) { wi.weight = item->weight * parent.get(item->name).total_weight; } else if (pack_type.select == SELECT_EQUAL_NONEMPTY) { - wi.weight = parent.get(item->name).total_weight > 0 ? item->weight : 0; + wi.weight = parent.get(item->name).total_weight > 0 ? static_cast(item->weight) : 0; } else { wi.weight = item->weight; } @@ -452,7 +452,7 @@ void PackInstance::generate(vector* out) { } } } - + } else if (pack_type.select == SELECT_FIRST) { if (!cards.empty()) { // there is a card, pick it diff --git a/src/data/set.cpp b/src/data/set.cpp index 23af30ec..b4c3b1b3 100644 --- a/src/data/set.cpp +++ b/src/data/set.cpp @@ -17,6 +17,7 @@ #include #include // for 0.2.7 fix #include +#include #include