~gpcf/advtrains

Make the speed at which trains kill users of the Minetest World configurable using the advtrains_kill_speed setting v1 SUPERSEDED

56independent: 1
 Make the speed at which trains kill users of the Minetest World configurable using the advtrains_kill_speed setting

 2 files changed, 4 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~gpcf/advtrains/patches/29780/mbox | git am -3
Learn more about email & git

[PATCH] Make the speed at which trains kill users of the Minetest World configurable using the advtrains_kill_speed setting Export this patch

commit 95a19850334be0eb8ccd9baf8d65c72ccdc6eaf9 (HEAD -> master)
Author: 56independent <56independent@protonmail.com>
Date:   Thu Feb 24 12:33:54 2022 +0000

    Make kill speed configurable

diff --git a/advtrains/settingtypes.txt b/advtrains/settingtypes.txt
index 2b627cb..dd9bda9 100644
--- a/advtrains/settingtypes.txt
+++ b/advtrains/settingtypes.txt
@@ -61,3 +61,6 @@ advtrains_save_interval (Save Interval) int 60 20 3600
#    If enabled, trains only collide with nodes with "normal" drawtype.
advtrains_forgiving_collision (Forgiving Collision mode) bool false

#   Speed trains kill at
#   In n/s
advtrains_kill_speed (Speed in m/s) int 3
\ No newline at end of file
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index 35c3726..72b6026 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -771,7 +771,7 @@ function advtrains.train_step_c(id, train, dtime)
                                               end

                                               --- 8b damage players ---
                                               if is_loaded_area and train.velocity > 3 and (setting_overrun_mode=="drop" or setting_overrun_mode=="normal") then
                                               if is_loaded_area and train.velocity > minetest.settings:get("advtrains_kill_speed") and (setting_overrun_mode=="drop" or setting_overrun_mode=="normal") then
                                                       local testpts = minetest.pos_to_string(testpos)
                                                       local player=advtrains.playersbypts[testpts]
                                                       if player and player:get_hp()>0 and advtrains.is_damage_enabled(player:get_player_name()) then
diff --git a/advtrains_interlocking/demosignals.lua