@@ -782,8 +782,8 @@ bool CountryInstance::modify_unit_type_unlock(UnitTypeBranched<Branch> const& un
782782 if (unlock_level + unlock_level_change < 0 ) {
783783 spdlog::error_s (
784784 " Attempted to change unlock level for unit type {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
785- unit_type, *this , static_cast < int64_t >( unlock_level) ,
786- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
785+ unit_type, *this , unlock_level,
786+ unlock_level_change, unlock_level + unlock_level_change
787787 );
788788 return false ;
789789 }
@@ -842,7 +842,7 @@ bool CountryInstance::modify_unit_type_unlock(UnitType const& unit_type, technol
842842}
843843
844844bool CountryInstance::unlock_unit_type (UnitType const & unit_type) {
845- return modify_unit_type_unlock (unit_type, 1 );
845+ return modify_unit_type_unlock (unit_type, technology_unlock_level_t { 1 } );
846846}
847847
848848bool CountryInstance::is_unit_type_unlocked (UnitType const & unit_type) const {
@@ -871,8 +871,8 @@ bool CountryInstance::modify_building_type_unlock(
871871 if (unlock_level + unlock_level_change < 0 ) {
872872 spdlog::error_s (
873873 " Attempted to change unlock level for building type {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
874- building_type, *this , static_cast < int64_t >( unlock_level), static_cast < int64_t >( unlock_level_change),
875- static_cast < int64_t >( unlock_level + unlock_level_change)
874+ building_type, *this , unlock_level, unlock_level_change,
875+ unlock_level + unlock_level_change
876876 );
877877 return false ;
878878 }
@@ -887,7 +887,7 @@ bool CountryInstance::modify_building_type_unlock(
887887}
888888
889889bool CountryInstance::unlock_building_type (BuildingType const & building_type) {
890- return modify_building_type_unlock (building_type, 1 );
890+ return modify_building_type_unlock (building_type, technology_unlock_level_t { 1 } );
891891}
892892
893893bool CountryInstance::is_building_type_unlocked (BuildingType const & building_type) const {
@@ -901,8 +901,8 @@ bool CountryInstance::modify_crime_unlock(Crime const& crime, technology_unlock_
901901 if (unlock_level + unlock_level_change < 0 ) {
902902 spdlog::error_s (
903903 " Attempted to change unlock level for crime {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
904- crime, *this , static_cast < int64_t >( unlock_level) ,
905- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
904+ crime, *this , unlock_level,
905+ unlock_level_change, unlock_level + unlock_level_change
906906 );
907907 return false ;
908908 }
@@ -913,7 +913,7 @@ bool CountryInstance::modify_crime_unlock(Crime const& crime, technology_unlock_
913913}
914914
915915bool CountryInstance::unlock_crime (Crime const & crime) {
916- return modify_crime_unlock (crime, 1 );
916+ return modify_crime_unlock (crime, technology_unlock_level_t { 1 } );
917917}
918918
919919bool CountryInstance::is_crime_unlocked (Crime const & crime) const {
@@ -925,8 +925,8 @@ bool CountryInstance::modify_gas_attack_unlock(technology_unlock_level_t unlock_
925925 if (gas_attack_unlock_level + unlock_level_change < 0 ) {
926926 spdlog::error_s (
927927 " Attempted to change unlock level for gas attack in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
928- *this , static_cast < int64_t >( gas_attack_unlock_level) ,
929- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( gas_attack_unlock_level + unlock_level_change)
928+ *this , gas_attack_unlock_level,
929+ unlock_level_change, gas_attack_unlock_level + unlock_level_change
930930 );
931931 return false ;
932932 }
@@ -937,7 +937,7 @@ bool CountryInstance::modify_gas_attack_unlock(technology_unlock_level_t unlock_
937937}
938938
939939bool CountryInstance::unlock_gas_attack () {
940- return modify_gas_attack_unlock (1 );
940+ return modify_gas_attack_unlock (technology_unlock_level_t { 1 } );
941941}
942942
943943bool CountryInstance::is_gas_attack_unlocked () const {
@@ -949,8 +949,8 @@ bool CountryInstance::modify_gas_defence_unlock(technology_unlock_level_t unlock
949949 if (gas_defence_unlock_level + unlock_level_change < 0 ) {
950950 spdlog::error_s (
951951 " Attempted to change unlock level for gas defence in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
952- *this , static_cast < int64_t >( gas_defence_unlock_level) ,
953- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( gas_defence_unlock_level + unlock_level_change)
952+ *this , gas_defence_unlock_level,
953+ unlock_level_change, gas_defence_unlock_level + unlock_level_change
954954 );
955955 return false ;
956956 }
@@ -961,7 +961,7 @@ bool CountryInstance::modify_gas_defence_unlock(technology_unlock_level_t unlock
961961}
962962
963963bool CountryInstance::unlock_gas_defence () {
964- return modify_gas_defence_unlock (1 );
964+ return modify_gas_defence_unlock (technology_unlock_level_t { 1 } );
965965}
966966
967967bool CountryInstance::is_gas_defence_unlocked () const {
@@ -986,8 +986,8 @@ bool CountryInstance::modify_unit_variant_unlock(unit_variant_t unit_variant, te
986986 if (unlock_level + unlock_level_change < 0 ) {
987987 spdlog::error_s (
988988 " Attempted to change unlock level for unit variant {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
989- static_cast <uint64_t >(unit_variant), *this , static_cast < int64_t >( unlock_level) ,
990- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
989+ static_cast <uint64_t >(unit_variant), *this , unlock_level,
990+ unlock_level_change, unlock_level + unlock_level_change
991991 );
992992 ret = false ;
993993 } else {
@@ -1002,7 +1002,7 @@ bool CountryInstance::modify_unit_variant_unlock(unit_variant_t unit_variant, te
10021002}
10031003
10041004bool CountryInstance::unlock_unit_variant (unit_variant_t unit_variant) {
1005- return modify_unit_variant_unlock (unit_variant, 1 );
1005+ return modify_unit_variant_unlock (unit_variant, technology_unlock_level_t { 1 } );
10061006}
10071007
10081008unit_variant_t CountryInstance::get_max_unlocked_unit_variant () const {
@@ -1018,8 +1018,8 @@ bool CountryInstance::modify_technology_unlock(
10181018 if (unlock_level + unlock_level_change < 0 ) {
10191019 spdlog::error_s (
10201020 " Attempted to change unlock level for technology {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
1021- technology, *this , static_cast < int64_t >( unlock_level) ,
1022- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
1021+ technology, *this , unlock_level,
1022+ unlock_level_change, unlock_level + unlock_level_change
10231023 );
10241024 return false ;
10251025 }
@@ -1051,7 +1051,7 @@ bool CountryInstance::set_technology_unlock_level(
10511051}
10521052
10531053bool CountryInstance::unlock_technology (Technology const & technology) {
1054- return modify_technology_unlock (technology, 1 );
1054+ return modify_technology_unlock (technology, technology_unlock_level_t { 1 } );
10551055}
10561056
10571057bool CountryInstance::is_technology_unlocked (Technology const & technology) const {
@@ -1067,8 +1067,8 @@ bool CountryInstance::modify_invention_unlock(
10671067 if (unlock_level + unlock_level_change < 0 ) {
10681068 spdlog::error_s (
10691069 " Attempted to change unlock level for invention {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
1070- invention, *this , static_cast < int64_t >( unlock_level) ,
1071- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
1070+ invention, *this , unlock_level,
1071+ unlock_level_change, unlock_level + unlock_level_change
10721072 );
10731073 return false ;
10741074 }
@@ -1114,7 +1114,7 @@ bool CountryInstance::set_invention_unlock_level(
11141114}
11151115
11161116bool CountryInstance::unlock_invention (Invention const & invention) {
1117- return modify_invention_unlock (invention, 1 );
1117+ return modify_invention_unlock (invention, technology_unlock_level_t { 1 } );
11181118}
11191119
11201120bool CountryInstance::is_invention_unlocked (Invention const & invention) const {
@@ -1237,7 +1237,7 @@ bool CountryInstance::apply_history_to_country(
12371237 ret &= set_technology_unlock_level (*technology, level);
12381238 }
12391239 for (auto const & [invention, activated] : entry.get_inventions ()) {
1240- ret &= set_invention_unlock_level (*invention, activated ? 1 : 0 );
1240+ ret &= set_invention_unlock_level (*invention, technology_unlock_level_t { static_cast < int8_t >( activated ? 1 : 0 ) } );
12411241 }
12421242
12431243 apply_foreign_investments (entry.get_foreign_investment (), country_instance_manager);
0 commit comments