From a92b405efd5cadb9e2b0e9a9a15a4540c4bef042 Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 2 Jul 2022 00:27:09 +0200 Subject: [PATCH] Comment out unused cart-checking hackery --- mods/MAPGEN/tsm_railcorridors/gameconfig.lua | 8 ++++++++ mods/MAPGEN/tsm_railcorridors/init.lua | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/mods/MAPGEN/tsm_railcorridors/gameconfig.lua b/mods/MAPGEN/tsm_railcorridors/gameconfig.lua index de4b181199..3ada3052ff 100644 --- a/mods/MAPGEN/tsm_railcorridors/gameconfig.lua +++ b/mods/MAPGEN/tsm_railcorridors/gameconfig.lua @@ -42,6 +42,14 @@ tsm_railcorridors.carts = { "mcl_minecarts:minecart" } function tsm_railcorridors.on_construct_cart(pos, cart) -- TODO: Fill cart with treasures + + -- This is it? There's this giant hack announced in + -- the other file and I grep for the function and it's + -- a stub? :) + + -- The path here using some minetest.after hackery was + -- deactivated in init.lua - reactivate when this does + -- something the function is called RecheckCartHack. end -- Fallback function. Returns a random treasure. This function is called for chests diff --git a/mods/MAPGEN/tsm_railcorridors/init.lua b/mods/MAPGEN/tsm_railcorridors/init.lua index 75abe5c286..8bb0d7253f 100644 --- a/mods/MAPGEN/tsm_railcorridors/init.lua +++ b/mods/MAPGEN/tsm_railcorridors/init.lua @@ -388,11 +388,16 @@ local function PlaceChest(pos, param2) end end + -- This function checks if a cart has ACTUALLY been spawned. -- To be calld by minetest.after. -- This is a workaround thanks to the fact that minetest.add_entity is unreliable as fuck -- See: https://github.com/minetest/minetest/issues/4759 -- FIXME: Kill this horrible hack with fire as soon you can. + +-- Why did anyone activate it in the first place? It doesn't +-- have a function seeing as there are no chest minecarts yet. +--[[ local function RecheckCartHack(params) local pos = params[1] local cart_id = params[2] @@ -408,6 +413,8 @@ local function RecheckCartHack(params) end minetest.log("info", "[tsm_railcorridors] Cart spawn FAILED: "..minetest.pos_to_string(pos)) end +--]] + -- Try to place a cobweb. -- pos: Position of cobweb @@ -937,7 +944,10 @@ local function spawn_carts() -- Note that the callback function is also called there. -- TODO: Move callback function to this position when the -- minetest.add_entity bug has been fixed. - minetest.after(3, RecheckCartHack, {cpos, cart_id}) + + -- minetest.after(3, RecheckCartHack, {cpos, cart_id}) + -- This whole recheck logic leads to a stub right now + -- it can be reenabled when chest carts are a thing. end end carts_table = {}