Skip to content

Commit 3296952

Browse files
committedJul 31, 2019
Allow toolcaps to override the built-in times for dig_immediate
1 parent 245e628 commit 3296952

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed
 

‎src/tool.cpp

+10-8
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,16 @@ void ToolCapabilities::deserializeJson(std::istream &is)
172172
DigParams getDigParams(const ItemGroupList &groups,
173173
const ToolCapabilities *tp)
174174
{
175-
// Group dig_immediate has fixed time and no wear
176-
switch (itemgroup_get(groups, "dig_immediate")) {
177-
case 2:
178-
return DigParams(true, 0.5, 0, "dig_immediate");
179-
case 3:
180-
return DigParams(true, 0, 0, "dig_immediate");
181-
default:
182-
break;
175+
// Group dig_immediate defaults to fixed time and no wear
176+
if (tp->groupcaps.find("dig_immediate") == tp->groupcaps.cend()) {
177+
switch (itemgroup_get(groups, "dig_immediate")) {
178+
case 2:
179+
return DigParams(true, 0.5, 0, "dig_immediate");
180+
case 3:
181+
return DigParams(true, 0, 0, "dig_immediate");
182+
default:
183+
break;
184+
}
183185
}
184186

185187
// Values to be returned (with a bit of conversion)

0 commit comments

Comments
 (0)
Please sign in to comment.