Skip to content

Commit

Permalink
kill all the things we run into, what could possibly go wrong with th…
Browse files Browse the repository at this point in the history
…is....
  • Loading branch information
wsor4035 committed Aug 18, 2023
1 parent 7f62b6c commit d926f47
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mods/fl_trains/engine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ minetest.register_entity("fl_trains:train_engine", {
initial_properties = {
physical = true,
--stepheight = 0.4,
collide_with_objects = true,
--[[ collide_with_objects = true, ]]
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "mesh",
mesh = "farlands_train_engine.obj",
Expand Down Expand Up @@ -94,6 +94,14 @@ minetest.register_entity("fl_trains:train_engine", {
local pos = self.object:get_pos()
local ndir = dir

if moveresult and moveresult.collides then
--minetest.chat_send_all(dump(moveresult.collisions))
for k,v in pairs(moveresult.collisions) do
v.object:set_hp(0, "die")
self.object:set_velocity(v.old_velocity)
end
end

local vel = self.object:get_velocity()
local player
if self.memory.driver then player = minetest.get_player_by_name(self.memory.driver) end
Expand Down

0 comments on commit d926f47

Please sign in to comment.