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

Implement battery item type #32141

Merged
merged 19 commits into from
Jul 15, 2019
Prev Previous commit
Next Next commit
add item::is_battery
  • Loading branch information
ymber committed Jul 9, 2019
commit f5e2cc96d65509b5e2feb8a1702840e34ddf8107
5 changes: 5 additions & 0 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5024,6 +5024,11 @@ bool item::is_magazine() const
return type->magazine.has_value();
}

bool item::is_battery() const
{
return type->battery.has_value();
}

bool item::is_ammo_belt() const
{
return is_magazine() && has_flag( "MAG_BELT" );
Expand Down
1 change: 1 addition & 0 deletions src/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ class item : public visitable<item>
bool is_medication() const; // Is it a medication that only pretends to be food?
bool is_bionic() const;
bool is_magazine() const;
bool is_battery() const;
bool is_ammo_belt() const;
bool is_bandolier() const;
bool is_holster() const;
Expand Down