Change cart dismount position to behind the cart instead of beside it (#4785)

Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4785
Reviewed-by: kno10 <kno10@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
This commit is contained in:
teknomunk 2025-01-02 22:30:39 +01:00 committed by the-real-herowl
parent ca504e80c7
commit 9b23d9931e

View File

@ -51,7 +51,7 @@ local function detach_driver(self)
if player then
local dir = staticdata.dir or vector.new(1,0,0)
local cart_pos = mod.get_cart_position(staticdata) or self.object:get_pos()
local new_pos = vector.offset(cart_pos, -dir.z, 0, dir.x)
local new_pos = cart_pos - dir
player:set_detach()
--print("placing player at "..tostring(new_pos).." from cart at "..tostring(cart_pos)..", old_pos="..tostring(player:get_pos()).."dir="..tostring(dir))