Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust soil from digging to match construction needs #3161

Merged
merged 2 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/json/furniture_and_terrain/terrain-walls.json
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@
"sound": "heavy rumbling!",
"sound_fail": "thump",
"ter_set": "t_fence_post",
"items": [ { "item": "material_soil", "count": [ 100, 150 ] } ]
"items": [ { "item": "material_soil", "count": [ 50, 75 ] } ]
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2621,7 +2621,7 @@
// We also must tone down the yield of dirt to avoid potential problems,
// the old math was generating more than the tile volume limit.
//
// So to keep it simple, 50 liters for shallow pits, 100 for deep pit. We're basically
// So to keep it simple, 200 liters for shallow pits, 400 for deep pit. We're basically
// assuming that the first step is about one-third of the total work.

constexpr int deep_pit_time = 120;
Expand All @@ -2633,7 +2633,7 @@
///\EFFECT_STR modifies dig rate
// Adjust the dig rate if the player is above or below strength of 10.
// Floor it at 1 so we don't divide by zero, of course!
const double attr = 10 / std::max( 1, p->str_cur );

Check warning on line 2636 in src/iuse.cpp

View workflow job for this annotation

GitHub Actions / build

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division]

// And now determine the moves...
int dig_minutes = deep ? deep_pit_time : shallow_pit_time;
Expand All @@ -2647,7 +2647,7 @@
result_terrain = deep ? ter_id( "t_pit" ) : ter_id( "t_pit_shallow" );
}

return { moves, static_cast<int>( dig_minutes / 60 ), "digging_soil_loam_50L", result_terrain };
return { moves, static_cast<int>( dig_minutes / 15 ), "digging_soil_loam_50L", result_terrain };
}

int iuse::dig( player *p, item *it, bool t, const tripoint & )
Expand Down
Loading