From c62d9b9a3dfb32dae3377a2fe27c5d1febd7a05a Mon Sep 17 00:00:00 2001 From: Fernando Carmona Varo Date: Wed, 11 Nov 2015 00:26:01 +0100 Subject: Fixed turtles going through portals, fly/noclip/fast priviledges will be temporarily disabled during the game, and increased a bit ghost radius --- pacmine/gamestate.lua | 10 ++++++++++ pacmine/ghost.lua | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'pacmine') diff --git a/pacmine/gamestate.lua b/pacmine/gamestate.lua index f028e65..5ba5aab 100755 --- a/pacmine/gamestate.lua +++ b/pacmine/gamestate.lua @@ -49,6 +49,14 @@ function pacmine.game_start(pos, player, gamedef) pacmine.games[id] = gamestate pacmine.players[id] = player + -- store previous priviledges, disable fly whilöe the game is running + gamestate.player_privs = minetest.get_player_privs(player_name) + local new_privs = table.copy(gamestate.player_privs) + new_privs.fly = nil + new_privs.noclip = nil + new_privs.fast = nil + minetest.set_player_privs(player_name, new_privs) + minetest.log("action","New pacmine game started at " .. id .. " by " .. gamestate.player_name) -- place schematic @@ -69,6 +77,8 @@ function pacmine.game_end(id) pacmine.remove_hud(player, gamestate.player_name) player:moveto(vector.add(gamestate.pos,{x=0.5,y=0.5,z=-1.5})) end + -- Restore player priviledges + minetest.set_player_privs(gamestate.player_name, gamestate.player_privs) -- Save score if gamestate.scorename then local ranking = myhighscore.save_score(gamestate.scorename, { diff --git a/pacmine/ghost.lua b/pacmine/ghost.lua index 08167fa..ca9febd 100644 --- a/pacmine/ghost.lua +++ b/pacmine/ghost.lua @@ -80,7 +80,7 @@ for i in ipairs(ghosts) do -- find distance from ghost to player local distance = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5 - if distance < 1.5 then + if distance < 1.6 then -- player touches ghost!! if gamestate.power_pellet then -- cgit v1.2.3