aboutsummaryrefslogtreecommitdiff
path: root/tracks.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-12-13 19:40:20 +0100
committerorwell96 <mono96.mml@gmail.com>2016-12-13 19:40:20 +0100
commit6eea76a2ffad58628b0d8941e8d0ed34580a8876 (patch)
treebf8fc50c54eb7361884607343da601d220a6d12e /tracks.lua
parent1f66cab1695fdc92a586d28805a5acfba6662983 (diff)
downloadadvtrains-6eea76a2ffad58628b0d8941e8d0ed34580a8876.tar.gz
advtrains-6eea76a2ffad58628b0d8941e8d0ed34580a8876.tar.bz2
advtrains-6eea76a2ffad58628b0d8941e8d0ed34580a8876.zip
Don't decrease stack itemcount of slope placer in creative
Diffstat (limited to 'tracks.lua')
-rw-r--r--tracks.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/tracks.lua b/tracks.lua
index 617266a..bff88d3 100644
--- a/tracks.lua
+++ b/tracks.lua
@@ -505,12 +505,14 @@ function sl.create_slopeplacer_on_place(def, preset)
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].buildable_to or minetest.is_protected(pos, player:get_player_name()) then
--do slopes of this distance exist?
if lookup[step] then
- if istack:get_count()>=step then
+ if minetest.setting_getbool("creative_mode") or istack:get_count()>=step then
--start placing
local placenodes=lookup[step]
while step>0 do
minetest.set_node(pos, {name=def.nodename_prefix.."_"..placenodes[step], param2=param2})
- istack:take_item()
+ if not minetest.setting_getbool("creative_mode") then
+ istack:take_item()
+ end
step=step-1
pos=vector.subtract(pos, dirvec)
end