@@ -783,8 +783,8 @@ bool CountryInstance::modify_unit_type_unlock(UnitTypeBranched<Branch> const& un
783783 if (unlock_level + unlock_level_change < 0 ) {
784784 spdlog::error_s (
785785 " Attempted to change unlock level for unit type {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
786- unit_type, *this , static_cast < int64_t >( unlock_level) ,
787- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
786+ unit_type, *this , unlock_level,
787+ unlock_level_change, unlock_level + unlock_level_change
788788 );
789789 return false ;
790790 }
@@ -843,7 +843,7 @@ bool CountryInstance::modify_unit_type_unlock(UnitType const& unit_type, technol
843843}
844844
845845bool CountryInstance::unlock_unit_type (UnitType const & unit_type) {
846- return modify_unit_type_unlock (unit_type, 1 );
846+ return modify_unit_type_unlock (unit_type, technology_unlock_level_t { 1 } );
847847}
848848
849849bool CountryInstance::is_unit_type_unlocked (UnitType const & unit_type) const {
@@ -872,8 +872,8 @@ bool CountryInstance::modify_building_type_unlock(
872872 if (unlock_level + unlock_level_change < 0 ) {
873873 spdlog::error_s (
874874 " Attempted to change unlock level for building type {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
875- building_type, *this , static_cast < int64_t >( unlock_level), static_cast < int64_t >( unlock_level_change),
876- static_cast < int64_t >( unlock_level + unlock_level_change)
875+ building_type, *this , unlock_level, unlock_level_change,
876+ unlock_level + unlock_level_change
877877 );
878878 return false ;
879879 }
@@ -888,7 +888,7 @@ bool CountryInstance::modify_building_type_unlock(
888888}
889889
890890bool CountryInstance::unlock_building_type (BuildingType const & building_type) {
891- return modify_building_type_unlock (building_type, 1 );
891+ return modify_building_type_unlock (building_type, technology_unlock_level_t { 1 } );
892892}
893893
894894bool CountryInstance::is_building_type_unlocked (BuildingType const & building_type) const {
@@ -902,8 +902,8 @@ bool CountryInstance::modify_crime_unlock(Crime const& crime, technology_unlock_
902902 if (unlock_level + unlock_level_change < 0 ) {
903903 spdlog::error_s (
904904 " Attempted to change unlock level for crime {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
905- crime, *this , static_cast < int64_t >( unlock_level) ,
906- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
905+ crime, *this , unlock_level,
906+ unlock_level_change, unlock_level + unlock_level_change
907907 );
908908 return false ;
909909 }
@@ -914,7 +914,7 @@ bool CountryInstance::modify_crime_unlock(Crime const& crime, technology_unlock_
914914}
915915
916916bool CountryInstance::unlock_crime (Crime const & crime) {
917- return modify_crime_unlock (crime, 1 );
917+ return modify_crime_unlock (crime, technology_unlock_level_t { 1 } );
918918}
919919
920920bool CountryInstance::is_crime_unlocked (Crime const & crime) const {
@@ -926,8 +926,8 @@ bool CountryInstance::modify_gas_attack_unlock(technology_unlock_level_t unlock_
926926 if (gas_attack_unlock_level + unlock_level_change < 0 ) {
927927 spdlog::error_s (
928928 " Attempted to change unlock level for gas attack in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
929- *this , static_cast < int64_t >( gas_attack_unlock_level) ,
930- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( gas_attack_unlock_level + unlock_level_change)
929+ *this , gas_attack_unlock_level,
930+ unlock_level_change, gas_attack_unlock_level + unlock_level_change
931931 );
932932 return false ;
933933 }
@@ -938,7 +938,7 @@ bool CountryInstance::modify_gas_attack_unlock(technology_unlock_level_t unlock_
938938}
939939
940940bool CountryInstance::unlock_gas_attack () {
941- return modify_gas_attack_unlock (1 );
941+ return modify_gas_attack_unlock (technology_unlock_level_t { 1 } );
942942}
943943
944944bool CountryInstance::is_gas_attack_unlocked () const {
@@ -950,8 +950,8 @@ bool CountryInstance::modify_gas_defence_unlock(technology_unlock_level_t unlock
950950 if (gas_defence_unlock_level + unlock_level_change < 0 ) {
951951 spdlog::error_s (
952952 " Attempted to change unlock level for gas defence in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
953- *this , static_cast < int64_t >( gas_defence_unlock_level) ,
954- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( gas_defence_unlock_level + unlock_level_change)
953+ *this , gas_defence_unlock_level,
954+ unlock_level_change, gas_defence_unlock_level + unlock_level_change
955955 );
956956 return false ;
957957 }
@@ -962,7 +962,7 @@ bool CountryInstance::modify_gas_defence_unlock(technology_unlock_level_t unlock
962962}
963963
964964bool CountryInstance::unlock_gas_defence () {
965- return modify_gas_defence_unlock (1 );
965+ return modify_gas_defence_unlock (technology_unlock_level_t { 1 } );
966966}
967967
968968bool CountryInstance::is_gas_defence_unlocked () const {
@@ -987,8 +987,8 @@ bool CountryInstance::modify_unit_variant_unlock(unit_variant_t unit_variant, te
987987 if (unlock_level + unlock_level_change < 0 ) {
988988 spdlog::error_s (
989989 " Attempted to change unlock level for unit variant {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
990- static_cast <uint64_t >(unit_variant), *this , static_cast < int64_t >( unlock_level) ,
991- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
990+ static_cast <uint64_t >(unit_variant), *this , unlock_level,
991+ unlock_level_change, unlock_level + unlock_level_change
992992 );
993993 ret = false ;
994994 } else {
@@ -1003,7 +1003,7 @@ bool CountryInstance::modify_unit_variant_unlock(unit_variant_t unit_variant, te
10031003}
10041004
10051005bool CountryInstance::unlock_unit_variant (unit_variant_t unit_variant) {
1006- return modify_unit_variant_unlock (unit_variant, 1 );
1006+ return modify_unit_variant_unlock (unit_variant, technology_unlock_level_t { 1 } );
10071007}
10081008
10091009unit_variant_t CountryInstance::get_max_unlocked_unit_variant () const {
@@ -1019,8 +1019,8 @@ bool CountryInstance::modify_technology_unlock(
10191019 if (unlock_level + unlock_level_change < 0 ) {
10201020 spdlog::error_s (
10211021 " Attempted to change unlock level for technology {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
1022- technology, *this , static_cast < int64_t >( unlock_level) ,
1023- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
1022+ technology, *this , unlock_level,
1023+ unlock_level_change, unlock_level + unlock_level_change
10241024 );
10251025 return false ;
10261026 }
@@ -1052,7 +1052,7 @@ bool CountryInstance::set_technology_unlock_level(
10521052}
10531053
10541054bool CountryInstance::unlock_technology (Technology const & technology) {
1055- return modify_technology_unlock (technology, 1 );
1055+ return modify_technology_unlock (technology, technology_unlock_level_t { 1 } );
10561056}
10571057
10581058bool CountryInstance::is_technology_unlocked (Technology const & technology) const {
@@ -1068,8 +1068,8 @@ bool CountryInstance::modify_invention_unlock(
10681068 if (unlock_level + unlock_level_change < 0 ) {
10691069 spdlog::error_s (
10701070 " Attempted to change unlock level for invention {} in country {} to invalid value: current level = {}, change = {}, invalid new value = {}" ,
1071- invention, *this , static_cast < int64_t >( unlock_level) ,
1072- static_cast < int64_t >( unlock_level_change), static_cast < int64_t >( unlock_level + unlock_level_change)
1071+ invention, *this , unlock_level,
1072+ unlock_level_change, unlock_level + unlock_level_change
10731073 );
10741074 return false ;
10751075 }
@@ -1115,7 +1115,7 @@ bool CountryInstance::set_invention_unlock_level(
11151115}
11161116
11171117bool CountryInstance::unlock_invention (Invention const & invention) {
1118- return modify_invention_unlock (invention, 1 );
1118+ return modify_invention_unlock (invention, technology_unlock_level_t { 1 } );
11191119}
11201120
11211121bool CountryInstance::is_invention_unlocked (Invention const & invention) const {
@@ -1238,7 +1238,7 @@ bool CountryInstance::apply_history_to_country(
12381238 ret &= set_technology_unlock_level (*technology, level);
12391239 }
12401240 for (auto const & [invention, activated] : entry.get_inventions ()) {
1241- ret &= set_invention_unlock_level (*invention, activated ? 1 : 0 );
1241+ ret &= set_invention_unlock_level (*invention, technology_unlock_level_t { static_cast < int8_t >( activated ? 1 : 0 ) } );
12421242 }
12431243
12441244 apply_foreign_investments (entry.get_foreign_investment (), country_instance_manager);
0 commit comments