From c7fa7dbed41f1d347fabcc05713475f70db85173 Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Wed, 21 Aug 2019 05:16:01 -0400 Subject: [PATCH] Enable readability-inconsistent-declaration-parameter-name This check enforces that parameter names in declarations should match those in definitions. --- .clang-tidy | 1 - src/animation.cpp | 22 +++++----- src/auto_pickup.h | 6 +-- src/avatar.h | 4 +- src/basecamp.h | 4 +- src/bionics.cpp | 4 +- src/cata_tiles.h | 6 +-- src/character.h | 12 +++--- src/cursesport.cpp | 8 ++-- src/dialogue.h | 20 ++++----- src/faction.h | 2 +- src/field.h | 2 +- src/game.h | 25 +++++------ src/input.h | 8 ++-- src/inventory.h | 8 ++-- src/item.h | 30 +++++++------- src/item_factory.h | 12 +++--- src/item_group.h | 2 +- src/iuse_actor.h | 76 +++++++++++++++++----------------- src/json.h | 6 +-- src/magic.h | 6 +-- src/magic_teleporter_list.h | 2 +- src/magic_ter_furn_transform.h | 4 +- src/map.h | 16 +++---- src/mapgen_functions.h | 48 ++++++++++----------- src/martialarts.h | 12 +++--- src/mattack_actors.h | 10 ++--- src/mission.h | 2 +- src/mod_manager.h | 2 +- src/mongroup.h | 10 ++--- src/monster.h | 24 +++++------ src/mtype.h | 4 +- src/npc.h | 36 ++++++++-------- src/npc_favor.h | 2 +- src/options.h | 4 +- src/output.cpp | 4 +- src/output.h | 29 ++++++------- src/overmap.h | 12 +++--- src/overmapbuffer.h | 6 +-- src/panels.cpp | 6 +-- src/panels.h | 2 +- src/player.cpp | 11 ++--- src/player.h | 54 ++++++++++++------------ src/player_activity.h | 2 +- src/recipe_groups.h | 2 +- src/requirements.h | 2 +- src/rng.h | 2 +- src/shadowcasting.h | 2 +- src/skill.h | 2 +- src/string_formatter.h | 2 +- src/veh_utils.h | 2 +- src/vehicle.h | 36 ++++++++-------- 52 files changed, 310 insertions(+), 306 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 989bcfebbef06..f5ccc3fef40fb 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -49,7 +49,6 @@ readability-*,\ -readability-else-after-return,\ -readability-function-size,\ -readability-implicit-bool-conversion,\ --readability-inconsistent-declaration-parameter-name,\ -readability-isolate-declaration,\ -readability-magic-numbers,\ -readability-named-parameter,\ diff --git a/src/animation.cpp b/src/animation.cpp index 71eebdbe54400..a9289469178a2 100644 --- a/src/animation.cpp +++ b/src/animation.cpp @@ -563,27 +563,29 @@ void draw_line_curses( game &g, const tripoint &pos, const tripoint ¢er, } //namespace #if defined(TILES) -void game::draw_line( const tripoint &p, const tripoint ¢er, const std::vector &ret ) +void game::draw_line( const tripoint &p, const tripoint ¢er, + const std::vector &points ) { if( !u.sees( p ) ) { return; } if( !use_tiles ) { - draw_line_curses( *this, p, center, ret ); // TODO: needed for tiles ver too?? + draw_line_curses( *this, p, center, points ); // TODO: needed for tiles ver too?? return; } - tilecontext->init_draw_line( p, ret, "line_target", true ); + tilecontext->init_draw_line( p, points, "line_target", true ); } #else -void game::draw_line( const tripoint &p, const tripoint ¢er, const std::vector &ret ) +void game::draw_line( const tripoint &p, const tripoint ¢er, + const std::vector &points ) { if( !u.sees( p ) ) { return; } - draw_line_curses( *this, p, center, ret ); + draw_line_curses( *this, p, center, points ); } #endif @@ -602,17 +604,17 @@ void draw_line_curses( game &g, const std::vector &points ) } //namespace #if defined(TILES) -void game::draw_line( const tripoint &p, const std::vector &vPoint ) +void game::draw_line( const tripoint &p, const std::vector &points ) { - draw_line_curses( *this, vPoint ); - tilecontext->init_draw_line( p, vPoint, "line_trail", false ); + draw_line_curses( *this, points ); + tilecontext->init_draw_line( p, points, "line_trail", false ); } #else -void game::draw_line( const tripoint &p, const std::vector &vPoint ) +void game::draw_line( const tripoint &p, const std::vector &points ) { ( void )p; //unused - draw_line_curses( *this, vPoint ); + draw_line_curses( *this, points ); } #endif diff --git a/src/auto_pickup.h b/src/auto_pickup.h index c31fbfb8b0fa3..d466a2c8d2218 100644 --- a/src/auto_pickup.h +++ b/src/auto_pickup.h @@ -51,7 +51,7 @@ class rule rule( const std::string &r, const bool a, const bool e ) : sRule( r ), bActive( a ), bExclude( e ) { } - void serialize( JsonOut &json ) const; + void serialize( JsonOut &jsout ) const; void deserialize( JsonIn &jsin ); void test_pattern() const; @@ -63,7 +63,7 @@ class rule class rule_list : public std::vector { public: - void serialize( JsonOut &json ) const; + void serialize( JsonOut &jsout ) const; void deserialize( JsonIn &jsin ); void load_legacy_rules( std::istream &fin ); @@ -156,7 +156,7 @@ class npc_settings : public base_settings void show( const std::string &name ); - void serialize( JsonOut &json ) const; + void serialize( JsonOut &jsout ) const; void deserialize( JsonIn &jsin ); bool empty() const; diff --git a/src/avatar.h b/src/avatar.h index f3e08359867d9..fcbd5e88e58e5 100644 --- a/src/avatar.h +++ b/src/avatar.h @@ -35,8 +35,8 @@ class avatar : public player void store( JsonOut &json ) const; void load( JsonObject &data ); - void serialize( JsonOut &josn ) const override; - void deserialize( JsonIn &json ) override; + void serialize( JsonOut &json ) const override; + void deserialize( JsonIn &jsin ) override; void serialize_map_memory( JsonOut &jsout ) const; void deserialize_map_memory( JsonIn &jsin ); diff --git a/src/basecamp.h b/src/basecamp.h index 2f9015d07b2f1..4c1fd4e49350b 100644 --- a/src/basecamp.h +++ b/src/basecamp.h @@ -197,7 +197,7 @@ class basecamp std::string gathering_description( const std::string &bldg ); /// Returns a string for the number of plants that are harvestable, plots ready to plany, /// and ground that needs tilling - std::string farm_description( const tripoint &omt_pos, size_t &plots_count, + std::string farm_description( const tripoint &farm_pos, size_t &plots_count, farm_ops operation ); /// Returns the description of a camp crafting options. converts fire charges to charcoal, /// allows dark crafting @@ -271,7 +271,7 @@ class basecamp * @param omt_trg the overmap pos3 of the farm_ops * @param op whether to plow, plant, or harvest */ - bool farm_return( const std::string &task, const tripoint &omt_trg, farm_ops op ); + bool farm_return( const std::string &task, const tripoint &omt_tgt, farm_ops op ); void fortifications_return(); void combat_mission_return( const std::string &miss ); diff --git a/src/bionics.cpp b/src/bionics.cpp index 756978b73d05a..dc8b32bb4b240 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -2197,7 +2197,7 @@ void bionic::deserialize( JsonIn &jsin ) } void player::introduce_into_anesthesia( const time_duration &duration, player &installer, - bool anesthetic ) //used by the Autodoc + bool needs_anesthesia ) //used by the Autodoc { installer.add_msg_player_or_npc( m_info, _( "You set up the operation step-by-step, configuring the Autodoc to manipulate a CBM." ), @@ -2206,7 +2206,7 @@ void player::introduce_into_anesthesia( const time_duration &duration, player &i add_msg_player_or_npc( m_info, _( "You settle into position, sliding your right wrist into the couch's strap." ), _( " settles into position, sliding their wrist into the couch's strap." ) ); - if( anesthetic ) { + if( needs_anesthesia ) { //post-threshold medical mutants do not fear operations. if( has_trait( trait_THRESH_MEDICAL ) ) { add_msg_if_player( m_mixed, diff --git a/src/cata_tiles.h b/src/cata_tiles.h index 5fae6e24961a0..c36ce46a59973 100644 --- a/src/cata_tiles.h +++ b/src/cata_tiles.h @@ -182,7 +182,7 @@ class tileset_loader void process_variations_after_loading( weighted_int_list> &v ); - void add_ascii_subtile( tile_type &curr_tile, const std::string &t_id, int fg, + void add_ascii_subtile( tile_type &curr_tile, const std::string &t_id, int sprite_id, const std::string &s_id ); void load_ascii_set( JsonObject &entry ); /** @@ -309,8 +309,8 @@ class cata_tiles /* Tile Picking */ void get_tile_values( int t, const int *tn, int &subtile, int &rotation ); void get_connect_values( const tripoint &p, int &subtile, int &rotation, int connect_group ); - void get_terrain_orientation( const tripoint &p, int &rota, int &subtype ); - void get_rotation_and_subtile( char val, int &rota, int &subtype ); + void get_terrain_orientation( const tripoint &p, int &rota, int &subtile ); + void get_rotation_and_subtile( char val, int &rota, int &subtile ); /** Drawing Layers */ bool apply_vision_effects( const tripoint &pos, visibility_type visibility ); diff --git a/src/character.h b/src/character.h index 721578ea178f8..24cac55acfc35 100644 --- a/src/character.h +++ b/src/character.h @@ -383,11 +383,11 @@ class Character : public Creature, public visitable // In mutation.cpp /** Returns true if the player has the entered trait */ - bool has_trait( const trait_id &flag ) const override; + bool has_trait( const trait_id &b ) const override; /** Returns true if the player has the entered starting trait */ - bool has_base_trait( const trait_id &flag ) const; + bool has_base_trait( const trait_id &b ) const; /** Returns true if player has a trait with a flag */ - bool has_trait_flag( const std::string &flag ) const; + bool has_trait_flag( const std::string &b ) const; /** Returns the trait id with the given invlet, or an empty string if no trait has that invlet */ trait_id trait_by_invlet( int ch ) const; @@ -898,7 +898,7 @@ class Character : public Creature, public visitable // how loud a character can shout. based on mutations and clothing int get_shout_volume() const; // shouts a message - void shout( std::string text = "", bool order = false ); + void shout( std::string msg = "", bool order = false ); /** Handles Character vomiting effects */ void vomit(); // adds total healing to the bodypart. this is only a counter. @@ -960,8 +960,8 @@ class Character : public Creature, public visitable */ std::vector cached_mutations; - void store( JsonOut &jsout ) const; - void load( JsonObject &jsin ); + void store( JsonOut &json ) const; + void load( JsonObject &data ); // --------------- Values --------------- pimpl _skills; diff --git a/src/cursesport.cpp b/src/cursesport.cpp index d93075f21c0cc..00598eee92531 100644 --- a/src/cursesport.cpp +++ b/src/cursesport.cpp @@ -390,23 +390,23 @@ inline void printstring( cata_cursesport::WINDOW *win, const std::string &text ) } //Prints a formatted string to a window at the current cursor, base function -void catacurses::wprintw( const window &win, const std::string &printbuf ) +void catacurses::wprintw( const window &win, const std::string &text ) { if( !win ) { // TODO: log this return; } - return printstring( win.get(), printbuf ); + return printstring( win.get(), text ); } //Prints a formatted string to a window, moves the cursor -void catacurses::mvwprintw( const window &win, const point &p, const std::string &printbuf ) +void catacurses::mvwprintw( const window &win, const point &p, const std::string &text ) { if( !wmove_internal( win, p ) ) { return; } - return printstring( win.get(), printbuf ); + return printstring( win.get(), text ); } //Resizes the underlying terminal after a Window's console resize(maybe?) Not used in TILES diff --git a/src/dialogue.h b/src/dialogue.h index 3ddbe9ad1efbd..057a2f4a4b72b 100644 --- a/src/dialogue.h +++ b/src/dialogue.h @@ -89,9 +89,9 @@ struct talk_effect_fun_t { public: talk_effect_fun_t() = default; - talk_effect_fun_t( talkfunction_ptr effect ); - talk_effect_fun_t( std::function effect ); - talk_effect_fun_t( std::function fun ); + talk_effect_fun_t( talkfunction_ptr ); + talk_effect_fun_t( std::function ); + talk_effect_fun_t( std::function ); void set_companion_mission( const std::string &role_id ); void set_add_effect( JsonObject jo, const std::string &member, bool is_npc = false ); void set_remove_effect( JsonObject jo, const std::string &member, bool is_npc = false ); @@ -99,16 +99,16 @@ struct talk_effect_fun_t { void set_remove_trait( JsonObject jo, const std::string &member, bool is_npc = false ); void set_add_var( JsonObject jo, const std::string &member, bool is_npc = false ); void set_remove_var( JsonObject jo, const std::string &member, bool is_npc = false ); - void set_u_buy_item( const std::string &new_trait, int cost, int count, + void set_u_buy_item( const std::string &item_name, int cost, int count, const std::string &container_name ); void set_u_spend_cash( int amount ); - void set_u_sell_item( const std::string &new_trait, int cost, int count ); + void set_u_sell_item( const std::string &item_name, int cost, int count ); void set_consume_item( JsonObject jo, const std::string &member, int count, bool is_npc = false ); void set_remove_item_with( JsonObject jo, const std::string &member, bool is_npc = false ); void set_npc_change_faction( const std::string &faction_name ); - void set_npc_change_class( const std::string &faction_class ); - void set_change_faction_rep( int amount ); + void set_npc_change_class( const std::string &class_name ); + void set_change_faction_rep( int rep_change ); void set_add_debt( const std::vector &debt_modifiers ); void set_toggle_npc_rule( const std::string &rule ); void set_set_npc_rule( const std::string &rule ); @@ -156,12 +156,12 @@ struct talk_effect_t { /** * Sets an effect and consequence based on function pointer. */ - void set_effect( talkfunction_ptr effect ); - void set_effect( const talk_effect_fun_t &effect ); + void set_effect( talkfunction_ptr ); + void set_effect( const talk_effect_fun_t & ); /** * Sets an effect to a function object and consequence to explicitly given one. */ - void set_effect_consequence( const talk_effect_fun_t &eff, dialogue_consequence con ); + void set_effect_consequence( const talk_effect_fun_t &fun, dialogue_consequence con ); void set_effect_consequence( std::function ptr, dialogue_consequence con ); void load_effect( JsonObject &jo ); diff --git a/src/faction.h b/src/faction.h index d4aa392190c3f..5d12b6fe612df 100644 --- a/src/faction.h +++ b/src/faction.h @@ -89,7 +89,7 @@ class faction : public faction_template faction( const faction_template &templ ); void deserialize( JsonIn &jsin ); - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; std::string describe() const; diff --git a/src/field.h b/src/field.h index dc816ecdf17d1..6c2e053e8f7f6 100644 --- a/src/field.h +++ b/src/field.h @@ -158,7 +158,7 @@ class field * function returns true. * @return True if the field was removed, false if it did not exist in the first place. */ - bool remove_field( field_type_id type_to_remove ); + bool remove_field( field_type_id field_to_remove ); /** * Make sure to decrement the field counter in the submap. * Removes the field entry, the iterator must point into @ref _field_type_list and must be valid. diff --git a/src/game.h b/src/game.h index 79aeaaac5f05f..25c19d21dcb22 100644 --- a/src/game.h +++ b/src/game.h @@ -232,7 +232,7 @@ class game /** Returns the other end of the stairs (if any). May query, affect u etc. */ cata::optional find_or_make_stairs( map &mp, int z_after, bool &rope_ladder ); /** Actual z-level movement part of vertical_move. Doesn't include stair finding, traps etc. */ - void vertical_shift( int dest_z ); + void vertical_shift( int z_after ); /** Add goes up/down auto_notes (if turned on) */ void vertical_notes( int z_before, int z_after ); /** Checks to see if a player can use a computer (not illiterate, etc.) and uses if able. */ @@ -285,7 +285,7 @@ class game /** Spawns a hallucination at a determined position. */ bool spawn_hallucination( const tripoint &p ); /** Swaps positions of two creatures */ - bool swap_critters( Creature &first, Creature &second ); + bool swap_critters( Creature &, Creature & ); private: friend class monster_range; @@ -404,16 +404,16 @@ class game * If the monster was revived, the caller should remove the corpse item. * If reviving failed, the item is unchanged, as is the environment (no new monsters). */ - bool revive_corpse( const tripoint &location, item &corpse ); + bool revive_corpse( const tripoint &p, item &it ); /**Turns Broken Cyborg monster into Cyborg NPC via surgery*/ void save_cyborg( item *cyborg, const tripoint &couch_pos, player &installer ); /** Asks if the player wants to cancel their activity, and if so cancels it. */ - bool cancel_activity_query( const std::string &message ); + bool cancel_activity_query( const std::string &text ); /** Asks if the player wants to cancel their activity and if so cancels it. Additionally checks * if the player wants to ignore further distractions. */ - bool cancel_activity_or_ignore_query( distraction_type type, const std::string &reason ); + bool cancel_activity_or_ignore_query( distraction_type type, const std::string &text ); /** Handles players exiting from moving vehicles. */ - void moving_vehicle_dismount( const tripoint &p ); + void moving_vehicle_dismount( const tripoint &dest_loc ); /** Returns the current remotely controlled vehicle. */ vehicle *remoteveh(); @@ -439,7 +439,7 @@ class game /** Unloads, then loads the NPCs */ void reload_npcs(); /** Returns the number of kills of the given mon_id by the player. */ - int kill_count( const mtype_id &id ); + int kill_count( const mtype_id &mon ); /** Returns the number of kills of the given monster species by the player. */ int kill_count( const species_id &spec ); /** Increments the number of kills of the given mtype_id by the player upwards. */ @@ -518,7 +518,7 @@ class game const tripoint &start_point, bool has_first_point, bool select_zone, bool peeking ); // Shared method to print "look around" info - void pre_print_all_tile_info( const tripoint &lp, const catacurses::window &w_look, + void pre_print_all_tile_info( const tripoint &lp, const catacurses::window &w_info, int &line, int last_line, const visibility_variables &cache ); // Shared method to print "look around" info @@ -614,12 +614,13 @@ class game void knockback( std::vector &traj, int force, int stun, int dam_mult ); // Animation related functions - void draw_bullet( const tripoint &pos, int i, const std::vector &trajectory, + void draw_bullet( const tripoint &t, int i, const std::vector &trajectory, char bullet ); - void draw_hit_mon( const tripoint &p, const monster &critter, bool dead = false ); + void draw_hit_mon( const tripoint &p, const monster &m, bool dead = false ); void draw_hit_player( const player &p, int dam ); - void draw_line( const tripoint &p, const tripoint ¢er_point, const std::vector &ret ); - void draw_line( const tripoint &p, const std::vector &ret ); + void draw_line( const tripoint &p, const tripoint ¢er_point, + const std::vector &points ); + void draw_line( const tripoint &p, const std::vector &points ); void draw_weather( const weather_printable &wPrint ); void draw_sct(); void draw_zones( const tripoint &start, const tripoint &end, const tripoint &offset ); diff --git a/src/input.h b/src/input.h index 404725c430ec3..91d871b9a12b3 100644 --- a/src/input.h +++ b/src/input.h @@ -252,7 +252,7 @@ class input_manager * of the key. This acts as the inverse to get_keyname: * get_keyname(get_keycode(a), , true) == a */ - std::string get_keyname( int ch, input_event_t input_type, bool portable = false ) const; + std::string get_keyname( int ch, input_event_t inp_type, bool portable = false ) const; /** * curses getch() replacement. @@ -272,7 +272,7 @@ class input_manager * Use `input_context::(re)set_timeout()` when possible so timeout will be properly * reset when entering a new input context. */ - void set_timeout( int delay ); + void set_timeout( int t ); void reset_timeout() { set_timeout( -1 ); } @@ -593,7 +593,7 @@ class input_context * and returns the absolute map coordinate. * Eventually this should be made more flexible. */ - cata::optional get_coordinates( const catacurses::window &window ); + cata::optional get_coordinates( const catacurses::window &capture_win_ ); // Below here are shortcuts for registering common key combinations. void register_directions(); @@ -658,7 +658,7 @@ class input_context * this method will cause CATA_INPUT_TIMEOUT events to be generated correctly, * and will reset timeout correctly when a new input context is entered. */ - void set_timeout( int timeout ); + void set_timeout( int val ); void reset_timeout(); private: diff --git a/src/inventory.h b/src/inventory.h index f3b8b7036c0a9..23f95c9daee7a 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -122,9 +122,9 @@ class inventory : public visitable * the player's worn items / weapon */ void restack( player &p ); - void form_from_map( const tripoint &origin, int distance, bool assign_invlet = true, + void form_from_map( const tripoint &origin, int range, bool assign_invlet = true, bool clear_path = true ); - void form_from_map( map &m, const tripoint &origin, int distance, bool assign_invlet = true, + void form_from_map( map &m, const tripoint &origin, int range, bool assign_invlet = true, bool clear_path = true ); /** @@ -195,8 +195,8 @@ class inventory : public visitable void json_load_invcache( JsonIn &jsin ); void json_load_items( JsonIn &jsin ); - void json_save_invcache( JsonOut &jsout ) const; - void json_save_items( JsonOut &jsout ) const; + void json_save_invcache( JsonOut &json ) const; + void json_save_items( JsonOut &json ) const; // Assigns an invlet if any remain. If none do, will assign ` if force is // true, empty (invlet = 0) otherwise. diff --git a/src/item.h b/src/item.h index 10969c2dc2f20..a2f6a2b99c36d 100644 --- a/src/item.h +++ b/src/item.h @@ -282,7 +282,7 @@ class item : public visitable * null pointer. * TODO: change this to take a reference instead. */ - void set_mtype( const mtype *corpse ); + void set_mtype( const mtype *m ); /** * Whether this is a corpse item. Corpses always have valid monster type (@ref corpse) * associated (@ref get_mtype return a non-null pointer) and have been created @@ -322,7 +322,7 @@ class item : public visitable */ std::string tname( unsigned int quantity = 1, bool with_prefix = true, unsigned int truncate = 0 ) const; - std::string display_money( unsigned int quantity, unsigned int charge ) const; + std::string display_money( unsigned int quantity, unsigned int amount ) const; /** * Returns the item name and the charges or contained charges (if the item can have * charges at all). Calls @ref tname with given quantity and with_prefix being true. @@ -348,7 +348,7 @@ class item : public visitable * @param dump The properties (encapsulated into @ref iteminfo) are added to this vector, * the vector can be used to compare them to properties of another item. */ - std::string info( bool showtext, std::vector &dump ) const; + std::string info( bool showtext, std::vector &iteminfo ) const; /** * Return all the information about the item and its type, and dump to vector. @@ -361,7 +361,7 @@ class item : public visitable * the vector can be used to compare them to properties of another item. * @param batch The batch crafting number to multiply data by */ - std::string info( bool showtext, std::vector &dump, int batch ) const; + std::string info( bool showtext, std::vector &iteminfo, int batch ) const; /** * Return all the information about the item and its type, and dump to vector. @@ -374,7 +374,7 @@ class item : public visitable * the vector can be used to compare them to properties of another item. * @param batch The batch crafting number to multiply data by */ - std::string info( std::vector &dump, const iteminfo_query *parts = nullptr, + std::string info( std::vector &info, const iteminfo_query *parts = nullptr, int batch = 1 ) const; /** @@ -382,9 +382,9 @@ class item : public visitable * DO apply them to @ref fire_data argument, though. * @return Amount of "burn" that would be applied to the item. */ - float simulate_burn( fire_data &bd ) const; + float simulate_burn( fire_data &frd ) const; /** Burns the item. Returns true if the item was destroyed. */ - bool burn( fire_data &bd ); + bool burn( fire_data &frd ); // Returns the category of this item. const item_category &get_category() const; @@ -433,7 +433,7 @@ class item : public visitable void io( Archive & ); using archive_type_tag = io::object_archive_tag; - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); const std::string &symbol() const; @@ -693,7 +693,7 @@ class item : public visitable * is outside the reality bubble. * @param smoking_duration */ - void calc_rot_while_processing( time_duration smoking_duration ); + void calc_rot_while_processing( time_duration processing_duration ); /** * Update temperature for things like food @@ -1018,11 +1018,11 @@ class item : public visitable * Gets the point (vehicle tile) the cable is connected to. * Returns nothing if not connected to anything. */ - cata::optional get_cable_target( player *carrier, const tripoint &pos ) const; + cata::optional get_cable_target( player *p, const tripoint &pos ) const; /** * Helper to bring a cable back to its initial state. */ - void reset_cable( player *carrier ); + void reset_cable( player *p ); /** * Whether the item should be processed (by calling @ref process). @@ -1738,7 +1738,7 @@ class item : public visitable * @param u The player that uses the weapon, their strength might affect this. * It's optional and can be null. */ - int gun_range( const player *u ) const; + int gun_range( const player *p ) const; /** * Summed range value of a gun, including values from mods. Returns 0 on non-gun items. */ @@ -1847,7 +1847,7 @@ class item : public visitable /** * Returns the item type of the given identifier. Never returns null. */ - static const itype *find_type( const itype_id &id ); + static const itype *find_type( const itype_id &type ); /** * Whether the item is counted by charges, this is a static wrapper * around @ref count_by_charges, that does not need an items instance. @@ -1888,7 +1888,7 @@ class item : public visitable void set_age( const time_duration &age ); time_point birthday() const; void set_birthday( const time_point &bday ); - void handle_pickup_ownership( Character &p ); + void handle_pickup_ownership( Character &c ); int get_gun_ups_drain() const; inline void set_old_owner( const faction *temp_owner ) { old_owner = temp_owner; @@ -2010,7 +2010,7 @@ class item : public visitable // Place conditions that should remove fake smoke item in this sub-function bool process_fake_smoke( player *carrier, const tripoint &pos ); bool process_fake_mill( player *carrier, const tripoint &pos ); - bool process_cable( player *carrier, const tripoint &pos ); + bool process_cable( player *p, const tripoint &pos ); bool process_blackpowder_fouling( player *carrier ); bool process_tool( player *carrier, const tripoint &pos ); diff --git a/src/item_factory.h b/src/item_factory.h index 96311645b7a38..c37ce0f0c14ff 100644 --- a/src/item_factory.h +++ b/src/item_factory.h @@ -100,7 +100,7 @@ class Item_factory * ("old" is a distribution, too). * @throw std::string if the json object contains invalid data. */ - void load_item_group( JsonObject &jsobj, const Group_tag &ident, const std::string &subtype ); + void load_item_group( JsonObject &jsobj, const Group_tag &group_id, const std::string &subtype ); /** * Like above, but the above loads data from several members of the object, this function * assume the given array is the "entries" member of the item group. @@ -119,12 +119,12 @@ class Item_factory * Note that each entry in the array has to be a JSON object. The other function above * can also load data from arrays of strings, where the strings are item or group ids. */ - void load_item_group( JsonArray &entries, const Group_tag &ident, bool is_collection, + void load_item_group( JsonArray &entries, const Group_tag &group_id, bool is_collection, int ammo_chance, int magazine_chance ); /** * Get the item group object. Returns null if the item group does not exists. */ - Item_spawn_data *get_group( const Group_tag &id ); + Item_spawn_data *get_group( const Group_tag &group_tag ); /** * Returns the idents of all item groups that are known. */ @@ -137,7 +137,7 @@ class Item_factory * group. * @return false if the group doesn't exist. */ - bool add_item_to_group( const Group_tag &group_id, const Item_tag &item_id, int weight ); + bool add_item_to_group( const Group_tag &group_id, const Item_tag &item_id, int chance ); /*@}*/ /** @@ -222,7 +222,7 @@ class Item_factory return iuse_function_list.find( type ) != iuse_function_list.end(); } - void load_item_blacklist( JsonObject &jo ); + void load_item_blacklist( JsonObject &json ); /** Get all item templates (both static and runtime) */ std::vector all() const; @@ -333,7 +333,7 @@ class Item_factory bool load_sub_ref( std::unique_ptr &ptr, JsonObject &obj, const std::string &name, const Item_group &parent ); bool load_string( std::vector &vec, JsonObject &obj, const std::string &name ); - void add_entry( Item_group &sg, JsonObject &obj ); + void add_entry( Item_group &ig, JsonObject &obj ); void load_basic_info( JsonObject &jo, itype &def, const std::string &src ); void set_qualities_from_json( JsonObject &jo, const std::string &member, itype &def ); diff --git a/src/item_group.h b/src/item_group.h index 31b83bcb46f06..9c7f6c676303f 100644 --- a/src/item_group.h +++ b/src/item_group.h @@ -184,7 +184,7 @@ class Item_modifier Item_modifier(); Item_modifier( Item_modifier && ) = default; - void modify( item &it ) const; + void modify( item &new_item ) const; void check_consistency() const; bool remove_item( const Item_tag &itemid ); diff --git a/src/iuse_actor.h b/src/iuse_actor.h index a0aec8ea950fc..5d9062df0776d 100644 --- a/src/iuse_actor.h +++ b/src/iuse_actor.h @@ -98,7 +98,7 @@ class iuse_transform : public iuse_actor iuse_transform( const std::string &type = "transform" ) : iuse_actor( type ) {} ~iuse_transform() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; ret_val can_use( const player &, const item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; @@ -122,7 +122,7 @@ class countdown_actor : public iuse_actor std::string message; ~countdown_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; ret_val can_use( const player &, const item &it, bool, const tripoint & ) const override; @@ -168,7 +168,7 @@ class explosion_iuse : public iuse_actor explosion_iuse( const std::string &type = "explosion" ) : iuse_actor( type ) {} ~explosion_iuse() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; void info( const item &, std::vector & ) const override; @@ -192,7 +192,7 @@ class unfold_vehicle_iuse : public iuse_actor unfold_vehicle_iuse( const std::string &type = "unfold_vehicle" ) : iuse_actor( type ) {} ~unfold_vehicle_iuse() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -236,7 +236,7 @@ class consume_drug_iuse : public iuse_actor consume_drug_iuse( const std::string &type = "consume_drug" ) : iuse_actor( type ) {} ~consume_drug_iuse() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; void info( const item &, std::vector & ) const override; @@ -270,7 +270,7 @@ class delayed_transform_iuse : public iuse_transform delayed_transform_iuse( const std::string &type = "delayed_transform" ) : iuse_transform( type ) {} ~delayed_transform_iuse() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -300,7 +300,7 @@ class place_monster_iuse : public iuse_actor place_monster_iuse() : iuse_actor( "place_monster" ) { } ~place_monster_iuse() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -323,7 +323,7 @@ class ups_based_armor_actor : public iuse_actor ups_based_armor_actor( const std::string &type = "ups_based_armor" ) : iuse_actor( type ) {} ~ups_based_armor_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -342,7 +342,7 @@ class pick_lock_actor : public iuse_actor pick_lock_actor() : iuse_actor( "picklock" ) {} ~pick_lock_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -361,7 +361,7 @@ class deploy_furn_actor : public iuse_actor deploy_furn_actor() : iuse_actor( "deploy_furn" ) {} ~deploy_furn_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; void info( const item &, std::vector & ) const override; @@ -396,7 +396,7 @@ class reveal_map_actor : public iuse_actor reveal_map_actor( const std::string &type = "reveal_map" ) : iuse_actor( type ) {} ~reveal_map_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -433,7 +433,7 @@ class firestarter_actor : public iuse_actor firestarter_actor( const std::string &type = "firestarter" ) : iuse_actor( type ) {} ~firestarter_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; ret_val can_use( const player &, const item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; @@ -470,7 +470,7 @@ class salvage_actor : public iuse_actor salvage_actor( const std::string &type = "salvage" ) : iuse_actor( type ) {} ~salvage_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -509,7 +509,7 @@ class inscribe_actor : public iuse_actor inscribe_actor( const std::string &type = "inscribe" ) : iuse_actor( type ) {} ~inscribe_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -528,7 +528,7 @@ class cauterize_actor : public iuse_actor cauterize_actor( const std::string &type = "cauterize" ) : iuse_actor( type ) {} ~cauterize_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; ret_val can_use( const player &, const item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; @@ -543,7 +543,7 @@ class enzlave_actor : public iuse_actor enzlave_actor( const std::string &type = "enzlave" ) : iuse_actor( type ) {} ~enzlave_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; ret_val can_use( const player &, const item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; @@ -568,7 +568,7 @@ class fireweapon_off_actor : public iuse_actor fireweapon_off_actor() : iuse_actor( "fireweapon_off" ) {} ~fireweapon_off_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; ret_val can_use( const player &, const item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; @@ -592,7 +592,7 @@ class fireweapon_on_actor : public iuse_actor fireweapon_on_actor( const std::string &type = "fireweapon_on" ) : iuse_actor( type ) {} ~fireweapon_on_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -614,7 +614,7 @@ class manualnoise_actor : public iuse_actor manualnoise_actor( const std::string &type = "manualnoise" ) : iuse_actor( type ) {} ~manualnoise_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; ret_val can_use( const player &, const item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; @@ -658,7 +658,7 @@ class musical_instrument_actor : public iuse_actor musical_instrument_actor( const std::string &type = "musical_instrument" ) : iuse_actor( type ) {} ~musical_instrument_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; ret_val can_use( const player &, const item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; @@ -676,7 +676,7 @@ class learn_spell_actor : public iuse_actor learn_spell_actor( const std::string &type = "learn_spell" ) : iuse_actor( type ) {} ~learn_spell_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &p, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; void info( const item &, std::vector & ) const override; @@ -697,7 +697,7 @@ class cast_spell_actor : public iuse_actor cast_spell_actor( const std::string &type = "cast_spell" ) : iuse_actor( type ) {} ~cast_spell_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &p, item &itm, bool, const tripoint & ) const override; iuse_actor *clone() const override; void info( const item &, std::vector & ) const override; @@ -737,7 +737,7 @@ class holster_actor : public iuse_actor holster_actor( const std::string &type = "holster" ) : iuse_actor( type ) {} ~holster_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; void info( const item &, std::vector & ) const override; @@ -772,7 +772,7 @@ class bandolier_actor : public iuse_actor bandolier_actor( const std::string &type = "bandolier" ) : iuse_actor( type ) {} ~bandolier_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; void info( const item &, std::vector & ) const override; @@ -788,7 +788,7 @@ class ammobelt_actor : public iuse_actor ammobelt_actor() : iuse_actor( "ammobelt" ) {} ~ammobelt_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; void info( const item &, std::vector & ) const override; @@ -838,10 +838,10 @@ class repair_item_actor : public iuse_actor }; /** Attempts to repair target item with selected tool */ - attempt_hint repair( player &pl, item &tool, item_location &target ) const; + attempt_hint repair( player &pl, item &tool, item_location &fix ) const; /** Checks if repairs on target item are possible. Excludes checks on tool. * Doesn't just estimate - should not return true if repairs are not possible or false if they are. */ - bool can_repair_target( player &pl, const item &target, bool print_msg ) const; + bool can_repair_target( player &pl, const item &fix, bool print_msg ) const; /** Checks if we are allowed to use the tool. */ bool can_use_tool( const player &p, const item &tool, bool print_msg ) const; @@ -864,7 +864,7 @@ class repair_item_actor : public iuse_actor repair_item_actor( const std::string &type = "repair_item" ) : iuse_actor( type ) {} ~repair_item_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; @@ -923,14 +923,14 @@ class heal_actor : public iuse_actor /** How many intensity levels will be applied using this actor by `healer`. */ int get_disinfected_level( const player &healer ) const; /** Does the actual healing. Used by both long and short actions. Returns charges used. */ - int finish_using( player &healer, player &patient, item &it, hp_part part ) const; + int finish_using( player &healer, player &patient, item &it, hp_part healed ) const; hp_part use_healing_item( player &healer, player &patient, item &it, bool force ) const; heal_actor( const std::string &type = "heal" ) : iuse_actor( type ) {} ~heal_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; void info( const item &, std::vector & ) const override; @@ -948,7 +948,7 @@ class place_trap_actor : public iuse_actor int practice = 0; /** Move points that are used when placing the trap. */ int moves = 100; - void load( JsonObject jo ); + void load( JsonObject obj ); }; /** Whether one can place the trap when underwater. */ bool allow_underwater = false; @@ -977,7 +977,7 @@ class place_trap_actor : public iuse_actor place_trap_actor( const std::string &type = "place_trap" ); ~place_trap_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -991,7 +991,7 @@ class emit_actor : public iuse_actor emit_actor( const std::string &type = "emit_actor" ) : iuse_actor( type ) {} ~emit_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; void finalize( const itype_id &my_item_type ) override; @@ -1043,7 +1043,7 @@ class mutagen_actor : public iuse_actor mutagen_actor() : iuse_actor( "mutagen" ) {} ~mutagen_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -1056,7 +1056,7 @@ class mutagen_iv_actor : public iuse_actor mutagen_iv_actor() : iuse_actor( "mutagen_iv" ) {} ~mutagen_iv_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; @@ -1075,11 +1075,11 @@ class deploy_tent_actor : public iuse_actor deploy_tent_actor() : iuse_actor( "deploy_tent" ) {} ~deploy_tent_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; - bool check_intact( const tripoint &pos ) const; + bool check_intact( const tripoint ¢er ) const; }; /** @@ -1116,7 +1116,7 @@ class sew_advanced_actor : public iuse_actor sew_advanced_actor( const std::string &type = "sew_advanced" ) : iuse_actor( type ) {} ~sew_advanced_actor() override = default; - void load( JsonObject &jo ) override; + void load( JsonObject &obj ) override; int use( player &, item &, bool, const tripoint & ) const override; iuse_actor *clone() const override; }; diff --git a/src/json.h b/src/json.h index effca6a7c147e..382f6160eb5ad 100644 --- a/src/json.h +++ b/src/json.h @@ -69,7 +69,7 @@ class InvalidEnumString : public std::runtime_error InvalidEnumString( const std::string &msg ) : std::runtime_error( msg ) { } }; template -E string_to_enum( const std::string &data ); +E string_to_enum( const std::string & ); template std::string enum_to_string( E data ); @@ -691,7 +691,7 @@ class JsonObject public: JsonObject( JsonIn &jsin ); - JsonObject( const JsonObject &jsobj ); + JsonObject( const JsonObject &jo ); JsonObject() : start( 0 ), end( 0 ), jsin( nullptr ) {} ~JsonObject() { finish(); @@ -863,7 +863,7 @@ class JsonArray public: JsonArray( JsonIn &jsin ); - JsonArray( const JsonArray &jsarr ); + JsonArray( const JsonArray &ja ); JsonArray() : start( 0 ), index( 0 ), end( 0 ), jsin( nullptr ) {} ~JsonArray() { finish(); diff --git a/src/magic.h b/src/magic.h index 5fb69e69cacfd..9cc424a48834b 100644 --- a/src/magic.h +++ b/src/magic.h @@ -410,7 +410,7 @@ namespace spell_effect void teleport_random( const spell &sp, Creature &caster, const tripoint & ); void pain_split( const spell &, Creature &, const tripoint & ); void target_attack( const spell &sp, Creature &caster, - const tripoint &target ); + const tripoint &epicenter ); void projectile_attack( const spell &sp, Creature &caster, const tripoint &target ); void cone_attack( const spell &sp, Creature &caster, @@ -418,8 +418,8 @@ void cone_attack( const spell &sp, Creature &caster, void line_attack( const spell &sp, Creature &caster, const tripoint &target ); -void area_pull( const spell &sp, Creature &caster, const tripoint &target ); -void area_push( const spell &sp, Creature &caster, const tripoint &target ); +void area_pull( const spell &sp, Creature &caster, const tripoint ¢er ); +void area_push( const spell &sp, Creature &caster, const tripoint ¢er ); std::set spell_effect_blast( const spell &, const tripoint &, const tripoint &target, int aoe_radius, bool ignore_walls ); diff --git a/src/magic_teleporter_list.h b/src/magic_teleporter_list.h index 1c35f24c3130a..dfe0944e7b49a 100644 --- a/src/magic_teleporter_list.h +++ b/src/magic_teleporter_list.h @@ -25,7 +25,7 @@ class teleporter_list // does not do any loading or unloading bool place_avatar_overmap( avatar &you, const tripoint &omt_pt ) const; public: - bool knows_translocator( const tripoint &omt_pt ) const; + bool knows_translocator( const tripoint &omt_pos ) const; // adds teleporter to known_teleporters and does any other activation necessary bool activate_teleporter( const tripoint &omt_pt, const tripoint &local_pt ); void deactivate_teleporter( const tripoint &omt_pt, const tripoint &local_pt ); diff --git a/src/magic_ter_furn_transform.h b/src/magic_ter_furn_transform.h index 842242504cdb2..643ca7276da81 100644 --- a/src/magic_ter_furn_transform.h +++ b/src/magic_ter_furn_transform.h @@ -72,8 +72,8 @@ class ter_furn_transform void add_all_messages( const Creature &critter, const tripoint &location ) const; void add_all_messages( const map &m, const Creature &critter, const tripoint &location ) const; - void transform( const tripoint &pos ) const; - void transform( map &m, const tripoint &pos ) const; + void transform( const tripoint &location ) const; + void transform( map &m, const tripoint &location ) const; static void load_transform( JsonObject &jo, const std::string &src ); void load( JsonObject &jo, const std::string & ); diff --git a/src/map.h b/src/map.h index b257a4c99e3fd..610ef9c5b45e4 100644 --- a/src/map.h +++ b/src/map.h @@ -265,7 +265,7 @@ class map /** * Callback invoked when a vehicle has moved. */ - void on_vehicle_moved( int zlev ); + void on_vehicle_moved( int smz ); struct apparent_light_info { bool obstructed; @@ -317,7 +317,7 @@ class map void drawsq( const catacurses::window &w, player &u, const tripoint &p, bool invert, bool show_items, const tripoint &view_center, - bool low_light = false, bool bright_level = false, + bool low_light = false, bool bright_light = false, bool inorder = false ) const; /** @@ -342,7 +342,7 @@ class map * is in submap coordinates. * @param update_vehicles If true, add vehicles to the vehicle cache. */ - void load( const tripoint &p, bool update_vehicles ); + void load( const tripoint &w, bool update_vehicles ); /** * Shift the map along the vector s. * This is like loading the map with coordinates derived from the current @@ -540,7 +540,7 @@ class map // Vehicle movement void vehmove(); // Selects a vehicle to move, returns false if no moving vehicles - bool vehproceed( VehicleList &vehs ); + bool vehproceed( VehicleList &vehicle_list ); // 3D vehicles VehicleList get_vehicles( const tripoint &start, const tripoint &end ); @@ -985,9 +985,9 @@ class map std::list use_amount_square( const tripoint &p, const itype_id &type, int &quantity, const std::function &filter = return_true ); std::list use_amount( const tripoint &origin, int range, const itype_id &type, - int &amount, const std::function &filter = return_true ); + int &quantity, const std::function &filter = return_true ); std::list use_charges( const tripoint &origin, int range, itype_id type, - int &amount, const std::function &filter = return_true, + int &quantity, const std::function &filter = return_true, basecamp *bcp = nullptr ); /*@}*/ std::list > get_rc_items( const tripoint &p = { -1, -1, -1 } ); @@ -1216,7 +1216,7 @@ class map // mapgen.cpp functions void generate( const tripoint &p, const time_point &when ); void place_spawns( const mongroup_id &group, int chance, - const point &p1, const point &p2, float intensity, + const point &p1, const point &p2, float density, bool individual = false, bool friendly = false, const std::string &name = "NONE", int mission_id = -1 ); void place_gas_pump( const point &p, int charges ); @@ -1701,7 +1701,7 @@ void shift_bitset_cache( std::bitset &cache, const point &s ); std::vector closest_points_first( int radius, const point ¢er ); // Does not build "piles" - does the same as above functions, except in tripoints -std::vector closest_tripoints_first( int radius, const tripoint &p ); +std::vector closest_tripoints_first( int radius, const tripoint ¢er ); bool ter_furn_has_flag( const ter_t &ter, const furn_t &furn, ter_bitflags flag ); class tinymap : public map { diff --git a/src/mapgen_functions.h b/src/mapgen_functions.h index dc001c476a347..c4dcbf794e287 100644 --- a/src/mapgen_functions.h +++ b/src/mapgen_functions.h @@ -43,8 +43,8 @@ struct mapgendata { map &m; weighted_int_list default_groundcover; mapgendata( oter_id t_north, oter_id t_east, oter_id t_south, oter_id t_west, - oter_id t_neast, oter_id t_seast, oter_id t_swest, oter_id t_nwest, - oter_id up, oter_id below, int z, const regional_settings &rsettings, map &mp ); + oter_id northeast, oter_id southeast, oter_id southwest, oter_id northwest, + oter_id up, oter_id down, int z, const regional_settings &rsettings, map &mp ); void set_dir( int dir_in, int val ); void fill( int val ); int &dir( int dir_in ); @@ -90,7 +90,7 @@ struct mapgendata { * Calculates the coordinates of a rotated point. * Should match the `mapgen_*` rotation. */ -tripoint rotate_point( const tripoint &p, int turn ); +tripoint rotate_point( const tripoint &p, int rotations ); int terrain_type_to_nesw_array( oter_id terrain_type, bool array[4] ); @@ -103,23 +103,23 @@ ter_id clay_or_sand(); // helper functions for mapgen.cpp, so that we can avoid having a massive switch statement (sorta) void mapgen_null( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, float density ); -void mapgen_crater( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_crater( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); -void mapgen_field( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_field( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); -void mapgen_forest( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_forest( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); void mapgen_forest_trail_straight( map *m, oter_id terrain_type, mapgendata dat, - const time_point &time, float density ); + const time_point &turn, float density ); void mapgen_forest_trail_curved( map *m, oter_id terrain_type, mapgendata dat, - const time_point &time, float density ); -void mapgen_forest_trail_tee( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, + const time_point &turn, float density ); +void mapgen_forest_trail_tee( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); void mapgen_forest_trail_four_way( map *m, oter_id terrain_type, mapgendata dat, - const time_point &time, float density ); -void mapgen_hive( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, + const time_point &turn, float density ); +void mapgen_hive( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); -void mapgen_spider_pit( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_spider_pit( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); void mapgen_fungal_bloom( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, float density ); @@ -129,15 +129,15 @@ void mapgen_fungal_flowers( map *m, oter_id terrain_type, mapgendata dat, const float density ); void mapgen_river_center( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, float density ); -void mapgen_road( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_road( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); -void mapgen_bridge( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_bridge( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); void mapgen_railroad( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, float density ); void mapgen_railroad_bridge( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, float density ); -void mapgen_highway( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_highway( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); void mapgen_river_curved_not( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, float density ); @@ -145,21 +145,21 @@ void mapgen_river_straight( map *m, oter_id terrain_type, mapgendata dat, const float density ); void mapgen_river_curved( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, float density ); -void mapgen_parking_lot( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_parking_lot( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); -void mapgen_generic_house( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_generic_house( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density, int variant ); // not mapped void mapgen_generic_house_boxy( map *m, oter_id terrain_type, mapgendata dat, - const time_point &time, float density ); + const time_point &turn, float density ); void mapgen_generic_house_big_livingroom( map *m, oter_id terrain_type, mapgendata dat, - const time_point &time, float density ); + const time_point &turn, float density ); void mapgen_generic_house_center_hallway( map *m, oter_id terrain_type, mapgendata dat, - const time_point &time, float density ); + const time_point &turn, float density ); void mapgen_basement_generic_layout( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, float density ); -void mapgen_basement_junk( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_basement_junk( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); -void mapgen_basement_spiders( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_basement_spiders( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); void mapgen_cave( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); @@ -203,7 +203,7 @@ void mapgen_ants_queen( map *m, oter_id terrain_type, mapgendata dat, const time float density ); void mapgen_tutorial( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); -void mapgen_lake_shore( map *m, oter_id terrain_type, mapgendata dat, const time_point &time, +void mapgen_lake_shore( map *m, oter_id terrain_type, mapgendata dat, const time_point &turn, float density ); // Temporary wrappers @@ -217,7 +217,7 @@ mapgen_update_func add_mapgen_update_func( JsonObject &jo, bool &defer ); bool run_mapgen_update_func( const std::string &update_mapgen_id, const tripoint &omt_pos, mission *miss = nullptr, bool cancel_on_collision = true ); bool run_mapgen_func( const std::string &mapgen_id, map *m, oter_id terrain_type, mapgendata dat, - const time_point &turn, float intensity ); + const time_point &turn, float density ); std::pair, std::map> get_changed_ids_from_update( const std::string &update_mapgen_id ); #endif diff --git a/src/martialarts.h b/src/martialarts.h index 5663e7f79c508..7158b68052255 100644 --- a/src/martialarts.h +++ b/src/martialarts.h @@ -141,14 +141,14 @@ class ma_buff int block_bonus( const player &u ) const; // returns the armor bonus for various armor stats (equivalent to armor) - int armor_bonus( const player &u, damage_type type ) const; + int armor_bonus( const player &u, damage_type dt ) const; // returns the stat bonus for the various damage stats (for rolls) - float damage_bonus( const player &u, damage_type type ) const; + float damage_bonus( const player &u, damage_type dt ) const; // returns damage multipliers for the various damage stats (applied after // bonuses) - float damage_mult( const player &u, damage_type type ) const; + float damage_mult( const player &u, damage_type dt ) const; // returns various boolean flags bool is_throw_immune() const; @@ -217,11 +217,11 @@ class martialart void apply_onkill_buffs( player &u ) const; // determines if a technique is valid or not for this style - bool has_technique( const player &u, const matec_id &tech ) const; + bool has_technique( const player &u, const matec_id &tec_id ) const; // determines if a weapon is valid for this style - bool has_weapon( const std::string &item ) const; + bool has_weapon( const std::string &itt ) const; // Is this weapon OK with this art? - bool weapon_valid( const item &u ) const; + bool weapon_valid( const item &it ) const; // Getter for player style change message std::string get_initiate_player_message() const; // Getter for NPC style change message diff --git a/src/mattack_actors.h b/src/mattack_actors.h index b31dea94021b2..791d79edd2a03 100644 --- a/src/mattack_actors.h +++ b/src/mattack_actors.h @@ -38,7 +38,7 @@ class leap_actor : public mattack_actor leap_actor() = default; ~leap_actor() override = default; - void load_internal( JsonObject &jo, const std::string &src ) override; + void load_internal( JsonObject &obj, const std::string &src ) override; bool call( monster & ) const override; mattack_actor *clone() const override; }; @@ -54,7 +54,7 @@ class mon_spellcasting_actor : public mattack_actor mon_spellcasting_actor() = default; ~mon_spellcasting_actor() override = default; - void load_internal( JsonObject &jo, const std::string &src ) override; + void load_internal( JsonObject &obj, const std::string &src ) override; bool call( monster & ) const override; mattack_actor *clone() const override; }; @@ -104,7 +104,7 @@ class melee_actor : public mattack_actor virtual Creature *find_target( monster &z ) const; virtual void on_damage( monster &z, Creature &target, dealt_damage_instance &dealt ) const; - void load_internal( JsonObject &jo, const std::string &src ) override; + void load_internal( JsonObject &obj, const std::string &src ) override; bool call( monster & ) const override; mattack_actor *clone() const override; }; @@ -121,7 +121,7 @@ class bite_actor : public melee_actor void on_damage( monster &z, Creature &target, dealt_damage_instance &dealt ) const override; - void load_internal( JsonObject &jo, const std::string &src ) override; + void load_internal( JsonObject &obj, const std::string &src ) override; mattack_actor *clone() const override; }; @@ -186,7 +186,7 @@ class gun_actor : public mattack_actor gun_actor(); ~gun_actor() override = default; - void load_internal( JsonObject &jo, const std::string &src ) override; + void load_internal( JsonObject &obj, const std::string &src ) override; bool call( monster & ) const override; mattack_actor *clone() const override; }; diff --git a/src/mission.h b/src/mission.h index 4a02ce68effeb..82fa188729804 100644 --- a/src/mission.h +++ b/src/mission.h @@ -353,7 +353,7 @@ class mission std::string name(); mission_type_id mission_id(); - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); mission(); diff --git a/src/mod_manager.h b/src/mod_manager.h index d6ad6bf1031f1..9bef9a42dd207 100644 --- a/src/mod_manager.h +++ b/src/mod_manager.h @@ -169,7 +169,7 @@ class mod_manager class mod_ui { public: - mod_ui( mod_manager &modman ); + mod_ui( mod_manager &mman ); std::string get_information( const MOD_INFORMATION *mod ); mod_manager &active_manager; diff --git a/src/mongroup.h b/src/mongroup.h index 6bfb9bbf2dc6d..6a1125b649fdf 100644 --- a/src/mongroup.h +++ b/src/mongroup.h @@ -152,9 +152,9 @@ struct mongroup { void io( Archive & ); using archive_type_tag = io::object_archive_tag; - void deserialize( JsonIn &jsin ); - void deserialize_legacy( JsonIn &jsin ); - void serialize( JsonOut &jsout ) const; + void deserialize( JsonIn &data ); + void deserialize_legacy( JsonIn &json ); + void serialize( JsonOut &json ) const; }; class MonsterGroupManager @@ -165,9 +165,9 @@ class MonsterGroupManager static void LoadMonsterWhitelist( JsonObject &jo ); static void FinalizeMonsterGroups(); static MonsterGroupResult GetResultFromGroup( const mongroup_id &group, int *quantity = nullptr ); - static bool IsMonsterInGroup( const mongroup_id &group, const mtype_id &id ); + static bool IsMonsterInGroup( const mongroup_id &group, const mtype_id &monster ); static bool isValidMonsterGroup( const mongroup_id &group ); - static const mongroup_id &Monster2Group( const mtype_id &id ); + static const mongroup_id &Monster2Group( const mtype_id &monster ); static std::vector GetMonstersFromGroup( const mongroup_id &group ); static const MonsterGroup &GetMonsterGroup( const mongroup_id &group ); static const MonsterGroup &GetUpgradedMonsterGroup( const mongroup_id &group ); diff --git a/src/monster.h b/src/monster.h index 52a06d0ca5961..f1f7e9fbeae1e 100644 --- a/src/monster.h +++ b/src/monster.h @@ -48,7 +48,7 @@ class mon_special_attack int cooldown = 0; bool enabled = true; - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; // deserialize inline in monster::load due to backwards/forwards compatibility concerns }; @@ -149,14 +149,14 @@ class monster : public Creature bool avoid_trap( const tripoint &pos, const trap &tr ) const override; - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); tripoint move_target(); // Returns point at the end of the monster's current plans Creature *attack_target(); // Returns the creature at the end of plans (if hostile) // Movement - void shift( const point &sp ); // Shifts the monster to the appropriate submap + void shift( const point &sm_shift ); // Shifts the monster to the appropriate submap void set_goal( const tripoint &p ); // Updates current pos AND our plans bool wander(); // Returns true if we have no plans @@ -258,7 +258,7 @@ class monster : public Creature int group_bash_skill( const tripoint &target ); void stumble(); - void knock_back_to( const tripoint &p ) override; + void knock_back_to( const tripoint &to ) override; // Combat bool is_fleeing( player &u ) const; // True if we're fleeing @@ -277,14 +277,14 @@ class monster : public Creature void absorb_hit( body_part bp, damage_instance &dam ) override; bool block_hit( Creature *source, body_part &bp_hit, damage_instance &d ) override; - void melee_attack( Creature &p ); - void melee_attack( Creature &p, float accuracy ); + void melee_attack( Creature &target ); + void melee_attack( Creature &target, float accuracy ); void melee_attack( Creature &p, bool ) = delete; void deal_projectile_attack( Creature *source, dealt_projectile_attack &attack, bool print_messages = true ) override; void deal_damage_handle_type( const damage_unit &du, body_part bp, int &damage, int &pain ) override; - void apply_damage( Creature *source, body_part bp, int amount, + void apply_damage( Creature *source, body_part bp, int dam, bool bypass_med = false ) override; // create gibs/meat chunks/blood etc all over the place, does not kill, can be called on a dead monster. void explode(); @@ -294,7 +294,7 @@ class monster : public Creature * Flat addition to the monsters @ref hp. If `overheal` is true, this is not capped by max hp. * Returns actually healed hp. */ - int heal( int hp_delta, bool overheal = false ); + int heal( int delta_hp, bool overheal = false ); /** * Directly set the current @ref hp of the monster (not capped at the maximal hp). * You might want to use @ref heal / @ref apply_damage or @ref deal_damage instead. @@ -396,7 +396,7 @@ class monster : public Creature * @param source_volume Volume at the center of the sound source * @param distance Distance to sound source (currently just rl_dist) */ - void hear_sound( const tripoint &from, int source_volume, int distance ); + void hear_sound( const tripoint &source, int vol, int distance ); bool is_hallucination() const override; // true if the monster isn't actually real @@ -525,11 +525,11 @@ class monster : public Creature void nursebot_operate( player *dragged_foe ); protected: - void store( JsonOut &jsout ) const; - void load( JsonObject &jsin ); + void store( JsonOut &json ) const; + void load( JsonObject &data ); /** Processes monster-specific effects of an effect. */ - void process_one_effect( effect &e, bool is_new ) override; + void process_one_effect( effect &it, bool is_new ) override; }; #endif diff --git a/src/mtype.h b/src/mtype.h index a8e90926cd60c..4ae5fd225d9ef 100644 --- a/src/mtype.h +++ b/src/mtype.h @@ -215,8 +215,8 @@ struct mtype { void remove_special_attacks( JsonObject &jo, const std::string &member_name, const std::string &src ); - void add_special_attack( JsonArray jarr, const std::string &src ); - void add_special_attack( JsonObject jo, const std::string &src ); + void add_special_attack( JsonArray inner, const std::string &src ); + void add_special_attack( JsonObject obj, const std::string &src ); public: mtype_id id; diff --git a/src/npc.h b/src/npc.h index ba7ce4b0f041b..37e26131c0152 100644 --- a/src/npc.h +++ b/src/npc.h @@ -164,7 +164,7 @@ struct npc_personality { altruism = 0; } - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); }; @@ -200,7 +200,7 @@ struct npc_opinion { return npc_opinion( *this ) += rhs; } - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); }; @@ -429,7 +429,7 @@ struct npc_follower_rules { npc_follower_rules(); - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); bool has_flag( ally_rule test, bool check_override = true ) const; @@ -440,10 +440,10 @@ struct npc_follower_rules { void toggle_specific_override_state( ally_rule rule, bool state ); bool has_override_enable( ally_rule test ) const; void enable_override( ally_rule setit ); - void disable_override( ally_rule setit ); + void disable_override( ally_rule clearit ); bool has_override( ally_rule test ) const; void set_override( ally_rule setit ); - void clear_override( ally_rule setit ); + void clear_override( ally_rule clearit ); void set_danger_overrides(); void clear_overrides(); @@ -699,7 +699,7 @@ struct npc_chatbin { npc_chatbin() = default; - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); }; @@ -761,11 +761,11 @@ class npc : public player // Save & load void deserialize( JsonIn &jsin ) override; - void serialize( JsonOut &jsout ) const override; + void serialize( JsonOut &json ) const override; // Display nc_color basic_symbol_color() const override; - int print_info( const catacurses::window &w, int vStart, int vLines, int column ) const override; + int print_info( const catacurses::window &w, int line, int vLines, int column ) const override; std::string opinion_text() const; int faction_display( const catacurses::window &fac_w, int width ) const; @@ -801,7 +801,7 @@ class npc : public player // Faction version number int get_faction_ver() const; void set_faction_ver( int new_version ); - bool has_faction_relationship( const player &guy, + bool has_faction_relationship( const player &p, npc_factions::relationship flag ) const; // We want to kill/mug/etc the player bool is_enemy() const; @@ -865,7 +865,7 @@ class npc : public player bool has_painkiller(); bool took_painkiller() const; void use_painkiller(); - void activate_item( int position ); + void activate_item( int item_index ); bool has_identified( const std::string & ) const override { return true; } @@ -1000,7 +1000,7 @@ class npc : public player int confident_shoot_range( const item &it, int at_recoil ) const; int confident_gun_mode_range( const gun_mode &gun, int at_recoil ) const; int confident_throw_range( const item &, Creature * ) const; - bool wont_hit_friend( const tripoint &p, const item &it, bool throwing ) const; + bool wont_hit_friend( const tripoint &tar, const item &it, bool throwing ) const; bool enough_time_to_reload( const item &gun ) const; /** Can reload currently wielded gun? */ bool can_reload_current(); @@ -1014,7 +1014,7 @@ class npc : public player bool dispose_item( item_location &&obj, const std::string &prompt = std::string() ) override; void aim(); - void do_reload( const item &what ); + void do_reload( const item &it ); // Physical movement from one tile to the next /** @@ -1036,7 +1036,7 @@ class npc : public player void avoid_friendly_fire(); void escape_explosion(); // nomove is used to resolve recursive invocation - void move_away_from( const tripoint &p, bool no_bashing = false, + void move_away_from( const tripoint &p, bool no_bash_atk = false, std::set *nomove = nullptr ); void move_away_from( const std::vector &spheres, bool no_bashing = false ); // Same as if the player pressed '.' @@ -1049,7 +1049,7 @@ class npc : public player // Item discovery and fetching // Comment on item seen - void see_item_say_smth( const itype_id &item, const std::string &smth ); + void see_item_say_smth( const itype_id &object, const std::string &smth ); // Look around and pick an item void find_item(); // Move to, or grab, our targeted item @@ -1061,7 +1061,7 @@ class npc : public player std::list pick_up_item_vehicle( vehicle &veh, int part_index ); bool has_item_whitelist() const; - bool item_name_whitelisted( const std::string &name ); + bool item_name_whitelisted( const std::string &to_match ); bool item_whitelisted( const item &it ); /** Returns true if it finds one. */ @@ -1266,8 +1266,8 @@ class npc : public player attitude_group get_attitude_group( npc_attitude att ) const; protected: - void store( JsonOut &jsout ) const; - void load( JsonObject &jsin ); + void store( JsonOut &json ) const; + void load( JsonObject &data ); private: // the weapon we're actually holding when using bionic fake guns @@ -1290,7 +1290,7 @@ class standard_npc : public npc { public: standard_npc( const std::string &name = "", const std::vector &clothing = {}, - int skill = 4, int s_str = 8, int s_dex = 8, int s_int = 8, int s_per = 8 ); + int sk_lvl = 4, int s_str = 8, int s_dex = 8, int s_int = 8, int s_per = 8 ); }; // instances of this can be accessed via string_id. diff --git a/src/npc_favor.h b/src/npc_favor.h index dc9d69a7f8ef3..6b285da89e270 100644 --- a/src/npc_favor.h +++ b/src/npc_favor.h @@ -32,7 +32,7 @@ struct npc_favor { skill = skill_id::NULL_ID(); } - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); }; diff --git a/src/options.h b/src/options.h index 2dbf640de87fd..2910ca5b48e63 100644 --- a/src/options.h +++ b/src/options.h @@ -200,8 +200,8 @@ class options_manager bool save(); std::string show( bool ingame = false, bool world_options_only = false ); - void add_value( const std::string &myoption, const std::string &myval, - const translation &myvaltxt ); + void add_value( const std::string &lvar, const std::string &lval, + const translation &lvalname ); void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); diff --git a/src/output.cpp b/src/output.cpp index 1ac2ee67667fc..7b1cf92ef3723 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -615,7 +615,7 @@ int popup( const std::string &text, PopupFlags flags ) } } -void popup_status( const char *const title, const std::string &fmt ) +void popup_status( const char *const title, const std::string &mes ) { std::string text; if( !test_mode && title != nullptr ) { @@ -623,7 +623,7 @@ void popup_status( const char *const title, const std::string &fmt ) text += "\n"; } - popup( text + fmt, PF_NO_WAIT ); + popup( text + mes, PF_NO_WAIT ); } //note that passing in iteminfo instances with sType == "DESCRIPTION" does special things diff --git a/src/output.h b/src/output.h index 37d551a823d4a..fc8127da9ed55 100644 --- a/src/output.h +++ b/src/output.h @@ -199,7 +199,7 @@ nc_color msgtype_to_color( game_message_type type, bool bOldMsg = false ); * Removes the color tags from the input string. This might be required when the string is to * be used for functions that don't handle color tags. */ -std::string remove_color_tags( const std::string &text ); +std::string remove_color_tags( const std::string &s ); /*@}*/ /** @@ -257,7 +257,7 @@ int print_scrollable( const catacurses::window &w, int begin_line, const std::st * the height of the window. */ int fold_and_print( const catacurses::window &w, const point &begin, int width, - const nc_color &base_color, const std::string &mes, char split = ' ' ); + const nc_color &base_color, const std::string &text, char split = ' ' ); /** * Same as other @ref fold_and_print, but does string formatting via @ref string_format. */ @@ -287,7 +287,7 @@ inline int fold_and_print( const catacurses::window &w, const point &begin, * value for `begin_line`. */ int fold_and_print_from( const catacurses::window &w, const point &begin, int width, - int begin_line, const nc_color &base_color, const std::string &mes ); + int begin_line, const nc_color &base_color, const std::string &text ); /** * Same as other @ref fold_and_print_from, but does formatting via @ref string_format. */ @@ -310,7 +310,7 @@ inline int fold_and_print_from( const catacurses::window &w, const point &begin, * @param mes Actual message to print */ void trim_and_print( const catacurses::window &w, const point &begin, int width, - nc_color base_color, const std::string &mes ); + nc_color base_color, const std::string &text ); template inline void trim_and_print( const catacurses::window &w, const point &begin, const int width, const nc_color base_color, const char *const mes, Args &&... args ) @@ -318,9 +318,10 @@ inline void trim_and_print( const catacurses::window &w, const point &begin, return trim_and_print( w, begin, width, base_color, string_format( mes, std::forward( args )... ) ); } -void center_print( const catacurses::window &w, int y, const nc_color &FG, const std::string &mes ); +void center_print( const catacurses::window &w, int y, const nc_color &FG, + const std::string &text ); int right_print( const catacurses::window &w, int line, int right_indent, - const nc_color &FG, const std::string &mes ); + const nc_color &FG, const std::string &text ); void display_table( const catacurses::window &w, const std::string &title, int columns, const std::vector &data ); void multipage( const catacurses::window &w, const std::vector &text, @@ -369,14 +370,14 @@ std::string word_rewrap( const std::string &ins, int width, uint32_t split = ' ' std::vector get_tag_positions( const std::string &s ); std::vector split_by_color( const std::string &s ); -bool query_yn( const std::string &msg ); +bool query_yn( const std::string &text ); template inline bool query_yn( const char *const msg, Args &&... args ) { return query_yn( string_format( msg, std::forward( args )... ) ); } -bool query_int( int &result, const std::string &msg ); +bool query_int( int &result, const std::string &text ); template inline bool query_int( int &result, const char *const msg, Args &&... args ) { @@ -438,9 +439,9 @@ inline void popup_nowait( const char *mes, Args &&... args ) } void popup_status( const char *title, const std::string &mes ); template -inline void popup_status( const char *const title, const char *const mes, Args &&... args ) +inline void popup_status( const char *const title, const char *const fmt, Args &&... args ) { - return popup_status( title, string_format( mes, std::forward( args )... ) ); + return popup_status( title, string_format( fmt, std::forward( args )... ) ); } template inline void popup( const char *mes, Args &&... args ) @@ -521,7 +522,7 @@ void replace_substring( std::string &input, const std::string &substring, std::string string_replace( std::string text, const std::string &before, const std::string &after ); std::string replace_colors( std::string text ); -std::string &capitalize_letter( std::string &pattern, size_t n = 0 ); +std::string &capitalize_letter( std::string &str, size_t n = 0 ); size_t shortcut_print( const catacurses::window &w, const point &p, nc_color text_color, nc_color shortcut_color, const std::string &fmt ); size_t shortcut_print( const catacurses::window &w, nc_color text_color, nc_color shortcut_color, @@ -789,9 +790,9 @@ class scrollingcombattext extern scrollingcombattext SCT; -std::string wildcard_trim_rule( const std::string &sPatternIn ); -bool wildcard_match( const std::string &sTextIn, const std::string &sPatternIn ); -std::vector string_split( const std::string &s, char delim ); +std::string wildcard_trim_rule( const std::string &pattern_in ); +bool wildcard_match( const std::string &text_in, const std::string &pattern_in ); +std::vector string_split( const std::string &text_in, char delim ); int ci_find_substr( const std::string &str1, const std::string &str2, const std::locale &loc = std::locale() ); diff --git a/src/overmap.h b/src/overmap.h index 7dc67dc6d92ef..faf7b98cc7ebd 100644 --- a/src/overmap.h +++ b/src/overmap.h @@ -327,9 +327,9 @@ class overmap // Parse per-player overmap view data. void unserialize_view( std::istream &fin ); // Save data in an opened overmap file - void serialize( std::ostream &fin ) const; + void serialize( std::ostream &fout ) const; // Save per-player overmap view data. - void serialize_view( std::ostream &fin ) const; + void serialize_view( std::ostream &fout ) const; private: void generate( const overmap *north, const overmap *east, const overmap *south, const overmap *west, @@ -370,8 +370,8 @@ class overmap const std::string &prefix, int train_odds ); void build_anthill( const tripoint &p, int s ); void build_tunnel( const tripoint &p, int s, om_direction::type dir ); - bool build_slimepit( const tripoint &p, int s ); - void build_mine( const tripoint &p, int s ); + bool build_slimepit( const tripoint &origin, int s ); + void build_mine( const tripoint &origin, int s ); // Connection laying pf::path lay_out_connection( const overmap_connection &connection, const point &source, @@ -432,8 +432,8 @@ class overmap void add_mon_group( const mongroup &group ); - void load_monster_groups( JsonIn &jo ); - void load_legacy_monstergroups( JsonIn &jo ); + void load_monster_groups( JsonIn &jsin ); + void load_legacy_monstergroups( JsonIn &jsin ); void save_monster_groups( JsonOut &jo ) const; public: static void load_obsolete_terrains( JsonObject &jo ); diff --git a/src/overmapbuffer.h b/src/overmapbuffer.h index 44310c68ba8a4..78c1afc096c09 100644 --- a/src/overmapbuffer.h +++ b/src/overmapbuffer.h @@ -440,7 +440,7 @@ class overmapbuffer * @param force If true, placement will bypass the checks for valid placement. * @returns True if the special was placed, else false. */ - bool place_special( const overmap_special &special, const tripoint &location, + bool place_special( const overmap_special &special, const tripoint &p, om_direction::type dir, bool must_be_unexplored, bool force ); /** @@ -493,7 +493,7 @@ class overmapbuffer * overmap terrain coordinates. * This function may create a new overmap if needed. */ - bool check_ot( const std::string &otype, ot_match_type match_type, const tripoint &loc ); + bool check_ot( const std::string &otype, ot_match_type match_type, const tripoint &p ); bool check_overmap_special_type( const overmap_special_id &id, const tripoint &loc ); /** @@ -517,7 +517,7 @@ class overmapbuffer * The location is in absolute submap coordinates, the radius is in the same system. * The overmaps are returned sorted by distance from the provided location (closest first). */ - std::vector get_overmaps_near( const point &location, int radius ); + std::vector get_overmaps_near( const point &p, int radius ); std::vector get_overmaps_near( const tripoint &location, int radius ); }; diff --git a/src/panels.cpp b/src/panels.cpp index b1ab55c9cc00b..783454e229095 100644 --- a/src/panels.cpp +++ b/src/panels.cpp @@ -62,15 +62,15 @@ const efftype_id effect_got_checked( "got_checked" ); // constructor window_panel::window_panel( std::function - draw_func, const std::string &nm, int ht, int wd, bool def_toggle, + draw_func, const std::string &nm, int ht, int wd, bool default_toggle_, std::function render_func, bool force_draw ) { draw = draw_func; name = nm; height = ht; width = wd; - toggle = def_toggle; - default_toggle = def_toggle; + toggle = default_toggle_; + default_toggle = default_toggle_; always_draw = force_draw; render = render_func; } diff --git a/src/panels.h b/src/panels.h index 87f9e7f7a0ca2..63554ad27bc3f 100644 --- a/src/panels.h +++ b/src/panels.h @@ -39,7 +39,7 @@ class window_panel { public: window_panel( std::function draw_func, - const std::string &nm, int ht, int wd, bool default_toggle, + const std::string &nm, int ht, int wd, bool default_toggle_, std::function render_func = default_render, bool force_draw = false ); std::function draw; diff --git a/src/player.cpp b/src/player.cpp index 327efef9f1198..b7b2e64395916 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -4470,20 +4470,21 @@ int player::addiction_level( add_type type ) const return iter != addictions.end() ? iter->intensity : 0; } -void player::siphon( vehicle &veh, const itype_id &type ) +void player::siphon( vehicle &veh, const itype_id &desired_liquid ) { auto qty = veh.fuel_left( type ); if( qty <= 0 ) { - add_msg( m_bad, _( "There is not enough %s left to siphon it." ), item::nname( type ) ); + add_msg( m_bad, _( "There is not enough %s left to siphon it." ), + item::nname( desired_liquid ) ); return; } - item liquid( type, calendar::turn, qty ); + item liquid( desired_liquid, calendar::turn, qty ); if( liquid.is_food() ) { - liquid.set_item_specific_energy( veh.fuel_specific_energy( type ) ); + liquid.set_item_specific_energy( veh.fuel_specific_energy( desired_liquid ) ); } if( liquid_handler::handle_liquid( liquid, nullptr, 1, nullptr, &veh ) ) { - veh.drain( type, qty - liquid.charges ); + veh.drain( desired_liquid, qty - liquid.charges ); } } diff --git a/src/player.h b/src/player.h index 3b33116ed218c..620b6c38f39f2 100644 --- a/src/player.h +++ b/src/player.h @@ -416,9 +416,9 @@ class player : public Character /** Removes a mutation, downgrading to the previous level if possible */ void remove_mutation( const trait_id &mut, bool silent = false ); /** Returns true if the player has the entered mutation child flag */ - bool has_child_flag( const trait_id &mut ) const; + bool has_child_flag( const trait_id &flag ) const; /** Removes the mutation's child flag from the player's list */ - void remove_child_flag( const trait_id &mut ); + void remove_child_flag( const trait_id &flag ); const tripoint &pos() const override; /** Returns the player's sight range */ @@ -448,7 +448,7 @@ class player : public Character bool has_watch() const; // see Creature::sees - bool sees( const tripoint &c, bool is_player = false, int range_mod = 0 ) const override; + bool sees( const tripoint &t, bool is_player = false, int range_mod = 0 ) const override; // see Creature::sees bool sees( const Creature &critter ) const override; /** @@ -609,7 +609,7 @@ class player : public Character dispersion_sources get_weapon_dispersion( const item &obj ) const; /** Returns true if a gun misfires, jams, or has other problems, else returns false */ - bool handle_gun_damage( item &firing, int shots_fired ); + bool handle_gun_damage( item &it, int shots_fired ); /** Get maximum recoil penalty due to vehicle motion */ double recoil_vehicle() const; @@ -638,7 +638,7 @@ class player : public Character int fire_gun( const tripoint &target, int shots, item &gun ); /** Handles reach melee attacks */ - void reach_attack( const tripoint &target ); + void reach_attack( const tripoint &p ); /** Checks for valid block abilities and reduces damage accordingly. Returns true if the player blocks */ bool block_hit( Creature *source, body_part &bp_hit, damage_instance &dam ) override; @@ -676,7 +676,7 @@ class player : public Character /** Returns the player's basic hit roll that is compared to the target's dodge roll */ float hit_roll() const override; /** Returns the chance to critical given a hit roll and target's dodge roll */ - double crit_chance( float hit_roll, float target_dodge, const item &weap ) const; + double crit_chance( float roll_hit, float target_dodge, const item &weap ) const; /** Returns true if the player scores a critical hit */ bool scored_crit( float target_dodge, const item &weap ) const; /** Returns cost (in moves) of attacking with given item (no modifiers, like stuck) */ @@ -702,7 +702,7 @@ class player : public Character std::vector get_all_techniques( const item &weap ) const; /** Returns true if the player has a weapon or martial arts skill available with the entered technique */ - bool has_technique( const matec_id &tec, const item &weap ) const; + bool has_technique( const matec_id &id, const item &weap ) const; /** Returns a random valid technique */ matec_id pick_technique( Creature &t, const item &weap, bool crit, bool dodge_counter, bool block_counter ); @@ -753,14 +753,14 @@ class player : public Character // ranged.cpp /** Execute a throw */ - dealt_projectile_attack throw_item( const tripoint &target, const item &thrown, + dealt_projectile_attack throw_item( const tripoint &target, const item &to_throw, const cata::optional &blind_throw_from_pos = cata::nullopt ); // Mental skills and stats /** Returns the player's reading speed */ - int read_speed( bool real_life = true ) const; + int read_speed( bool return_stat_effect = true ) const; /** Returns the player's skill rust rate */ - int rust_rate( bool real_life = true ) const; + int rust_rate( bool return_stat_effect = true ) const; /** Returns a value used when attempting to convince NPC's of something */ int talk_skill() const; /** Returns a value used when attempting to intimidate NPC's */ @@ -784,7 +784,7 @@ class player : public Character /** Reduce healing effect intensity, return initial intensity of the effect */ int reduce_healing_effect( const efftype_id &eff_id, int remove_med, body_part hurt ); /** Actually hurt the player, hurts a body_part directly, no armor reduction */ - void apply_damage( Creature *source, body_part bp, int amount, + void apply_damage( Creature *source, body_part hurt, int dam, bool bypass_med = false ) override; /** Modifies a pain value by player traits before passing it to Creature::mod_pain() */ void mod_pain( int npain ) override; @@ -793,7 +793,7 @@ class player : public Character /** Returns perceived pain (reduced with painkillers)*/ int get_perceived_pain() const override; - void cough( bool harmful = false, int volume = 4 ); + void cough( bool harmful = false, int loudness = 4 ); void add_pain_msg( int val, body_part bp ) const; @@ -814,7 +814,7 @@ class player : public Character /** Harms all body parts for dam, with armor reduction. If vary > 0 damage to parts are random within vary % (1-100) */ int hitall( int dam, int vary, Creature *source ); /** Knocks the player to a specified tile */ - void knock_back_to( const tripoint &p ) override; + void knock_back_to( const tripoint &to ) override; /** Returns multiplier on fall damage at low velocity (knockback/pit/1 z-level, not 5 z-levels) */ float fall_damage_mod() const override; @@ -864,10 +864,10 @@ class player : public Character /** used for drinking from hands, returns how many charges were consumed */ int drink_from_hands( item &water ); /** Used for eating object at pos, returns true if object is removed from inventory (last charge was consumed) */ - bool consume( int pos ); + bool consume( int target_position ); /** Used for eating a particular item that doesn't need to be in inventory. * Returns true if the item is to be removed (doesn't remove). */ - bool consume_item( item &eat ); + bool consume_item( item &target ); /** Returns allergy type or MORALE_NULL if not allergic for this player */ morale_type allergy_type( const item &food ) const; /** Used for eating entered comestible, returns true if comestible is successfully eaten */ @@ -957,7 +957,7 @@ class player : public Character /** Current metabolic rate due to traits, hunger, speed, etc. */ float metabolic_rate() const; /** Handles the effects of consuming an item */ - bool consume_effects( item &eaten ); + bool consume_effects( item &food ); /** Handles rooting effects */ void rooted_message() const; void rooted(); @@ -1067,7 +1067,7 @@ class player : public Character int item_reload_cost( const item &it, const item &ammo, int qty ) const; /** Calculate (but do not deduct) the number of moves required to wear an item */ - int item_wear_cost( const item &to_wear ) const; + int item_wear_cost( const item &it ) const; /** Wear item; returns false on fail. If interactive is false, don't alert the player or drain moves on completion. */ cata::optional::iterator> @@ -1090,7 +1090,7 @@ class player : public Character bool takeoff( int pos ); /** Drops an item to the specified location */ void drop( int pos, const tripoint &where ); - void drop( const std::list> &what, const tripoint &where, bool stash = false ); + void drop( const std::list> &what, const tripoint &target, bool stash = false ); /** So far only called by unload() from game.cpp */ bool add_or_drop_with_msg( item &it, bool unloading = false ); @@ -1118,7 +1118,7 @@ class player : public Character /** Draws the UI and handles player input for the armor re-ordering window */ void sort_armor(); /** Uses a tool */ - void use( int pos ); + void use( int inventory_position ); /** Uses a tool at location */ void use( item_location loc ); /** Uses the current wielded weapon */ @@ -1245,7 +1245,7 @@ class player : public Character static int thirst_speed_penalty( int thirst ); int adjust_for_focus( int amount ) const; - void practice( const skill_id &s, int amount, int cap = 99 ); + void practice( const skill_id &id, int amount, int cap = 99 ); /** Legacy activity assignment, should not be used where resuming is important. */ void assign_activity( const activity_id &type, int moves = calendar::INDEFINITELY_LONG, @@ -1487,9 +1487,9 @@ class player : public Character select_item_component( const std::vector &components, int batch, inventory &map_inv, bool can_cancel = false, const std::function &filter = return_true, bool player_inv = true ); - std::list consume_items( const comp_selection &cs, int batch, + std::list consume_items( const comp_selection &is, int batch, const std::function &filter = return_true ); - std::list consume_items( map &m, const comp_selection &cs, int batch, + std::list consume_items( map &m, const comp_selection &is, int batch, const std::function &filter = return_true, const tripoint &origin = tripoint_zero, int radius = PICKUP_RANGE ); std::list consume_items( const std::vector &components, int batch = 1, @@ -1502,7 +1502,7 @@ class player : public Character return i; } ); /** Consume tools for the next multiplier * 5% progress of the craft */ - bool craft_consume_tools( item &craft, int multiplier, bool start_craft ); + bool craft_consume_tools( item &craft, int mulitplier, bool start_craft ); void consume_tools( const comp_selection &tool, int batch ); void consume_tools( map &m, const comp_selection &tool, int batch, const tripoint &origin = tripoint_zero, int radius = PICKUP_RANGE, @@ -1746,7 +1746,7 @@ class player : public Character // formats and prints encumbrance info to specified window void print_encumbrance( const catacurses::window &win, int line = -1, - const item *selected_limb = nullptr ) const; + const item *selected_clothing = nullptr ) const; // Prints message(s) about current health void print_health() const; @@ -1793,11 +1793,11 @@ class player : public Character trap_map known_traps; - void store( JsonOut &jsout ) const; - void load( JsonObject &jsin ); + void store( JsonOut &json ) const; + void load( JsonObject &data ); /** Processes human-specific effects of an effect. */ - void process_one_effect( effect &e, bool is_new ) override; + void process_one_effect( effect &it, bool is_new ) override; private: diff --git a/src/player_activity.h b/src/player_activity.h index dff39a5798417..b36850a1c74b1 100644 --- a/src/player_activity.h +++ b/src/player_activity.h @@ -91,7 +91,7 @@ class player_activity */ bool is_suspendable() const; - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); /** Convert from the old enumeration to the new string_id */ void deserialize_legacy_type( int legacy_type, activity_id &dest ); diff --git a/src/recipe_groups.h b/src/recipe_groups.h index 0b65b4898a9b0..6576fa7e0b0ef 100644 --- a/src/recipe_groups.h +++ b/src/recipe_groups.h @@ -14,7 +14,7 @@ void load( JsonObject &jo, const std::string &src ); void check(); void reset(); -std::map get_recipes_by_bldg( const std::string &id ); +std::map get_recipes_by_bldg( const std::string &bldg ); std::map get_recipes_by_id( const std::string &id, const std::string &om_terrain_id = "ANY" ); } // namespace recipe_group diff --git a/src/requirements.h b/src/requirements.h index 88c3254bf3a62..748f98409d62e 100644 --- a/src/requirements.h +++ b/src/requirements.h @@ -112,7 +112,7 @@ struct quality_requirement { quality_requirement( const quality_id &TYPE, int COUNT, int LEVEL ) : type( TYPE ), count( COUNT ), level( LEVEL ) { } - void load( JsonArray &ja ); + void load( JsonArray &jsarr ); bool has( const inventory &crafting_inv, const std::function &filter, int = 0, std::function visitor = std::function() ) const; std::string to_string( int = 0 ) const; diff --git a/src/rng.h b/src/rng.h index 555df4886a11a..e05652f8eb27d 100644 --- a/src/rng.h +++ b/src/rng.h @@ -24,7 +24,7 @@ cata_default_random_engine &rng_get_engine(); unsigned int rng_bits(); int rng( int lo, int hi ); -double rng_float( double val1, double val2 ); +double rng_float( double lo, double hi ); bool one_in( int chance ); bool one_turn_in( const time_duration &duration ); bool x_in_y( double x, double y ); diff --git a/src/shadowcasting.h b/src/shadowcasting.h index 9f3ea71cfa8cd..2662311cd75d1 100644 --- a/src/shadowcasting.h +++ b/src/shadowcasting.h @@ -117,6 +117,6 @@ void cast_zlight( const std::array &output_caches, const std::array &input_arrays, const std::array &floor_caches, - const tripoint &offset, int offset_distance, T numerator ); + const tripoint &origin, int offset_distance, T numerator ); #endif diff --git a/src/skill.h b/src/skill.h index 2dfc5daddcae1..886ac0e19322a 100644 --- a/src/skill.h +++ b/src/skill.h @@ -160,7 +160,7 @@ class SkillLevel return !( *this < b ); } - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); }; diff --git a/src/string_formatter.h b/src/string_formatter.h index 39ca9e8664f54..28c98d7fa24b5 100644 --- a/src/string_formatter.h +++ b/src/string_formatter.h @@ -372,7 +372,7 @@ class string_formatter * not guaranteed - technically it's undefined behaviour. */ // Implemented in output.cpp - static std::string raw_string_format( const char *pattern, ... ) PRINTF_LIKE( 1, 2 ); + static std::string raw_string_format( const char *format, ... ) PRINTF_LIKE( 1, 2 ); #undef PRINTF_LIKE }; diff --git a/src/veh_utils.h b/src/veh_utils.h index a4257ea3d71ee..187598fc91ab1 100644 --- a/src/veh_utils.h +++ b/src/veh_utils.h @@ -25,7 +25,7 @@ vehicle_part &most_repairable_part( vehicle &veh, Character &who_arg, * Repairs a given part on a given vehicle by given character. * Awards xp and consumes components. */ -bool repair_part( vehicle &veh, vehicle_part &part, Character &who ); +bool repair_part( vehicle &veh, vehicle_part &pt, Character &who ); } // namespace veh_utils #endif diff --git a/src/vehicle.h b/src/vehicle.h index 1810bc5d4187e..81b3b0e056f11 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -164,7 +164,7 @@ struct vehicle_part { vehicle_part(); /** DefaultConstructible */ - vehicle_part( const vpart_id &vp, const point &dp, item &&it ); + vehicle_part( const vpart_id &vp, const point &dp, item &&obj ); /** Check this instance is non-null (not default constructed) */ explicit operator bool() const; @@ -404,7 +404,7 @@ struct vehicle_part { /** Get part definition common to all parts of this type */ const vpart_info &info() const; - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); const item &get_base() const; @@ -638,10 +638,10 @@ class vehicle // Vehicle fuel indicator (by fuel) void print_fuel_indicator( const catacurses::window &w, int y, int x, - const itype_id &fuelType, + const itype_id &fuel_type, bool verbose = false, bool desc = false ); void print_fuel_indicator( const catacurses::window &w, int y, int x, - const itype_id &fuelType, + const itype_id &fuel_type, std::map fuel_usages, bool verbose = false, bool desc = false ); @@ -686,9 +686,9 @@ class vehicle * @return The last visitor's return value. */ template - static int traverse_vehicle_graph( Vehicle *start_veh, int amount, Func visitor ); + static int traverse_vehicle_graph( Vehicle *start_veh, int amount, Func action ); public: - vehicle( const vproto_id &type_id, int veh_init_fuel = -1, int veh_init_status = -1 ); + vehicle( const vproto_id &type_id, int init_veh_fuel = -1, int init_veh_status = -1 ); vehicle(); ~vehicle(); @@ -717,14 +717,14 @@ class vehicle bool remote_controlled( const player &p ) const; // init parts state for randomly generated vehicle - void init_state( int veh_init_fuel, int veh_init_status ); + void init_state( int init_veh_fuel, int init_veh_status ); // damages all parts of a vehicle by a random amount void smash( float hp_percent_loss_min = 0.1f, float hp_percent_loss_max = 1.2f, float percent_of_parts_to_affect = 1.0f, point damage_origin = point_zero, float damage_size = 0 ); - void serialize( JsonOut &jsout ) const; + void serialize( JsonOut &json ) const; void deserialize( JsonIn &jsin ); // Vehicle parts list - all the parts on a single tile int print_part_list( const catacurses::window &win, int y1, int max_y, int width, int p, @@ -809,7 +809,7 @@ class vehicle // remove the carried flag from a vehicle after it has bee removed from a rack void remove_carried_flag(); // remove a vehicle specified by a list of part indices - bool remove_carried_vehicle( const std::vector &carried_vehicle ); + bool remove_carried_vehicle( const std::vector &carried_parts ); // split the current vehicle into up to four vehicles if they have no connection other // than the structure part at exclude bool find_and_split_vehicles( int exclude ); @@ -990,7 +990,7 @@ class vehicle std::vector get_printable_fuel_types() const; // Vehicle fuel indicators (all of them) - void print_fuel_indicators( const catacurses::window &win, int y, int x, int startIndex = 0, + void print_fuel_indicators( const catacurses::window &win, int y, int x, int start_index = 0, bool fullsize = false, bool verbose = false, bool desc = false, bool isHorizontal = false ); // Pre-calculate mount points for (idir=0) - current direction or (idir=1) - next turn direction @@ -1048,13 +1048,13 @@ class vehicle * @param energy_w Desired amount of energy of fuel to consume * @return Amount of energy actually consumed. May be more or less than energy. */ - double drain_energy( const itype_id &ftype, double energy_w ); + double drain_energy( const itype_id &ftype, double energy_j ); // fuel consumption of vehicle engines of given type int basic_consumption( const itype_id &ftype ) const; int consumption_per_hour( const itype_id &ftype, int fuel_rate ) const; - void consume_fuel( int load, int t_seconds = 6, bool skip_battery = false ); + void consume_fuel( int load, int t_seconds = 6, bool skip_electric = false ); /** * Maps used fuel to its basic (unscaled by load/strain) consumption. @@ -1072,7 +1072,7 @@ class vehicle int total_epower_w(); // Calculate vehicle's total drain or production of electrical power, optionally // including nominal solar power. Return engine power as engine_power - int total_epower_w( int &engine_power, bool skip_solar = true ); + int total_epower_w( int &engine_epower, bool skip_solar = true ); // Calculate the total available power rating of all reactors int total_reactor_epower_w() const; // Produce and consume electrical power, with excess power stored or taken from @@ -1083,7 +1083,7 @@ class vehicle * Try to charge our (and, optionally, connected vehicles') batteries by the given amount. * @return amount of charge left over. */ - int charge_battery( int amount, bool recurse = true ); + int charge_battery( int amount, bool include_other_vehicles = true ); /** * Try to discharge our (and, optionally, connected vehicles') batteries by the given amount. @@ -1302,7 +1302,7 @@ class vehicle * the volume limit or item count limit, not all charges can fit, etc.) * Otherwise, returns an iterator to the added item in the vehicle stack */ - cata::optional add_item( int part, const item &obj ); + cata::optional add_item( int part, const item &itm ); /** Like the above */ cata::optional add_item( vehicle_part &pt, const item &obj ); /** @@ -1467,7 +1467,7 @@ class vehicle //returns whether the alternator is operational bool is_alternator_on( int a ) const; //mark engine as on or off - void toggle_specific_engine( int p, bool on ); + void toggle_specific_engine( int e, bool on ); void toggle_specific_part( int p, bool on ); //true if an engine exists with specified type //If enabled true, this engine must be enabled to return true @@ -1477,11 +1477,11 @@ class vehicle bool has_engine_type_not( const itype_id &ft, bool enabled ) const; //returns true if there's another engine with the same exclusion list; conflict_type holds //the exclusion - bool has_engine_conflict( const vpart_info *possible_engine, std::string &conflict_type ) const; + bool has_engine_conflict( const vpart_info *possible_conflict, std::string &conflict_type ) const; //returns true if the engine doesn't consume fuel bool is_perpetual_type( int e ) const; //if necessary, damage this engine - void do_engine_damage( size_t p, int strain ); + void do_engine_damage( size_t e, int strain ); //remotely open/close doors void control_doors(); // return a vector w/ 'direction' & 'magnitude', in its own sense of the words.