diff options
author | Fernando Carmona Varo <ferkiwi@gmail.com> | 2015-11-11 00:26:01 +0100 |
---|---|---|
committer | Fernando Carmona Varo <ferkiwi@gmail.com> | 2015-11-11 00:26:01 +0100 |
commit | c62d9b9a3dfb32dae3377a2fe27c5d1febd7a05a (patch) | |
tree | d680f84eb80c34adbdb28639d7b0bfdb16b8dd96 /mario/gamestate.lua | |
parent | c9a814a173e70746b8756ca39bd1fdc694610e8a (diff) |
Fixed turtles going through portals, fly/noclip/fast priviledges will be temporarily disabled during the game, and increased a bit ghost radius
Diffstat (limited to 'mario/gamestate.lua')
-rwxr-xr-x | mario/gamestate.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mario/gamestate.lua b/mario/gamestate.lua index a2bfb89..7f6ec61 100755 --- a/mario/gamestate.lua +++ b/mario/gamestate.lua @@ -47,6 +47,14 @@ function mario.game_start(pos, player, gamedef) mario.games[id] = gamestate mario.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 mario game started at " .. id .. " by " .. gamestate.player_name) -- place schematic @@ -71,6 +79,8 @@ function mario.game_end(id) mario.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, { |