Skip to content

Commit

Permalink
No more t_dirt 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
Procyonae committed Apr 2, 2024
1 parent 0847ee6 commit bf1ac23
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/build_reqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ struct parameterized_build_reqs {

build_reqs get_build_reqs_for_furn_ter_ids(
const std::pair<std::map<ter_id, int>, std::map<furn_id, int>> &changed_ids,
ter_id const &base_ter = t_dirt );
ter_id const &base_ter = ter_str_id( "t_dirt" ).id() );

#endif // CATA_SRC_BUILD_REQS_H
6 changes: 3 additions & 3 deletions src/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -1083,10 +1083,10 @@ class map
void make_rubble( const tripoint &p, const furn_id &rubble_type, bool items,
const ter_id &floor_type, bool overwrite = false );
void make_rubble( const tripoint &p, const furn_id &rubble_type, bool items ) {
make_rubble( p, rubble_type, items, t_dirt, false );
make_rubble( p, rubble_type, items, ter_str_id( "t_dirt" ).id(), false );
}
void make_rubble( const tripoint &p ) {
make_rubble( p, f_rubble, false, t_dirt, false );
make_rubble( p, f_rubble, false, ter_str_id( "t_dirt" ).id(), false );
}

bool is_outside( const tripoint &p ) const;
Expand Down Expand Up @@ -2633,7 +2633,7 @@ class fake_map : public tinymap
private:
std::vector<std::unique_ptr<submap>> temp_submaps_;
public:
explicit fake_map( const ter_id &ter_type = t_dirt );
explicit fake_map( const ter_id &ter_type = ter_str_id( "t_dirt" ).id() );
~fake_map() override;
static constexpr int fake_map_z = -OVERMAP_DEPTH;
};
Expand Down
3 changes: 1 addition & 2 deletions src/mapdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,12 +742,11 @@ void map_data_common_t::set_groups( std::bitset<NUM_TERCONN> &bits,
}
}

ter_id t_null, t_dirt;
ter_id t_null;

void set_ter_ids()
{
t_null = ter_id( "t_null" );
t_dirt = ter_id( "t_dirt" );

for( const ter_t &elem : terrain_data.get_all() ) {
ter_t &ter = const_cast<ter_t &>( elem );
Expand Down
2 changes: 1 addition & 1 deletion src/mapdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ t_basalt
"t_basalt"
*/
// NOLINTNEXTLINE(cata-static-int_id-constants)
extern ter_id t_null, t_dirt;
extern ter_id t_null;
/*
runtime index: furn_id
furn_id refers to a position in the furnlist[] where the furn_t struct is stored. See note
Expand Down
2 changes: 1 addition & 1 deletion src/mapgen_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bool apply_construction_marker( const update_mapgen_id &update_mapgen_id,
const mapgen_arguments &args, bool mirror_horizontal,
bool mirror_vertical, int rotation, bool apply );
std::pair<std::map<ter_id, int>, std::map<furn_id, int>> get_changed_ids_from_update(
const update_mapgen_id &, const mapgen_arguments &, ter_id const &base_ter = t_dirt );
const update_mapgen_id &, const mapgen_arguments &, ter_id const &base_ter = ter_str_id( "t_dirt" ).id() );
mapgen_parameters get_map_special_params( const std::string &mapgen_id );

void resolve_regional_terrain_and_furniture( const mapgendata &dat );
Expand Down

0 comments on commit bf1ac23

Please sign in to comment.