aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--advtrains/advtrains/damage.lua4
-rw-r--r--advtrains/advtrains/wagons.lua10
-rw-r--r--advtrains/advtrains_train_subway/init.lua3
3 files changed, 14 insertions, 3 deletions
diff --git a/advtrains/advtrains/damage.lua b/advtrains/advtrains/damage.lua
index b39fe67..e05d00d 100644
--- a/advtrains/advtrains/damage.lua
+++ b/advtrains/advtrains/damage.lua
@@ -15,7 +15,9 @@ minetest.register_globalstep(function(dtime)
if le and le.is_wagon and le.initialized and le:train() then
if (not advtrains.player_to_train_mapping[player:get_player_name()] or le.train_id~=advtrains.player_to_train_mapping[player:get_player_name()]) and math.abs(le:train().velocity)>2 then
--player:punch(object, 1000, {damage={fleshy=3*math.abs(le:train().velocity)}})
- player:set_hp(player:get_hp()-math.abs(le:train().velocity)-3)
+ player:set_hp(player:get_hp()-math.abs(le:train().velocity)-3)
+ elseif (not advtrains.player_to_train_mapping[player:get_player_name()] or le.train_id~=advtrains.player_to_train_mapping[player:get_player_name()]) and le:train().door_open~=0 then
+ le:on_rightclick(player)
end
end
end
diff --git a/advtrains/advtrains/wagons.lua b/advtrains/advtrains/wagons.lua
index c5ce6bf..3efa6b8 100644
--- a/advtrains/advtrains/wagons.lua
+++ b/advtrains/advtrains/wagons.lua
@@ -257,6 +257,14 @@ function wagon:on_step(dtime)
advtrains.update_driver_hud(driver:get_player_name(), self:train(), self.wagon_flipped)
end
end
+ else
+ local pass = self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno])
+ if pass and self:train().door_open~=0 then
+ local pc=pass:get_player_control()
+ if pc.up or pc.down then
+ self:get_off(seatno)
+ end
+ end
end
end
@@ -746,7 +754,7 @@ function advtrains.register_wagon(sysname, prototype, desc, inv_img)
return
end
-
+
local node=minetest.get_node_or_nil(pointed_thing.under)
if not node then atprint("[advtrains]Ignore at placer position") return itemstack end
local nodename=node.name
diff --git a/advtrains/advtrains_train_subway/init.lua b/advtrains/advtrains_train_subway/init.lua
index 5625418..faf8ceb 100644
--- a/advtrains/advtrains_train_subway/init.lua
+++ b/advtrains/advtrains_train_subway/init.lua
@@ -55,7 +55,7 @@ advtrains.register_wagon("subway_wagon", {
require_doors_open=true,
},
},
- assign_to_seat_group = {"dstand", "pass"},
+ assign_to_seat_group = {"pass","dstand"},
doors={
open={
[-1]={frames={x=0, y=20}, time=1},
@@ -68,6 +68,7 @@ advtrains.register_wagon("subway_wagon", {
},
visual_size = {x=1, y=1},
wagon_span=2,
+ --collisionbox = {-1.0,-0.5,-1.8, 1.0,2.5,1.8},
collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
is_locomotive=true,
drops={"default:steelblock 4"},