Fix a crash, update translations and zip file
authororwell96 <mono96.mml@gmail.com>
Sat, 28 Jan 2017 16:06:38 +0000 (17:06 +0100)
committerorwell96 <mono96.mml@gmail.com>
Sat, 28 Jan 2017 16:58:19 +0000 (17:58 +0100)
advtrains.zip
advtrains/advtrains/locale/de.txt
advtrains/advtrains/trainlogic.lua
advtrains/advtrains/wagons.lua

index e5357c9..58f0f63 100644 (file)
Binary files a/advtrains.zip and b/advtrains.zip differ
index 5d67cd2..c8aaab7 100644 (file)
@@ -37,5 +37,14 @@ Detector Rail = Detektorschiene
 Speed: = Geschw.:
 Target: = Zielges.:
 @1 Slope = @1 Steigung
-
+Can't get on: wagon full or doors closed! = Kann nicht einsteigen: Waggon voll oder Türen geschlossen.
+Use shift+click to open doors forcefully! = Nutze Sneak+Rechtsklick, um die Türnotöffnung zu aktivieren und trotzdem einzusteigen.
+Lock couples = Kupplungen sperren
+Save wagon properties = Waggon-Einstellungen speichern
+Doors are closed! Use shift-rightclick to open doors with force and get off! = Türen sind geschlossen! Sneak+Rechtsklick, um die Türnotöffnung zu aktivieren und trotzdem auszusteigen.
+Wagon properties = Waggon-Einstellungen
+Get off = Aussteigen
+Get off (forced) = Aussteigen (erzwingen)
+(Doors closed) = (Türen geschlossen)
+Access to @1 = Zugang zu @1
 
index b1ee31a..7238d92 100644 (file)
@@ -731,7 +731,7 @@ end
 function advtrains.invert_train(train_id)
        local train=advtrains.trains[train_id]
        
-       local old_path=advtrains.get_or_create_path(train_id, train)
+       local old_path=train.path
        train.path={}
        train.index= - advtrains.get_train_end_index(train)
        train.velocity=-train.velocity
@@ -756,7 +756,7 @@ function advtrains.is_train_at_pos(pos)
                if le and le.is_wagon and le.initialized and le.train_id and not checked_trains[le.train_id] then
                        --atprint("istrainat: checking "..le.train_id)
                        checked_trains[le.train_id]=true
-                       local path=advtrains.get_or_create_path(le.train_id, le:train())
+                       local path=le:train().path
                        if path then
                                --atprint("has path")
                                for i=math.floor(advtrains.get_train_end_index(le:train())+0.5),math.floor(le:train().index+0.5) do
index 728a5eb..9d63ab5 100644 (file)
@@ -90,7 +90,7 @@ function wagon:init_from_wagon_save(uid)
        end\r
        self:init_shared()\r
        self.initialized=true\r
-       minetest.after(1, function() self:reattach_all() end)\r
+       minetest.after(0.2, function() self:reattach_all() end)\r
        atprint("init_from_wagon_save "..self.unique_id.." ("..self.train_id..")")\r
 end\r
 function wagon:init_shared()\r
@@ -453,18 +453,18 @@ function wagon:on_rightclick(clicker)
                                end\r
                        end\r
                        if self.has_inventory and self.get_inventory_formspec then\r
-                               poss[#poss+1]={name="Show inventory", key="inv"}\r
+                               poss[#poss+1]={name=attrans("Show Inventory"), key="inv"}\r
                        end\r
                        if self.owner==pname then\r
-                               poss[#poss+1]={name="Wagon properties", key="prop"}\r
+                               poss[#poss+1]={name=attrans("Wagon properties"), key="prop"}\r
                        end\r
                        if not self.seat_groups[sgr].require_doors_open or self:train().door_open~=0 then\r
-                               poss[#poss+1]={name="Get off", key="off"}\r
+                               poss[#poss+1]={name=attrans("Get off"), key="off"}\r
                        else\r
                                if clicker:get_player_control().sneak then\r
-                                       poss[#poss+1]={name="Get off (forced)", key="off"}\r
+                                       poss[#poss+1]={name=attrans("Get off (forced)"), key="off"}\r
                                else\r
-                                       poss[#poss+1]={name="(Doors closed)", key="dcwarn"}\r
+                                       poss[#poss+1]={name=attrans("(Doors closed)"), key="dcwarn"}\r
                                end\r
                        end\r
                        if #poss==0 then\r
@@ -501,8 +501,8 @@ function wagon:on_rightclick(clicker)
                                        end\r
                                end\r
                        end\r
-                       minetest.chat_send_player(pname, "Can't get on: wagon full or doors closed!")\r
-                       minetest.chat_send_player(pname, "Use shift+click to open doors forcefully!")\r
+                       minetest.chat_send_player(pname, attrans("Can't get on: wagon full or doors closed!"))\r
+                       minetest.chat_send_player(pname, attrans("Use shift+click to open doors forcefully!"))\r
                else\r
                        self:show_get_on_form(pname)\r
                end\r
@@ -607,11 +607,12 @@ function wagon:show_wagon_properties(pname)
        local form="size[5,"..(#self.seat_groups*1.5+5).."]"\r
        local at=0\r
        for sgr,sgrdef in pairs(self.seat_groups) do\r
-               form=form.."field[0.5,"..(0.5+at*1.5)..";4,1;sgr_"..sgr..";"..sgrdef.name..";"..(self.seat_access[sgr] or "").."]"\r
+               local text = attrans("Access to @1",sgrdef.name)\r
+               form=form.."field[0.5,"..(0.5+at*1.5)..";4,1;sgr_"..sgr..";"..text..";"..(self.seat_access[sgr] or "").."]"\r
                at=at+1\r
        end\r
-       form=form.."checkbox[0,"..(at*1.5)..";lock_couples;Lock couples;"..(self.lock_couples and "true" or "false").."]"\r
-       form=form.."button_exit[0.5,"..(1+at*1.5)..";4,1;save;Save wagon properties]"\r
+       form=form.."checkbox[0,"..(at*1.5)..";lock_couples;"..attrans("Lock couples")..";"..(self.lock_couples and "true" or "false").."]"\r
+       form=form.."button_exit[0.5,"..(1+at*1.5)..";4,1;save;"..attrans("Save wagon properties").."]"\r
        minetest.show_formspec(pname, "advtrains_prop_"..self.unique_id, form)\r
 end\r
 minetest.register_on_player_receive_fields(function(player, formname, fields)\r
@@ -690,7 +691,7 @@ function wagon:seating_from_key_helper(pname, fields, no)
                self:show_wagon_properties(pname)\r
        end\r
        if fields.dcwarn then\r
-               minetest.chat_send_player(pname, "Doors are closed! Use shift-rightclick to open doors with force and get off!")\r
+               minetest.chat_send_player(pname, attrans("Doors are closed! Use shift-rightclick to open doors with force and get off!"))\r
        end\r
        if fields.off then\r
                self:get_off(no)\r