From 7670afcba18cc89bcb3480c159078dadc7655d78 Mon Sep 17 00:00:00 2001 From: elsid Date: Mon, 3 Mar 2025 00:18:39 +0100 Subject: [PATCH] Direct player attack lower by target's half height To make sure it always hits the target. --- scripts/data/integration_tests/test_lua_api/player.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/data/integration_tests/test_lua_api/player.lua b/scripts/data/integration_tests/test_lua_api/player.lua index 18229a3cd8..16f0f2eea3 100644 --- a/scripts/data/integration_tests/test_lua_api/player.lua +++ b/scripts/data/integration_tests/test_lua_api/player.lua @@ -315,7 +315,8 @@ testing.registerLocalTest('playerWeaponAttack', self.controls.run = true self.controls.movement = 1 else - destination = targetActor.position + local halfExtents = types.Actor.getPathfindingAgentBounds(targetActor).halfExtents + destination = targetActor.position - util.vector3(0, 0, halfExtents.z) if nextTime < time then if use == 0 then