Skip to content

Commit

Permalink
Overload map::make_rubble to avoid having referenced to t_* and f_* i…
Browse files Browse the repository at this point in the history
…n the header.
  • Loading branch information
BevapDin committed Jun 20, 2015
1 parent 5f9961e commit 6c7eb4a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
1 change: 0 additions & 1 deletion lua/class_definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,6 @@ classes = {
{ name = "light_transparency", rval = "float", args = { "tripoint" } },
{ name = "load", rval = nil, args = { "int", "int", "int", "bool" } },
{ name = "make_rubble", rval = nil, args = { "tripoint" } },
{ name = "make_rubble", rval = nil, args = { "tripoint", "furn_id" } },
{ name = "make_rubble", rval = nil, args = { "tripoint", "furn_id", "bool" } },
{ name = "make_rubble", rval = nil, args = { "tripoint", "furn_id", "bool", "ter_id" } },
{ name = "make_rubble", rval = nil, args = { "tripoint", "furn_id", "bool", "ter_id", "bool" } },
Expand Down
10 changes: 10 additions & 0 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2110,6 +2110,16 @@ int map::bash_rating( const int str, const tripoint &p, const bool allow_floor )

// End of 3D bashable

void map::make_rubble( const tripoint &p )
{
make_rubble( p, f_rubble, false, t_dirt, false );
}

void map::make_rubble( const tripoint &p, const furn_id rubble_type, const bool items )
{
make_rubble( p, rubble_type, items, t_dirt, false );
}

void map::make_rubble( const tripoint &p, furn_id rubble_type, bool items, ter_id floor_type, bool overwrite)
{
if (overwrite) {
Expand Down
10 changes: 6 additions & 4 deletions src/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,12 @@ class map

/** Generates rubble at the given location, if overwrite is true it just writes on top of what currently exists
* floor_type is only used if there is a non-bashable wall at the location or with overwrite = true */
void make_rubble( const tripoint &p, furn_id rubble_type = f_rubble, bool items = false,
ter_id floor_type = t_dirt, bool overwrite = false);
void make_rubble( int, int, furn_id rubble_type = f_rubble, bool items = false,
ter_id floor_type = t_dirt, bool overwrite = false) = delete;
void make_rubble( const tripoint &p, furn_id rubble_type, bool items,
ter_id floor_type, bool overwrite = false );
void make_rubble( const tripoint &p );
void make_rubble( const tripoint &p, furn_id rubble_type, bool items );
void make_rubble( int, int, furn_id rubble_type, bool items,
ter_id floor_type, bool overwrite = false) = delete;

bool is_divable(const int x, const int y) const;
bool is_outside(const int x, const int y) const;
Expand Down

0 comments on commit 6c7eb4a

Please sign in to comment.