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

Optimize inbounds #27825

Merged
merged 3 commits into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add reactir flag to vehicle part bitfield.
  • Loading branch information
kevingranade committed Jan 24, 2019
commit b872857fd45c676098279923e5847a81360b1ed0
1 change: 1 addition & 0 deletions src/veh_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ static const std::unordered_map<std::string, vpart_bitflags> vpart_bitflag_map =
{ "ENABLED_DRAINS_EPOWER", VPFLAG_ENABLED_DRAINS_EPOWER },
{ "WASHING_MACHINE", VPFLAG_WASHING_MACHINE },
{ "FLUIDTANK", VPFLAG_FLUIDTANK },
{ "REACTOR", VPFLAG_REACTOR },
};

static const std::vector<std::pair<std::string, int>> standard_terrain_mod = {{
Expand Down
1 change: 1 addition & 0 deletions src/veh_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ enum vpart_bitflags : int {
VPFLAG_ENABLED_DRAINS_EPOWER,
VPFLAG_WASHING_MACHINE,
VPFLAG_FLUIDTANK,
VPFLAG_REACTOR,

NUM_VPFLAGS
};
Expand Down
4 changes: 2 additions & 2 deletions src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ void vehicle::init_state( int init_veh_fuel, int init_veh_status )
const size_t p = vp.part_index();
vehicle_part &pt = vp.part();

if( vp.has_feature( "REACTOR" ) ) {
if( vp.has_feature( VPFLAG_REACTOR ) ) {
// De-hardcoded reactors. Should always start active
pt.enabled = true;
}
Expand Down Expand Up @@ -4368,7 +4368,7 @@ void vehicle::refresh()
if( vpi.has_flag( VPFLAG_ENGINE ) ) {
engines.push_back( p );
}
if( vpi.has_flag( "REACTOR" ) ) {
if( vpi.has_flag( VPFLAG_REACTOR ) ) {
reactors.push_back( p );
}
if( vpi.has_flag( VPFLAG_SOLAR_PANEL ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/vehicle_part.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ bool vehicle_part::is_battery() const

bool vehicle_part::is_reactor() const
{
return info().has_flag( "REACTOR" );
return info().has_flag( VPFLAG_REACTOR );
}

bool vehicle_part::is_turret() const
Expand Down