From be7a843eb20785112c4d24c81ebf72131bec6841 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Tue, 27 Mar 2018 22:16:18 +0200 Subject: [PATCH] Pod shell cheating bug fix --- elevator.lua | 1 - init.lua | 7 +++-- lcd.lua | 1 - seat.lua | 6 ++--- station.lua | 75 +++++++++++++++++++++++++++++++--------------------- 5 files changed, 52 insertions(+), 38 deletions(-) diff --git a/elevator.lua b/elevator.lua index dd14eef..508fbd4 100644 --- a/elevator.lua +++ b/elevator.lua @@ -390,7 +390,6 @@ minetest.register_node("hyperloop:elevator_bottom", { -- due to the missing display, a trip needÅ› 20 sec maximum local seconds = math.min(1 + math.floor(dist/30), 20) floor.busy = true - minetest.forceload_block(dest.pos) door_command(floor.pos, floor.facedir, "close", true) door_command(dest.pos, dest.facedir, "close", true) minetest.after(1.0, on_travel, floor, dest, player, seconds) diff --git a/init.lua b/init.lua index 18af33d..fa017cb 100755 --- a/init.lua +++ b/init.lua @@ -3,9 +3,9 @@ Hyperloop Mod ============= - v0.11 by JoSt + v0.12 by JoSt - Copyright (C) 2017 Joachim Stolberg + Copyright (C) 2017,2018 Joachim Stolberg LGPLv2.1+ See LICENSE.txt for more information @@ -22,6 +22,9 @@ 2017-07-31 v0.09 Some bug fixes on the Bocking Machine 2017-08-01 v0.10 Elevator now with sound and travel animation plus minor bug fixes 2017-08-06 v0.11 Crowbar now allows repairing of illegally detroyed tubes + 2018-03-27 v0.12 Some minor improvements with player position, arrival time, + Wifi node improvements, Podshell cheating bugfix, + forceload_block removed. ]]-- diff --git a/lcd.lua b/lcd.lua index 2ea8a36..291dd6f 100644 --- a/lcd.lua +++ b/lcd.lua @@ -79,7 +79,6 @@ local generate_line = function(s, ypos) file = charmap[s:sub(i, i + 1)] i = i + 2 else - print("[Hyperloop] W: LCD: unknown symbol in '"..s.."' at "..i) i = i + 1 end if file ~= nil then diff --git a/seat.lua b/seat.lua index c714030..86b25ba 100644 --- a/seat.lua +++ b/seat.lua @@ -15,8 +15,6 @@ local function enter_display(tStation, text) -- determine position if tStation ~= nil then local lcd_pos = hyperloop.new_pos(tStation.pos, tStation.facedir, "1F", 2) - -- load map - minetest.forceload_block(lcd_pos) -- update display minetest.registered_nodes["hyperloop:lcd"].update(lcd_pos, text) end @@ -101,7 +99,7 @@ local function display_timer(pos, elapsed) end meta:set_int("arrival_time", atime) local text = meta:get_string("lcd_text") - if atime > 5 then + if atime > 2 then enter_display(tStation, text..atime.." sec") return true else @@ -176,7 +174,7 @@ local function on_start_travel(pos, node, clicker) minetest.get_node_timer(pos):start(1.0) hyperloop.close_pod_door(tDeparture) - atime = atime - 9 -- substract start/arrival time + atime = atime - 7 -- substract start/arrival time minetest.after(4.9, on_travel, tDeparture, tArrival, clicker, atime) end diff --git a/station.lua b/station.lua index 2115e27..12a20bd 100644 --- a/station.lua +++ b/station.lua @@ -62,40 +62,40 @@ local AssemblyPlan = { -- y-offs, x/z-path, facedir-offs, name -- middle slice - { 1, "2F", 0, "hyperloop:pod_wall"}, - { 1, "", 0, "hyperloop:pod_wall"}, - { 1, "", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, - {-1, "", 0, "hyperloop:pod_wall"}, - {-1, "", 0, "hyperloop:pod_wall"}, + { 1, "2F", 0, "hyperloop:pod_wall_ni"}, + { 1, "", 0, "hyperloop:pod_wall_ni"}, + { 1, "", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, + {-1, "", 0, "hyperloop:pod_wall_ni"}, + {-1, "", 0, "hyperloop:pod_wall_ni"}, { 0, "1F", 2, "hyperloop:seat"}, { 1, "1F", 0, "hyperloop:lcd"}, -- right slice - {-1, "1F1R", 0, "hyperloop:pod_wall"}, - { 1, "", 0, "hyperloop:pod_wall"}, - { 1, "", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, - {-1, "", 0, "hyperloop:pod_wall"}, - {-1, "", 0, "hyperloop:pod_wall"}, - { 0, "1F", 0, "hyperloop:pod_wall"}, - { 0, "1F", 0, "hyperloop:pod_wall"}, - { 1, "", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, + {-1, "1F1R", 0, "hyperloop:pod_wall_ni"}, + { 1, "", 0, "hyperloop:pod_wall_ni"}, + { 1, "", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, + {-1, "", 0, "hyperloop:pod_wall_ni"}, + {-1, "", 0, "hyperloop:pod_wall_ni"}, + { 0, "1F", 0, "hyperloop:pod_wall_ni"}, + { 0, "1F", 0, "hyperloop:pod_wall_ni"}, + { 1, "", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, -- left slice - {-1, "2L2R", 0, "hyperloop:pod_wall"}, - { 1, "", 0, "hyperloop:pod_wall"}, - { 1, "", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, - { 0, "1B", 0, "hyperloop:pod_wall"}, - {-1, "", 0, "hyperloop:pod_wall"}, - {-1, "", 0, "hyperloop:pod_wall"}, - { 0, "1F", 0, "hyperloop:pod_wall"}, - { 1, "", 0, "hyperloop:pod_wall"}, + {-1, "2L2R", 0, "hyperloop:pod_wall_ni"}, + { 1, "", 0, "hyperloop:pod_wall_ni"}, + { 1, "", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, + { 0, "1B", 0, "hyperloop:pod_wall_ni"}, + {-1, "", 0, "hyperloop:pod_wall_ni"}, + {-1, "", 0, "hyperloop:pod_wall_ni"}, + { 0, "1F", 0, "hyperloop:pod_wall_ni"}, + { 1, "", 0, "hyperloop:pod_wall_ni"}, { 0, "1F", 1, "hyperloop:doorTopPassive"}, {-1, "", 1, "hyperloop:doorBottom"}, } @@ -456,6 +456,21 @@ minetest.register_node("hyperloop:pod_wall", { sounds = default.node_sound_metal_defaults(), }) +minetest.register_node("hyperloop:pod_wall_ni", { + description = "Hyperloop Pod Shell", + tiles = { + -- up, down, right, left, back, front + "hyperloop_skin2.png", + "hyperloop_skin2.png", + "hyperloop_skin.png", + }, + paramtype2 = "facedir", + groups = {cracky=2, not_in_creative_inventory=1}, + is_ground_content = false, + sounds = default.node_sound_metal_defaults(), + drop = "", +}) + minetest.register_lbm({ label = "[Hyperloop] Station update",