From 440e9cdbef19d154f134a85c7e2601f0aff63459 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Thu, 29 Mar 2012 13:35:20 +0300 Subject: Rework tool_capabilities a bit (maxwear->uses, scale dig time according to leveldiff) --- src/scriptapi.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/scriptapi.cpp') diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 38d681e9b..863e2ba28 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -670,8 +670,19 @@ static ToolCapabilities read_tool_capabilities( // This will be created ToolGroupCap groupcap; // Read simple parameters - getfloatfield(L, table_groupcap, "maxwear", groupcap.maxwear); getintfield(L, table_groupcap, "maxlevel", groupcap.maxlevel); + getintfield(L, table_groupcap, "uses", groupcap.uses); + // DEPRECATED: maxwear + float maxwear = 0; + if(getfloatfield(L, table_groupcap, "maxwear", maxwear)){ + if(maxwear != 0) + groupcap.uses = 1.0/maxwear; + else + groupcap.uses = 0; + infostream<