From 42b950af22d8776964ebacac1739043aa32bc597 Mon Sep 17 00:00:00 2001 From: Fernando Carmona Varo Date: Sun, 29 Nov 2015 11:28:25 +0100 Subject: [PATCH] Fix rounding issue with the collision detection that could cause problems with the portals --- mario/gamestate.lua | 2 +- pacmine/gamestate.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mario/gamestate.lua b/mario/gamestate.lua index 95583e9..df1816b 100755 --- a/mario/gamestate.lua +++ b/mario/gamestate.lua @@ -268,7 +268,7 @@ local function on_player_gamestep(player, gameid) {x=-0.5,y=0.5,z=-0.25}, } for _,pos in pairs(positions) do - pos = vector.add(player_pos, pos) + pos = vector.round(vector.add(player_pos, pos)) local node = minetest.get_node(pos) local nodedef = minetest.registered_nodes[node.name] diff --git a/pacmine/gamestate.lua b/pacmine/gamestate.lua index 9524e83..d2424b4 100755 --- a/pacmine/gamestate.lua +++ b/pacmine/gamestate.lua @@ -270,7 +270,7 @@ local function on_player_gamestep(player, gameid) {x=-0.5,y=0.5,z=-0.5}, } for _,pos in pairs(positions) do - pos = vector.add(player_pos, pos) + pos = vector.round(vector.add(player_pos, pos)) local node = minetest.get_node(pos) local nodedef = minetest.registered_nodes[node.name]