mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 11:04:50 +00:00
Units: Try to avoid hard-coding of size of known_boolean_states_.
#7363 added a new invulnerable state but neglected to increment the number of states.
This commit is contained in:
parent
90ef6bcc23
commit
fb095b8abb
@ -868,6 +868,7 @@ public:
|
||||
STATE_UNHEALABLE, /** The unit cannot be healed */
|
||||
STATE_GUARDIAN, /** The unit is a guardian - it won't move unless a target is sighted */
|
||||
STATE_INVULNERABLE, /** The unit is invulnerable - it cannot be hit by any attack */
|
||||
NUMBER_OF_STATES, /** To set the size of known_boolean_states_ */
|
||||
STATE_UNKNOWN = -1 /** A status effect not known to the engine */
|
||||
};
|
||||
|
||||
@ -1908,7 +1909,7 @@ private:
|
||||
|
||||
std::set<std::string> states_;
|
||||
|
||||
static const std::size_t num_bool_states = 7;
|
||||
static const std::size_t num_bool_states = state_t::NUMBER_OF_STATES;
|
||||
|
||||
std::bitset<num_bool_states> known_boolean_states_;
|
||||
static std::map<std::string, state_t> known_boolean_state_names_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user