]> git.lizzy.rs Git - minetest.git/blobdiff - src/tool.cpp
Do not allow the m_transforming_liquid queue to increase until all RAM is consumed
[minetest.git] / src / tool.cpp
index 4d809e2c44ffc75e3e1e374a439004b19a2d8462..e013d5ea8ad63892b988744dc1855ffcc5982afc 100644 (file)
@@ -18,9 +18,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "tool.h"
-#include "itemdef.h" // For itemgroup_get()
+#include "itemgroup.h"
 #include "log.h"
 #include "inventory.h"
+#include "exceptions.h"
 #include "util/serialize.h"
 #include "util/numeric.h"
 
@@ -165,7 +166,7 @@ HitParams getHitParams(const ItemGroupList &armor_groups,
        for(std::map<std::string, s16>::const_iterator
                        i = tp->damageGroups.begin(); i != tp->damageGroups.end(); i++){
                s16 armor = itemgroup_get(armor_groups, i->first);
-               damage += i->second * rangelim(time_from_last_punch * full_punch_interval, 0.0, 1.0)
+               damage += i->second * rangelim(time_from_last_punch / full_punch_interval, 0.0, 1.0)
                                * armor / 100.0;
        }