@@ -784,8 +784,8 @@ bool CountryInstance::modify_unit_type_unlock(UnitTypeBranched<Branch> const& un
784784 if (unlock_level + unlock_level_change < 0 ) {
785785 spdlog::error_s (
786786 " Attempted to change unlock level for unit type {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
787- unit_type, *this , static_cast < int64_t >( unlock_level) ,
788- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
787+ unit_type, *this , unlock_level,
788+ unlock_level_change, unlock_level + unlock_level_change
789789 );
790790 return false ;
791791 }
@@ -844,7 +844,7 @@ bool CountryInstance::modify_unit_type_unlock(UnitType const& unit_type, technol
844844}
845845
846846bool CountryInstance::unlock_unit_type (UnitType const & unit_type) {
847- return modify_unit_type_unlock (unit_type, 1 );
847+ return modify_unit_type_unlock (unit_type, technology_unlock_level_t { 1 } );
848848}
849849
850850bool CountryInstance::is_unit_type_unlocked (UnitType const & unit_type) const {
@@ -873,8 +873,8 @@ bool CountryInstance::modify_building_type_unlock(
873873 if (unlock_level + unlock_level_change < 0 ) {
874874 spdlog::error_s (
875875 " Attempted to change unlock level for building type {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
876- building_type, *this , static_cast < int64_t >( unlock_level), static_cast < int64_t >( unlock_level_change),
877- static_cast < int64_t >( unlock_level + unlock_level_change)
876+ building_type, *this , unlock_level, unlock_level_change,
877+ unlock_level + unlock_level_change
878878 );
879879 return false ;
880880 }
@@ -889,7 +889,7 @@ bool CountryInstance::modify_building_type_unlock(
889889}
890890
891891bool CountryInstance::unlock_building_type (BuildingType const & building_type) {
892- return modify_building_type_unlock (building_type, 1 );
892+ return modify_building_type_unlock (building_type, technology_unlock_level_t { 1 } );
893893}
894894
895895bool CountryInstance::is_building_type_unlocked (BuildingType const & building_type) const {
@@ -903,8 +903,8 @@ bool CountryInstance::modify_crime_unlock(Crime const& crime, technology_unlock_
903903 if (unlock_level + unlock_level_change < 0 ) {
904904 spdlog::error_s (
905905 " Attempted to change unlock level for crime {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
906- crime, *this , static_cast < int64_t >( unlock_level) ,
907- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
906+ crime, *this , unlock_level,
907+ unlock_level_change, unlock_level + unlock_level_change
908908 );
909909 return false ;
910910 }
@@ -915,7 +915,7 @@ bool CountryInstance::modify_crime_unlock(Crime const& crime, technology_unlock_
915915}
916916
917917bool CountryInstance::unlock_crime (Crime const & crime) {
918- return modify_crime_unlock (crime, 1 );
918+ return modify_crime_unlock (crime, technology_unlock_level_t { 1 } );
919919}
920920
921921bool CountryInstance::is_crime_unlocked (Crime const & crime) const {
@@ -927,8 +927,8 @@ bool CountryInstance::modify_gas_attack_unlock(technology_unlock_level_t unlock_
927927 if (gas_attack_unlock_level + unlock_level_change < 0 ) {
928928 spdlog::error_s (
929929 " Attempted to change unlock level for gas attack in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
930- *this , static_cast < int64_t >( gas_attack_unlock_level) ,
931- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( gas_attack_unlock_level + unlock_level_change)
930+ *this , gas_attack_unlock_level,
931+ unlock_level_change, gas_attack_unlock_level + unlock_level_change
932932 );
933933 return false ;
934934 }
@@ -939,7 +939,7 @@ bool CountryInstance::modify_gas_attack_unlock(technology_unlock_level_t unlock_
939939}
940940
941941bool CountryInstance::unlock_gas_attack () {
942- return modify_gas_attack_unlock (1 );
942+ return modify_gas_attack_unlock (technology_unlock_level_t { 1 } );
943943}
944944
945945bool CountryInstance::is_gas_attack_unlocked () const {
@@ -951,8 +951,8 @@ bool CountryInstance::modify_gas_defence_unlock(technology_unlock_level_t unlock
951951 if (gas_defence_unlock_level + unlock_level_change < 0 ) {
952952 spdlog::error_s (
953953 " Attempted to change unlock level for gas defence in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
954- *this , static_cast < int64_t >( gas_defence_unlock_level) ,
955- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( gas_defence_unlock_level + unlock_level_change)
954+ *this , gas_defence_unlock_level,
955+ unlock_level_change, gas_defence_unlock_level + unlock_level_change
956956 );
957957 return false ;
958958 }
@@ -963,7 +963,7 @@ bool CountryInstance::modify_gas_defence_unlock(technology_unlock_level_t unlock
963963}
964964
965965bool CountryInstance::unlock_gas_defence () {
966- return modify_gas_defence_unlock (1 );
966+ return modify_gas_defence_unlock (technology_unlock_level_t { 1 } );
967967}
968968
969969bool CountryInstance::is_gas_defence_unlocked () const {
@@ -988,8 +988,8 @@ bool CountryInstance::modify_unit_variant_unlock(unit_variant_t unit_variant, te
988988 if (unlock_level + unlock_level_change < 0 ) {
989989 spdlog::error_s (
990990 " Attempted to change unlock level for unit variant {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
991- static_cast <uint64_t >(unit_variant), *this , static_cast < int64_t >( unlock_level) ,
992- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
991+ static_cast <uint64_t >(unit_variant), *this , unlock_level,
992+ unlock_level_change, unlock_level + unlock_level_change
993993 );
994994 ret = false ;
995995 } else {
@@ -1004,7 +1004,7 @@ bool CountryInstance::modify_unit_variant_unlock(unit_variant_t unit_variant, te
10041004}
10051005
10061006bool CountryInstance::unlock_unit_variant (unit_variant_t unit_variant) {
1007- return modify_unit_variant_unlock (unit_variant, 1 );
1007+ return modify_unit_variant_unlock (unit_variant, technology_unlock_level_t { 1 } );
10081008}
10091009
10101010unit_variant_t CountryInstance::get_max_unlocked_unit_variant () const {
@@ -1020,8 +1020,8 @@ bool CountryInstance::modify_technology_unlock(
10201020 if (unlock_level + unlock_level_change < 0 ) {
10211021 spdlog::error_s (
10221022 " Attempted to change unlock level for technology {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
1023- technology, *this , static_cast < int64_t >( unlock_level) ,
1024- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
1023+ technology, *this , unlock_level,
1024+ unlock_level_change, unlock_level + unlock_level_change
10251025 );
10261026 return false ;
10271027 }
@@ -1053,7 +1053,7 @@ bool CountryInstance::set_technology_unlock_level(
10531053}
10541054
10551055bool CountryInstance::unlock_technology (Technology const & technology) {
1056- return modify_technology_unlock (technology, 1 );
1056+ return modify_technology_unlock (technology, technology_unlock_level_t { 1 } );
10571057}
10581058
10591059bool CountryInstance::is_technology_unlocked (Technology const & technology) const {
@@ -1069,8 +1069,8 @@ bool CountryInstance::modify_invention_unlock(
10691069 if (unlock_level + unlock_level_change < 0 ) {
10701070 spdlog::error_s (
10711071 " Attempted to change unlock level for invention {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
1072- invention, *this , static_cast < int64_t >( unlock_level) ,
1073- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
1072+ invention, *this , unlock_level,
1073+ unlock_level_change, unlock_level + unlock_level_change
10741074 );
10751075 return false ;
10761076 }
@@ -1116,7 +1116,7 @@ bool CountryInstance::set_invention_unlock_level(
11161116}
11171117
11181118bool CountryInstance::unlock_invention (Invention const & invention) {
1119- return modify_invention_unlock (invention, 1 );
1119+ return modify_invention_unlock (invention, technology_unlock_level_t { 1 } );
11201120}
11211121
11221122bool CountryInstance::is_invention_unlocked (Invention const & invention) const {
@@ -1239,7 +1239,7 @@ bool CountryInstance::apply_history_to_country(
12391239 ret &= set_technology_unlock_level (*technology, level);
12401240 }
12411241 for (auto const & [invention, activated] : entry.get_inventions ()) {
1242- ret &= set_invention_unlock_level (*invention, activated ? 1 : 0 );
1242+ ret &= set_invention_unlock_level (*invention, technology_unlock_level_t { static_cast < int8_t >( activated ? 1 : 0 ) } );
12431243 }
12441244
12451245 apply_foreign_investments (entry.get_foreign_investment (), country_instance_manager);
0 commit comments