From 9fc3cfb9a97474f79381ada93f06c6c63a67cc14 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Mon, 29 Jun 2015 19:07:09 +0200 Subject: [PATCH] Fixed disc identifier's counter (and chmod 755) --- mods/jukebox/init.lua | 5 ++++- mods/jukebox/sounds/jukebox_song.1.ogg | Bin 2 files changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 mods/jukebox/sounds/jukebox_song.1.ogg diff --git a/mods/jukebox/init.lua b/mods/jukebox/init.lua index 6f2ce9b1..668bad6a 100755 --- a/mods/jukebox/init.lua +++ b/mods/jukebox/init.lua @@ -1,5 +1,6 @@ jukebox = {} jukebox.tracks = {} +jukebox.nbtracks = 0 jukebox.particles = {} function make_particles(pos) @@ -140,7 +141,7 @@ local function register_disc(trackname, trackdesc, craftitem) trackdesc = trackdesc or "???" craftitem = craftitem or "group:wood" - local id = #jukebox.tracks + local id = jukebox.nbtracks minetest.register_craftitem("jukebox:disc_" .. id, { description = "Music Disc : " .. trackdesc, @@ -163,6 +164,8 @@ local function register_disc(trackname, trackdesc, craftitem) minetest.log("action", "[jukebox] Registrered disc " .. trackdesc .. ", id = " .. id .. " for file " .. trackname) + + jukebox.nbtracks = jukebox.nbtracks + 1 end register_disc("jukebox_event", "Event song", "default:stone") diff --git a/mods/jukebox/sounds/jukebox_song.1.ogg b/mods/jukebox/sounds/jukebox_song.1.ogg old mode 100644 new mode 100755