From 3bbacd8cc5287d8198da70c7139c17f1ab158251 Mon Sep 17 00:00:00 2001 From: Ramza13 <52087122+Ramza13@users.noreply.github.com> Date: Tue, 18 Feb 2020 08:10:05 -0500 Subject: [PATCH 1/2] more string consts moving --- src/armor_layers.cpp | 2 +- src/avatar_action.cpp | 4 ++-- src/cata_string_consts.h | 7 ++++++- src/editmap.cpp | 3 ++- src/explosion.cpp | 2 +- src/game.cpp | 12 ++++++------ src/iexamine.cpp | 2 +- src/item.cpp | 4 ++-- src/iuse.cpp | 12 ++++++------ src/iuse_actor.cpp | 40 ++++++++++++++++++++-------------------- src/lightmap.cpp | 6 +++--- src/mapdata.cpp | 2 +- src/mapgen_functions.cpp | 8 ++++---- 13 files changed, 55 insertions(+), 49 deletions(-) diff --git a/src/armor_layers.cpp b/src/armor_layers.cpp index a8dc810618923..193354a22d2eb 100644 --- a/src/armor_layers.cpp +++ b/src/armor_layers.cpp @@ -311,7 +311,7 @@ std::vector clothing_flags_description( const item &worn_item ) if( worn_item.has_flag( flag_FIT ) ) { description_stack.push_back( _( "It fits you well." ) ); - } else if( worn_item.has_flag( "VARSIZE" ) ) { + } else if( worn_item.has_flag( flag_VARSIZE ) ) { description_stack.push_back( _( "It could be refitted." ) ); } diff --git a/src/avatar_action.cpp b/src/avatar_action.cpp index 107285c4825fa..13c1c5497c64e 100644 --- a/src/avatar_action.cpp +++ b/src/avatar_action.cpp @@ -681,7 +681,7 @@ bool avatar_action::fire_check( avatar &you, const map &m, const targeting_data if( mode_map.second->has_flag( flag_MOUNTED_GUN ) ) { const bool v_mountable = static_cast( m.veh_at( you.pos() ).part_with_feature( "MOUNTABLE", true ) ); - bool t_mountable = m.has_flag_ter_or_furn( "MOUNTABLE", you.pos() ); + bool t_mountable = m.has_flag_ter_or_furn( flag_MOUNTABLE, you.pos() ); if( !t_mountable && !v_mountable ) { messages.push_back( string_format( _( "You must stand near acceptable terrain or furniture to use this %s. A table, a mound of dirt, a broken window, etc." ), @@ -1140,7 +1140,7 @@ void avatar_action::unload( avatar &you ) it = &you.i_at( loc.obtain( you ) ); } if( you.unload( *it ) ) { - if( it->has_flag( "MAG_DESTROY" ) && it->ammo_remaining() == 0 ) { + if( it->has_flag( flag_MAG_DESTROY ) && it->ammo_remaining() == 0 ) { you.remove_item( *it ); } } diff --git a/src/cata_string_consts.h b/src/cata_string_consts.h index b64c59d334d1d..0fb7374a67d7f 100644 --- a/src/cata_string_consts.h +++ b/src/cata_string_consts.h @@ -962,6 +962,8 @@ static const std::string flag_BOMB( "BOMB" ); static const std::string flag_BUTCHER_EQ( "BUTCHER_EQ" ); static const std::string flag_BYPRODUCT( "BYPRODUCT" ); static const std::string flag_CABLE_SPOOL( "CABLE_SPOOL" ); +static const std::string flag_CAMERA( "CAMERA" ); +static const std::string flag_CAMERA_CONTROL( "CAMERA_CONTROL" ); static const std::string flag_CAMERA_PRO( "CAMERA_PRO" ); static const std::string flag_CAN_SIT( "CAN_SIT" ); static const std::string flag_CANNIBALISM( "CANNIBALISM" ); @@ -1059,6 +1061,7 @@ static const std::string flag_HELMET_COMPAT( "HELMET_COMPAT" ); static const std::string flag_HIDDEN_HALLU( "HIDDEN_HALLU" ); static const std::string flag_HIDDEN_ITEM( "HIDDEN_ITEM" ); static const std::string flag_HIDDEN_POISON( "HIDDEN_POISON" ); +static const std::string flag_HIDE_PLACE( "HIDE_PLACE" ); static const std::string flag_HOOD( "HOOD" ); static const std::string flag_HOT( "HOT" ); static const std::string flag_HURT_WHEN_WIELDED( "HURT_WHEN_WIELDED" ); @@ -1139,6 +1142,7 @@ static const std::string flag_PERSONAL( "PERSONAL" ); static const std::string flag_PLACE_RANDOMLY( "PLACE_RANDOMLY" ); static const std::string flag_PLANT( "PLANT" ); static const std::string flag_PLANTABLE( "PLANTABLE" ); +static const std::string flag_USE_PLAYER_ENERGY( "USE_PLAYER_ENERGY" ); static const std::string flag_PLOWABLE( "PLOWABLE" ); static const std::string flag_POCKETS( "POCKETS" ); static const std::string flag_POWERARMOR_COMPATIBLE( "POWERARMOR_COMPATIBLE" ); @@ -1155,6 +1159,7 @@ static const std::string flag_RADIO_ACTIVATION( "RADIO_ACTIVATION" ); static const std::string flag_RADIO_CONTAINER( "RADIO_CONTAINER" ); static const std::string flag_RADIO_INVOKE_PROC( "RADIO_INVOKE_PROC" ); static const std::string flag_RADIO_MOD( "RADIO_MOD" ); +static const std::string flag_RADIO_MODABLE( "RADIO_MODABLE" ); static const std::string flag_RADIOACTIVE( "RADIOACTIVE" ); static const std::string flag_RADIOCARITEM( "RADIOCARITEM" ); static const std::string flag_RADIOSIGNAL_1( "RADIOSIGNAL_1" ); @@ -1272,7 +1277,7 @@ static const skill_id skill_tailor( "tailor" ); static const skill_id skill_throw( "throw" ); static const skill_id skill_traps( "traps" ); static const skill_id skill_unarmed( "unarmed" ); -static const skill_id weapon_skill( "weapon" ); +static const skill_id skill_weapon( "weapon" ); static const quality_id qual_ANESTHESIA( "ANESTHESIA" ); diff --git a/src/editmap.cpp b/src/editmap.cpp index 622b95d34a317..08b592c0321ae 100644 --- a/src/editmap.cpp +++ b/src/editmap.cpp @@ -50,6 +50,7 @@ #include "shadowcasting.h" #include "string_id.h" #include "colony.h" +#include "cata_string_consts.h" static constexpr tripoint editmap_boundary_min( 0, 0, -OVERMAP_DEPTH ); static constexpr tripoint editmap_boundary_max( MAPSIZE_X, MAPSIZE_Y, OVERMAP_HEIGHT + 1 ); @@ -642,7 +643,7 @@ void editmap::update_view_with_help( const std::string &txt, const std::string & } map_stack target_stack = g->m.i_at( target ); const int target_stack_size = target_stack.size(); - if( !g->m.has_flag( "CONTAINER", target ) && target_stack_size > 0 ) { + if( !g->m.has_flag( flag_CONTAINER, target ) && target_stack_size > 0 ) { trim_and_print( w_info, point( 1, off ), getmaxx( w_info ), c_light_gray, _( "There is a %s there." ), target_stack.begin()->tname() ); diff --git a/src/explosion.cpp b/src/explosion.cpp index a9836a893df07..8fe3d0243f4c3 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -620,7 +620,7 @@ void emp_blast( const tripoint &p ) int x = p.x; int y = p.y; const bool sight = g->u.sees( p ); - if( g->m.has_flag( "CONSOLE", point( x, y ) ) ) { + if( g->m.has_flag( flag_CONSOLE, point( x, y ) ) ) { if( sight ) { add_msg( _( "The %s is rendered non-functional!" ), g->m.tername( point( x, y ) ) ); } diff --git a/src/game.cpp b/src/game.cpp index 6a7f9c0e5097a..abe8e801f6a15 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -5806,9 +5806,9 @@ void game::print_items_info( const tripoint &lp, const catacurses::window &w_loo { if( !m.sees_some_items( lp, u ) ) { return; - } else if( m.has_flag( "CONTAINER", lp ) && !m.could_see_items( lp, u ) ) { + } else if( m.has_flag( flag_CONTAINER, lp ) && !m.could_see_items( lp, u ) ) { mvwprintw( w_look, point( column, ++line ), _( "You cannot see what is inside of it." ) ); - } else if( u.has_effect( effect_blind ) || u.worn_with_flag( "BLIND" ) ) { + } else if( u.has_effect( effect_blind ) || u.worn_with_flag( flag_BLIND ) ) { mvwprintz( w_look, point( column, ++line ), c_yellow, _( "There's something there, but you can't see what it is." ) ); return; @@ -9462,7 +9462,7 @@ bool game::grabbed_furn_move( const tripoint &dp ) critter_at( fdest ) == nullptr && critter_at( fdest ) == nullptr && ( !pulling_furniture || is_empty( u.pos() + dp ) ) && - ( !has_floor || m.has_flag( "FLAT", fdest ) ) && + ( !has_floor || m.has_flag( flag_FLAT, fdest ) ) && !m.has_furn( fdest ) && !m.veh_at( fdest ) && ( !has_floor || m.tr_at( fdest ).is_null() ) @@ -9892,7 +9892,7 @@ void game::vertical_move( int movez, bool force ) bool climbing = false; int move_cost = 100; tripoint stairs( u.posx(), u.posy(), u.posz() + movez ); - if( m.has_zlevels() && !force && movez == 1 && !m.has_flag( "GOES_UP", u.pos() ) ) { + if( m.has_zlevels() && !force && movez == 1 && !m.has_flag( flag_GOES_UP, u.pos() ) ) { // Climbing if( m.has_floor_or_support( stairs ) ) { add_msg( m_info, _( "You can't climb here - there's a ceiling above your head." ) ); @@ -9930,10 +9930,10 @@ void game::vertical_move( int movez, bool force ) } } - if( !force && movez == -1 && !m.has_flag( "GOES_DOWN", u.pos() ) ) { + if( !force && movez == -1 && !m.has_flag( flag_GOES_DOWN, u.pos() ) ) { add_msg( m_info, _( "You can't go down here!" ) ); return; - } else if( !climbing && !force && movez == 1 && !m.has_flag( "GOES_UP", u.pos() ) ) { + } else if( !climbing && !force && movez == 1 && !m.has_flag( flag_GOES_UP, u.pos() ) ) { add_msg( m_info, _( "You can't go up here!" ) ); return; } diff --git a/src/iexamine.cpp b/src/iexamine.cpp index 617948e84634f..2b07c6d9a1005 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -3848,7 +3848,7 @@ static int findBestGasDiscount( player &p ) for( size_t i = 0; i < p.inv.size(); i++ ) { item &it = p.inv.find_item( i ); - if( it.has_flag( "GAS_DISCOUNT" ) ) { + if( it.has_flag( flag_GAS_DISCOUNT ) ) { int q = getGasDiscountCardQuality( it ); if( q > discount ) { diff --git a/src/item.cpp b/src/item.cpp index 7c552d78e4a2d..f4c867a691acb 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -1106,7 +1106,7 @@ void item::basic_info( std::vector &info, const iteminfo_query *parts, } else if( idescription != item_vars.end() ) { info.push_back( iteminfo( "DESCRIPTION", idescription->second ) ); } else { - if( has_flag( "MAGIC_FOCUS" ) ) { + if( has_flag( flag_MAGIC_FOCUS ) ) { info.push_back( iteminfo( "DESCRIPTION", _( "This item is a magical focus. " "You can cast spells with it in your hand." ) ) ); @@ -9418,7 +9418,7 @@ skill_id item::contextualize_skill( const skill_id &id ) const if( id->is_contextual_skill() ) { - if( id == weapon_skill ) { + if( id == skill_weapon ) { if( is_gun() ) { return gun_skill(); } else if( is_melee() ) { diff --git a/src/iuse.cpp b/src/iuse.cpp index 8fb9786610277..9c45bba8b8ec4 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -161,7 +161,7 @@ static const std::vector camera_ter_whitelist_types = { void remove_radio_mod( item &it, player &p ) { - if( !it.has_flag( "RADIO_MOD" ) ) { + if( !it.has_flag( flag_RADIO_MOD ) ) { return; } p.add_msg_if_player( _( "You remove the radio modification from your %s!" ), it.tname() ); @@ -179,7 +179,7 @@ void remove_radio_mod( item &it, player &p ) static bool check_litcig( player &u ) { auto cigs = u.items_with( []( const item & it ) { - return it.active && it.has_flag( "LITCIG" ); + return it.active && it.has_flag( flag_LITCIG ); } ); if( cigs.empty() ) { return true; @@ -674,7 +674,7 @@ int iuse::poison( player *p, item *it, bool, const tripoint & ) // NPCs have a magical sense of what is inedible // Players can abuse the crafting menu instead... - if( !it->has_flag( "HIDDEN_POISON" ) && + if( !it->has_flag( flag_HIDDEN_POISON ) && ( p->is_npc() || !p->query_yn( _( "Are you sure you want to eat this? It looks poisonous…" ) ) ) ) { return 0; @@ -1462,7 +1462,7 @@ int iuse::radio_mod( player *p, item *, bool, const tripoint & ) } auto filter = []( const item & itm ) { - return itm.has_flag( "RADIO_MODABLE" ); + return itm.has_flag( flag_RADIO_MODABLE ); }; // note: if !p->is_npc() then p is avatar @@ -1498,7 +1498,7 @@ int iuse::radio_mod( player *p, item *, bool, const tripoint & ) return 0; } - if( modded.has_flag( "RADIO_MOD" ) && modded.has_flag( newtag ) ) { + if( modded.has_flag( flag_RADIO_MOD ) && modded.has_flag( newtag ) ) { p->add_msg_if_player( _( "This item has been modified this way already." ) ); return 0; } @@ -9319,7 +9319,7 @@ int iuse::wash_items( player *p, bool soft_items, bool hard_items ) crafting_inv.charges_of( "detergent" ) ); const inventory_filter_preset preset( [soft_items, hard_items]( const item_location & location ) { - return location->has_flag( "FILTHY" ) && ( ( soft_items && location->is_soft() ) || + return location->has_flag( flag_FILTHY ) && ( ( soft_items && location->is_soft() ) || ( hard_items && !location->is_soft() ) ); } ); auto make_raw_stats = [available_water, available_cleanser]( diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index aa816181127b4..26b19e1db6c1f 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -145,7 +145,7 @@ int iuse_transform::use( player &p, item &it, bool t, const tripoint &pos ) cons } const bool possess = p.has_item( it ) || - ( it.has_flag( "ALLOWS_REMOTE_USE" ) && square_dist( p.pos(), pos ) == 1 ); + ( it.has_flag( flag_ALLOWS_REMOTE_USE ) && square_dist( p.pos(), pos ) == 1 ); if( possess && need_worn && !p.is_worn( it ) ) { p.add_msg_if_player( m_info, _( "You need to wear the %1$s before activating it." ), it.tname() ); @@ -269,7 +269,7 @@ void iuse_transform::finalize( const itype_id & ) void iuse_transform::info( const item &it, std::vector &dump ) const { item dummy( target, calendar::turn, std::max( ammo_qty, 1 ) ); - if( it.has_flag( "FIT" ) ) { + if( it.has_flag( flag_FIT ) ) { dummy.item_tags.insert( "FIT" ); } dump.emplace_back( "TOOL", string_format( _( "Turns into: %s" ), @@ -1056,21 +1056,21 @@ void deploy_furn_actor::info( const item &, std::vector &dump ) const if( the_furn.workbench.has_value() ) { can_function_as.emplace_back( _( "a crafting station" ) ); } - if( the_furn.has_flag( "BUTCHER_EQ" ) ) { + if( the_furn.has_flag( flag_BUTCHER_EQ ) ) { can_function_as.emplace_back( _( "a place to hang corpses for butchering" ) ); } - if( the_furn.has_flag( "FLAT_SURF" ) ) { + if( the_furn.has_flag( flag_FLAT_SURF ) ) { can_function_as.emplace_back( _( "a flat surface to butcher onto or eat meals from" ) ); } - if( the_furn.has_flag( "CAN_SIT" ) ) { + if( the_furn.has_flag( flag_CAN_SIT ) ) { can_function_as.emplace_back( _( "a place to sit" ) ); } - if( the_furn.has_flag( "HIDE_PLACE" ) ) { + if( the_furn.has_flag( flag_HIDE_PLACE ) ) { can_function_as.emplace_back( _( "a place to hide" ) ); } - if( the_furn.has_flag( "FIRE_CONTAINER" ) ) { + if( the_furn.has_flag( flag_FIRE_CONTAINER ) ) { can_function_as.emplace_back( _( "a safe place to contain a fire" ) ); } if( the_furn.crafting_pseudo_item == "char_smoker" ) { @@ -2448,7 +2448,7 @@ int cast_spell_actor::use( player &p, item &it, bool, const tripoint & ) const cast_spell.values.emplace_back( 0 ); } cast_spell.name = casting.id().c_str(); - if( it.has_flag( "USE_PLAYER_ENERGY" ) ) { + if( it.has_flag( flag_USE_PLAYER_ENERGY ) ) { // [2] this value overrides the mana cost if set to 0 cast_spell.values.emplace_back( 1 ); charges = 0; @@ -3107,7 +3107,7 @@ bool repair_item_actor::can_repair_target( player &pl, const item &fix, } return false; } - if( fix.count_by_charges() || fix.has_flag( "NO_REPAIR" ) ) { + if( fix.count_by_charges() || fix.has_flag( flag_NO_REPAIR ) ) { if( print_msg ) { pl.add_msg_if_player( m_info, _( "You cannot repair this type of item." ) ); } @@ -3128,14 +3128,14 @@ bool repair_item_actor::can_repair_target( player &pl, const item &fix, return false; } - const bool can_be_refitted = fix.has_flag( "VARSIZE" ); - if( can_be_refitted && !fix.has_flag( "FIT" ) ) { + const bool can_be_refitted = fix.has_flag( flag_VARSIZE ); + if( can_be_refitted && !fix.has_flag( flag_FIT ) ) { return true; } const bool resizing_matters = fix.get_encumber( pl ) != 0; const bool small = pl.has_trait( trait_SMALL2 ) || pl.has_trait( trait_SMALL_OK ); - const bool can_resize = small != fix.has_flag( "UNDERSIZE" ); + const bool can_resize = small != fix.has_flag( flag_UNDERSIZE ); if( can_be_refitted && resizing_matters && can_resize ) { return true; } @@ -3152,7 +3152,7 @@ bool repair_item_actor::can_repair_target( player &pl, const item &fix, return false; } - if( fix.has_flag( "PRIMITIVE_RANGED_WEAPON" ) || !fix.reinforceable() ) { + if( fix.has_flag( flag_PRIMITIVE_RANGED_WEAPON ) || !fix.reinforceable() ) { if( print_msg ) { pl.add_msg_if_player( m_info, _( "You cannot improve your %s any more this way." ), fix.tname() ); @@ -3343,7 +3343,7 @@ repair_item_actor::attempt_hint repair_item_actor::repair( player &pl, item &too if( action == RT_REFIT ) { if( roll == SUCCESS ) { - if( !fix->has_flag( "FIT" ) ) { + if( !fix->has_flag( flag_FIT ) ) { pl.add_msg_if_player( m_good, _( "You take your %s in, improving the fit." ), fix->tname() ); fix->item_tags.insert( "FIT" ); @@ -3380,7 +3380,7 @@ repair_item_actor::attempt_hint repair_item_actor::repair( player &pl, item &too } if( action == RT_REINFORCE ) { - if( fix->has_flag( "PRIMITIVE_RANGED_WEAPON" ) || !fix->reinforceable() ) { + if( fix->has_flag( flag_PRIMITIVE_RANGED_WEAPON ) || !fix->reinforceable() ) { pl.add_msg_if_player( m_info, _( "You cannot improve your %s any more this way." ), fix->tname() ); return AS_CANT; @@ -4004,8 +4004,8 @@ int place_trap_actor::use( player &p, item &it, bool, const tripoint & ) const } } - const bool has_shovel = p.has_quality( quality_id( "DIG" ), 3 ); - const bool is_diggable = g->m.has_flag( "DIGGABLE", pos ); + const bool has_shovel = p.has_quality( qual_DIG, 3 ); + const bool is_diggable = g->m.has_flag( flag_DIGGABLE, pos ); bool bury = false; if( could_bury && has_shovel && is_diggable ) { bury = query_yn( _( bury_question ) ); @@ -4144,9 +4144,9 @@ ret_val install_bionic_actor::can_use( const Character &p, const item &it, !p.has_trait( trait_DEBUG_BIONICS ) ) { return ret_val::make_failure( _( "You can't self-install bionics." ) ); } else if( !p.has_trait( trait_DEBUG_BIONICS ) ) { - if( it.has_flag( "FILTHY" ) ) { + if( it.has_flag( flag_FILTHY ) ) { return ret_val::make_failure( _( "You can't install a filthy CBM!" ) ); - } else if( it.has_flag( "NO_STERILE" ) ) { + } else if( it.has_flag( flag_NO_STERILE ) ) { return ret_val::make_failure( _( "This CBM is not sterile, you can't install it." ) ); } else if( it.has_fault( fault_bionic_salvaged ) ) { return ret_val::make_failure( @@ -4422,7 +4422,7 @@ int deploy_tent_actor::use( player &p, item &it, bool, const tripoint & ) const add_msg( m_info, _( "The %s is in the way." ), c->disp_name() ); return 0; } - if( g->m.impassable( dest ) || !g->m.has_flag( "FLAT", dest ) ) { + if( g->m.impassable( dest ) || !g->m.has_flag( flag_FLAT, dest ) ) { add_msg( m_info, _( "The %s in that direction isn't suitable for placing the %s." ), g->m.name( dest ), it.tname() ); return 0; diff --git a/src/lightmap.cpp b/src/lightmap.cpp index 35621adb8e9d7..80a3a01b9284f 100644 --- a/src/lightmap.cpp +++ b/src/lightmap.cpp @@ -1155,10 +1155,10 @@ void map::build_seen_cache( const tripoint &origin, const int target_z ) const tripoint mirror_pos = vp.pos(); // We can utilize the current state of the seen cache to determine // if the player can see the mirror from their position. - if( !vp.info().has_flag( "CAMERA" ) && + if( !vp.info().has_flag( flag_CAMERA ) && seen_cache[mirror_pos.x][mirror_pos.y] < LIGHT_TRANSPARENCY_SOLID + 0.1 ) { continue; - } else if( !vp.info().has_flag( "CAMERA_CONTROL" ) ) { + } else if( !vp.info().has_flag( flag_CAMERA_CONTROL ) ) { mirrors.emplace_back( static_cast( vp.part_index() ) ); } else { if( square_dist( origin, mirror_pos ) <= 1 && veh->camera_on ) { @@ -1168,7 +1168,7 @@ void map::build_seen_cache( const tripoint &origin, const int target_z ) } for( int mirror : mirrors ) { - bool is_camera = veh->part_info( mirror ).has_flag( "CAMERA" ); + bool is_camera = veh->part_info( mirror ).has_flag( flag_CAMERA ); if( is_camera && cam_control < 0 ) { continue; // Player not at camera control, so cameras don't work } diff --git a/src/mapdata.cpp b/src/mapdata.cpp index 298c59d0cb91c..7ee95d700cf20 100644 --- a/src/mapdata.cpp +++ b/src/mapdata.cpp @@ -1303,7 +1303,7 @@ void furn_t::check() const if( !close.is_valid() ) { debugmsg( "invalid furniture %s for closing %s", close.c_str(), id.c_str() ); } - if( has_flag( "EMITTER" ) ) { + if( has_flag( flag_EMITTER ) ) { if( emissions.empty() ) { debugmsg( "furn %s has the EMITTER flag, but no emissions were set", id.c_str() ); } else { diff --git a/src/mapgen_functions.cpp b/src/mapgen_functions.cpp index a308c2388f919..80f46030fbe7c 100644 --- a/src/mapgen_functions.cpp +++ b/src/mapgen_functions.cpp @@ -3534,8 +3534,8 @@ static bool is_suitable_for_stairs( const map *const m, const tripoint &p ) const ter_t &p_ter = m->ter( p ).obj(); return - p_ter.has_flag( "INDOORS" ) && - p_ter.has_flag( "FLAT" ) && + p_ter.has_flag( flag_INDOORS ) && + p_ter.has_flag( flag_FLAT ) && m->furn( p ) == f_null; } @@ -3550,8 +3550,8 @@ static void stairs_debug_log( const map *const m, const std::string &msg, const << " terrain: " << p_ter.name() << " movecost: " << p_ter.movecost << " furniture: " << m->furn( p ).to_i() - << " indoors: " << p_ter.has_flag( "INDOORS" ) - << " flat: " << p_ter.has_flag( "FLAT" ) + << " indoors: " << p_ter.has_flag( flag_INDOORS ) + << " flat: " << p_ter.has_flag( flag_FLAT ) ; } From e96263039f5703b0f948bf9f6ccb6c21b7992e50 Mon Sep 17 00:00:00 2001 From: Ramza13 <52087122+Ramza13@users.noreply.github.com> Date: Tue, 18 Feb 2020 08:11:40 -0500 Subject: [PATCH 2/2] Sorted flags --- src/cata_string_consts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cata_string_consts.h b/src/cata_string_consts.h index 0fb7374a67d7f..2a88bdb537af6 100644 --- a/src/cata_string_consts.h +++ b/src/cata_string_consts.h @@ -1142,7 +1142,6 @@ static const std::string flag_PERSONAL( "PERSONAL" ); static const std::string flag_PLACE_RANDOMLY( "PLACE_RANDOMLY" ); static const std::string flag_PLANT( "PLANT" ); static const std::string flag_PLANTABLE( "PLANTABLE" ); -static const std::string flag_USE_PLAYER_ENERGY( "USE_PLAYER_ENERGY" ); static const std::string flag_PLOWABLE( "PLOWABLE" ); static const std::string flag_POCKETS( "POCKETS" ); static const std::string flag_POWERARMOR_COMPATIBLE( "POWERARMOR_COMPATIBLE" ); @@ -1232,6 +1231,7 @@ static const std::string flag_UNSTABLE( "UNSTABLE" ); static const std::string flag_URSINE_HONEY( "URSINE_HONEY" ); static const std::string flag_USABLE_FIRE( "USABLE_FIRE" ); static const std::string flag_USE_EAT_VERB( "USE_EAT_VERB" ); +static const std::string flag_USE_PLAYER_ENERGY( "USE_PLAYER_ENERGY" ); static const std::string flag_USE_UPS( "USE_UPS" ); static const std::string flag_USES_BIONIC_POWER( "USES_BIONIC_POWER" ); static const std::string flag_VARSIZE( "VARSIZE" );