From d70ccb4c276fe08865ca4158b10625fcfc6af3ea Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Mon, 17 Feb 2020 18:32:33 +0100 Subject: [PATCH] Improve mining alternate mode for nodes --- gamemode/engine/lib/sh_node.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gamemode/engine/lib/sh_node.lua b/gamemode/engine/lib/sh_node.lua index 2d99700..c6d7cab 100644 --- a/gamemode/engine/lib/sh_node.lua +++ b/gamemode/engine/lib/sh_node.lua @@ -160,7 +160,11 @@ if SERVER then Quantum.Notify.ItemGathered( pl, itemTbl, amount ) else local basepos = ent:GetPos() - Quantum.Server.Item.SpawnItem( basepos, loot, amount ) + -- calculate the entities collision bounds height + local p, q = ent:GetCollisionBounds() -- Z is the height + local height = q.z - p.z + + Quantum.Server.Item.SpawnItem( basepos + Vector(0, 0, height), loot, amount ) end else return