Skip to content

Commit

Permalink
Various minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
codemime committed Apr 7, 2019
1 parent eb6e0d7 commit 6088811
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/defense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ void defense_game::init_mtypes()
mtype *const t = const_cast<mtype *>( &type );
t->difficulty *= 1.5;
t->difficulty += static_cast<int>( t->difficulty / 5 );
t->set_flag( MF_BASHES, true );
t->set_flag( MF_SMELLS, true );
t->set_flag( MF_HEARS, true );
t->set_flag( MF_SEES, true );
t->set_flag( MF_BASHES );
t->set_flag( MF_SMELLS );
t->set_flag( MF_HEARS );
t->set_flag( MF_SEES );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/enum_bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class enum_bitset
}

private:
std::bitset<size()> bits;
std::bitset<enum_bitset<E>::size()> bits;
};

#endif // ENUM_BITSET_H
2 changes: 1 addition & 1 deletion src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ void monster::process_triggers()

process_trigger( mon_trigger::FIRE, [this]() {
int ret = 0;
for( auto &p : g->m.points_in_radius( pos(), 3 ) ) {
for( const auto &p : g->m.points_in_radius( pos(), 3 ) ) {
ret += 5 * g->m.get_field_strength( p, fd_fire );
}
return ret;
Expand Down
9 changes: 7 additions & 2 deletions src/monstergenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,23 @@ const std::map<std::string, m_flag> flag_map = {

}

namespace io
{

template<>
mon_trigger io::string_to_enum<mon_trigger>( const std::string &trigger )
mon_trigger string_to_enum<mon_trigger>( const std::string &trigger )
{
return string_to_enum_look_up( trigger_map, trigger );
}

template<>
m_flag io::string_to_enum<m_flag>( const std::string &flag )
m_flag string_to_enum<m_flag>( const std::string &flag )
{
return string_to_enum_look_up( flag_map, flag );
}

}

/** @relates string_id */
template<>
const mtype &string_id<mtype>::obj() const
Expand Down
1 change: 0 additions & 1 deletion src/monstergenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#ifndef MONSTERGENERATOR_H
#define MONSTERGENERATOR_H

#include <bitset>
#include <map>
#include <set>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/mtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ struct mtype {
std::string nname( unsigned int quantity = 1 ) const;
bool has_special_attack( const std::string &attack_name ) const;
bool has_flag( m_flag flag ) const;
void set_flag( m_flag flag, bool state );
void set_flag( m_flag flag, bool state = true );
bool made_of( const material_id &material ) const;
bool made_of_any( const std::set<material_id> &materials ) const;
bool has_anger_trigger( mon_trigger trigger ) const;
Expand Down

0 comments on commit 6088811

Please sign in to comment.