aboutsummaryrefslogtreecommitdiff
path: root/advtrains/couple.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2020-04-27 16:02:28 +0200
committerorwell96 <orwell@bleipb.de>2021-02-10 16:36:24 +0100
commit5c2534cc35bc0fc47b53c8a992e3e71b15a60ec4 (patch)
tree5c72e9e541401126d5416b6d122893c300b88bea /advtrains/couple.lua
parentb59b0d587d72f78c5923aa501038b93269bba271 (diff)
downloadadvtrains-5c2534cc35bc0fc47b53c8a992e3e71b15a60ec4.tar.gz
advtrains-5c2534cc35bc0fc47b53c8a992e3e71b15a60ec4.tar.bz2
advtrains-5c2534cc35bc0fc47b53c8a992e3e71b15a60ec4.zip
Remove pcall wrappers completely, add command to disable advtrains mainloop
Diffstat (limited to 'advtrains/couple.lua')
-rw-r--r--advtrains/couple.lua14
1 files changed, 0 insertions, 14 deletions
diff --git a/advtrains/couple.lua b/advtrains/couple.lua
index 76fa447..1e16690 100644
--- a/advtrains/couple.lua
+++ b/advtrains/couple.lua
@@ -32,7 +32,6 @@ minetest.register_entity("advtrains:discouple", {
end,
get_staticdata=function() return "DISCOUPLE" end,
on_punch=function(self, player)
- return advtrains.pcall(function()
local pname = player:get_player_name()
if pname and pname~="" and self.wagon then
if advtrains.safe_decouple_wagon(self.wagon.id, pname) then
@@ -41,10 +40,8 @@ minetest.register_entity("advtrains:discouple", {
minetest.add_entity(self.object:getpos(), "advtrains:lockmarker")
end
end
- end)
end,
on_step=function(self, dtime)
- return advtrains.pcall(function()
if not self.wagon then
self.object:remove()
return
@@ -58,7 +55,6 @@ minetest.register_entity("advtrains:discouple", {
self.object:remove()
return
end
- end)
end,
})
@@ -79,7 +75,6 @@ minetest.register_entity("advtrains:couple", {
is_couple=true,
static_save = false,
on_activate=function(self, staticdata)
- return advtrains.pcall(function()
if staticdata=="COUPLE" then
--couple entities have no right to exist further...
atprint("Couple loaded from staticdata, destroying")
@@ -87,11 +82,9 @@ minetest.register_entity("advtrains:couple", {
return
end
self.object:set_armor_groups({immmortal=1})
- end)
end,
get_staticdata=function(self) return "COUPLE" end,
on_rightclick=function(self, clicker)
- return advtrains.pcall(function()
if not self.train_id_1 or not self.train_id_2 then return end
local pname=clicker
@@ -102,15 +95,12 @@ minetest.register_entity("advtrains:couple", {
else
lockmarker(self.object)
end
- end)
end,
on_step=function(self, dtime)
- return advtrains.pcall(function()
if advtrains.wagon_outside_range(self.object:getpos()) then
self.object:remove()
return
end
- advtrains.atprint_context_tid=self.train_id_1
if not self.train_id_1 or not self.train_id_2 then atprint("Couple: train ids not set!") self.object:remove() return end
local train1=advtrains.trains[self.train_id_1]
@@ -161,8 +151,6 @@ minetest.register_entity("advtrains:couple", {
end
atprintbm("couple step", t)
advtrains.atprint_context_tid=nil
-
- end)
end,
})
minetest.register_entity("advtrains:lockmarker", {
@@ -175,7 +163,6 @@ minetest.register_entity("advtrains:lockmarker", {
is_lockmarker=true,
static_save = false,
on_activate=function(self, staticdata)
- return advtrains.pcall(function()
if staticdata=="COUPLE" then
--couple entities have no right to exist further...
atprint("Couple loaded from staticdata, destroying")
@@ -184,7 +171,6 @@ minetest.register_entity("advtrains:lockmarker", {
end
self.object:set_armor_groups({immmortal=1})
self.life=5
- end)
end,
get_staticdata=function(self) return "COUPLE" end,
on_step=function(self, dtime)