Skip to content

Commit

Permalink
Merge pull request #29177 from davidpwbrown/vehicle_butchery
Browse files Browse the repository at this point in the history
Allow vehicle tables to perform butchery
  • Loading branch information
ZhilkinSerg authored Apr 1, 2019
2 parents 7a254f5 + 0e6cbca commit 75c5832
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions data/json/vehicle_parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@
"item": "v_table",
"difficulty": 1,
"location": "center",
"flags": [ "CARGO", "OBSTACLE", "TOOL_WRENCH" ],
"flags": [ "CARGO", "OBSTACLE", "TOOL_WRENCH", "FLAT_SURF" ],
"breaks_into": [
{ "item": "2x4", "count": [ 1, 6 ] },
{ "item": "splinter", "count": [ 4, 6 ] },
Expand All @@ -990,7 +990,7 @@
"item": "w_table",
"difficulty": 1,
"location": "center",
"flags": [ "CARGO", "OBSTACLE", "TOOL_WRENCH" ],
"flags": [ "CARGO", "OBSTACLE", "TOOL_WRENCH", "FLAT_SURF" ],
"breaks_into": [
{ "item": "2x4", "count": [ 1, 6 ] },
{ "item": "splinter", "count": [ 4, 6 ] },
Expand Down
2 changes: 1 addition & 1 deletion doc/JSON_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ List of known flags, used in both terrain.json and furniture.json
- ```FLAMMABLE_ASH``` Burns to ash rather than rubble.
- ```FLAMMABLE_HARD``` Harder to light on fire, but still possible.
- ```FLAT``` Player can build and move furniture on.
- ```FLAT_SURF``` Furniture or terrain with flat hard surface (ex. table, but not chair; tree stump, etc.).
- ```FLAT_SURF``` Furniture or terrain or vehicle part with flat hard surface (ex. table, but not chair; tree stump, etc.).
- ```GOES_DOWN``` Can use <kbd>></kbd> to go down a level.
- ```GOES_UP``` Can use <kbd><</kbd> to go up a level.
- ```HARVESTED``` Marks the harvested version of a terrain type (e.g. harvesting an apple tree turns it into a harvested tree, which later becomes an apple tree again).
Expand Down
3 changes: 2 additions & 1 deletion src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ void set_up_butchery( player_activity &act, player &u, butcher_type action )
bool has_table_nearby = false;
for( const tripoint &pt : g->m.points_in_radius( u.pos(), 2 ) ) {
if( g->m.has_flag_furn( "FLAT_SURF", pt ) || g->m.has_flag( "FLAT_SURF", pt ) ||
( g->m.veh_at( pt ) && g->m.veh_at( pt )->vehicle().has_part( "KITCHEN" ) ) ) {
( ( g->m.veh_at( pt ) && ( g->m.veh_at( pt )->vehicle().has_part( "KITCHEN" ) ||
g->m.veh_at( pt )->vehicle().has_part( "FLAT_SURF" ) ) ) ) ) {
has_table_nearby = true;
}
}
Expand Down

0 comments on commit 75c5832

Please sign in to comment.