Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile error #79172

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7649,9 +7649,7 @@ void Character::drench_mut_calc()
weighted_int_list<mutation_category_id> Character::get_vitamin_weighted_categories() const
{
weighted_int_list<mutation_category_id> weighted_output;
const std::map<mutation_category_id, mutation_category_trait> &mutation_categories =
mutation_category_trait::get_all();
for( const auto &elem : mutation_categories ) {
for( const auto &elem : mutation_category_trait::get_all() ) {
add_msg_debug( debugmode::DF_MUTATION, "get_vitamin_weighted_categories: category %s weight %d",
elem.second.id.c_str(), vitamin_get( elem.second.vitamin ) );
weighted_output.add( elem.first, vitamin_get( elem.second.vitamin ) );
Expand Down
45 changes: 23 additions & 22 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,22 @@ void iexamine::genemill( Character &you, const tripoint_bub_ms & )
std::vector<trait_id> threshreq = mut.threshreq;
bool c_has_threshreq = threshreq.empty() ? true : false;

//Bionic Incompatibility
std::vector<std::string> bionics;
for( const bionic_id &bid : you.get_bionics() ) {
if( bid->mutation_conflicts.count( trait ) != 0 ) {
bionics.push_back( bid->name.translated() );
}
}
if( !bionics.empty() ) {
context_string = string_format( " <color_red>%s %s</color>", _( "Conflicts with installed:" ),
string_join( bionics, ", " ) );
can_select = false;
genemenu.addentry_col( i, can_select, input_event(), mut.name(), context_string );
i++;
continue;
}

//Threshold requirement
for( const trait_id &c : threshreq ) {
if( you.has_permanent_trait( c ) ) {
Expand All @@ -492,29 +508,14 @@ void iexamine::genemill( Character &you, const tripoint_bub_ms & )
}
}
if( !c_has_threshreq ) {
std::vector<std::string> thresholds;
thresholds.reserve( threshreq.size() );
for( const trait_id &c : threshreq ) {
thresholds.push_back( c->name() );
}
context_string = ( _( " %s" ), string_join( thresholds, ", " ) );
context_string =
string_format( " <color_red>Requires either of the following traits: %s</color>",
context_string );
can_select = false;
}

//Bionic Incompatibility
std::vector<std::string> bionics;
for( const bionic_id &bid : you.get_bionics() ) {
if( bid->mutation_conflicts.count( trait ) != 0 ) {
bionics.push_back( bid->name.translated() );
context_string = string_format( " <color_red>%s ",
_( "Requires any of the following traits:" ) );
for( size_t i = 0; i < threshreq.size() - 1; i++ ) {
context_string += threshreq[i]->name();
context_string += ", ";
}
}
if( !bionics.empty() ) {
context_string = string_join( bionics, ", " );
context_string = string_format( " <color_red>Conflicts with installed: %s</color>",
context_string );
context_string += threshreq[threshreq.size() - 1]->name();
context_string += "</color>";
can_select = false;
}

Expand Down
3 changes: 1 addition & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,7 @@ item::item( const itype *type, time_point turn, int qty ) : type( type ), bday(
}

if( type->trait_group.is_valid() ) {
const trait_group::Trait_list &tlist = trait_group::traits_from( type->trait_group );
for( const trait_and_var &tr : tlist ) {
for( const trait_and_var &tr : trait_group::traits_from( type->trait_group ) ) {
template_traits.push_back( tr.trait );
}
}
Expand Down
Loading