summaryrefslogtreecommitdiff
path: root/worldedit_commands
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-08-11 18:39:55 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-08-11 18:39:55 -0400
commit92f49e3096dc37b9b802994d287c47dc7f583c24 (patch)
tree9480515a27630d8009dffb87de93124966fb1015 /worldedit_commands
parentf9cae7314e08fbeeef509c5c6ca095822fec1747 (diff)
downloaddreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.tar
dreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.tar.gz
dreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.tar.bz2
dreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.tar.xz
dreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.zip
updated boost_cart, plantlife, castle, homedecor, fake_fire,
glooptest, quartz, unified_inventory, inbox, mesecons, and worldedit mods
Diffstat (limited to 'worldedit_commands')
-rw-r--r--worldedit_commands/init.lua22
1 files changed, 10 insertions, 12 deletions
diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua
index eedc372..ca2b9e4 100644
--- a/worldedit_commands/init.lua
+++ b/worldedit_commands/init.lua
@@ -1152,8 +1152,8 @@ minetest.register_chatcommand("/mtschemprob", {
return
end
for k,v in pairs(problist) do
- local prob = math.floor(((v["prob"] / 256) * 100) * 100 + 0.5) / 100
- text = text .. minetest.pos_to_string(v["pos"]) .. ": " .. prob .. "% | "
+ local prob = math.floor(((v.prob / 256) * 100) * 100 + 0.5) / 100
+ text = text .. minetest.pos_to_string(v.pos) .. ": " .. prob .. "% | "
end
worldedit.player_notify(name, "currently set node probabilities:")
worldedit.player_notify(name, text)
@@ -1163,16 +1163,14 @@ minetest.register_chatcommand("/mtschemprob", {
end,
})
-minetest.register_on_player_receive_fields(
- function(player, formname, fields)
- if (formname == "prob_val_enter") and (fields.text ~= "") then
- local name = player:get_player_name()
- local prob_entry = {pos=worldedit.prob_pos[name], prob=tonumber(fields.text)}
- local index = table.getn(worldedit.prob_list[name]) + 1
- worldedit.prob_list[name][index] = prob_entry
- end
+minetest.register_on_player_receive_fields(function(player, formname, fields)
+ if formname == "prob_val_enter" and not (fields.text == "" or fields.text == nil) then
+ local name = player:get_player_name()
+ local prob_entry = {pos=worldedit.prob_pos[name], prob=tonumber(fields.text)}
+ local index = table.getn(worldedit.prob_list[name]) + 1
+ worldedit.prob_list[name][index] = prob_entry
end
-)
+end)
minetest.register_chatcommand("/clearobjects", {
params = "",
@@ -1182,4 +1180,4 @@ minetest.register_chatcommand("/clearobjects", {
local count = worldedit.clear_objects(worldedit.pos1[name], worldedit.pos2[name])
worldedit.player_notify(name, count .. " objects cleared")
end),
-}) \ No newline at end of file
+})