Allow toolcaps to override the built-in times for dig_immediate

This commit is contained in:
sfan5 2019-07-30 17:18:37 +02:00
parent 245e628d40
commit 3296952ae5

@ -172,7 +172,8 @@ void ToolCapabilities::deserializeJson(std::istream &is)
DigParams getDigParams(const ItemGroupList &groups, DigParams getDigParams(const ItemGroupList &groups,
const ToolCapabilities *tp) const ToolCapabilities *tp)
{ {
// Group dig_immediate has fixed time and no wear // Group dig_immediate defaults to fixed time and no wear
if (tp->groupcaps.find("dig_immediate") == tp->groupcaps.cend()) {
switch (itemgroup_get(groups, "dig_immediate")) { switch (itemgroup_get(groups, "dig_immediate")) {
case 2: case 2:
return DigParams(true, 0.5, 0, "dig_immediate"); return DigParams(true, 0.5, 0, "dig_immediate");
@ -181,6 +182,7 @@ DigParams getDigParams(const ItemGroupList &groups,
default: default:
break; break;
} }
}
// Values to be returned (with a bit of conversion) // Values to be returned (with a bit of conversion)
bool result_diggable = false; bool result_diggable = false;