diff options
author | orwell96 <orwell@bleipb.de> | 2017-01-02 13:55:25 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2017-01-02 13:55:25 +0100 |
commit | 2a924d086a2bce6ce4030c81175d6f214d3be5d1 (patch) | |
tree | b358994227dbfd0f3849bb909a629dba47095d76 /advtrains/couple.lua | |
parent | 8784ee41ddac2959c4a2aca6dd1a5e7570ad741b (diff) | |
download | advtrains-2a924d086a2bce6ce4030c81175d6f214d3be5d1.tar.gz advtrains-2a924d086a2bce6ce4030c81175d6f214d3be5d1.tar.bz2 advtrains-2a924d086a2bce6ce4030c81175d6f214d3be5d1.zip |
fix discouple not disappearing and a logical mistake with owners
Diffstat (limited to 'advtrains/couple.lua')
-rw-r--r-- | advtrains/couple.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/advtrains/couple.lua b/advtrains/couple.lua index 1cfe29c..974f450 100644 --- a/advtrains/couple.lua +++ b/advtrains/couple.lua @@ -31,7 +31,7 @@ minetest.register_entity("advtrains:discouple", { on_punch=function(self, player) --only if player owns at least one wagon next to this local own=player:get_player_name() - if self.wagon.owner and self.wagon.owner~=own then + if self.wagon.owner and self.wagon.owner==own then local train=advtrains.trains[self.wagon.train_id] local nextwgn_id=train.trainparts[self.wagon.pos_in_trainparts-1] for aoi, le in pairs(minetest.luaentities) do @@ -44,8 +44,11 @@ minetest.register_entity("advtrains:discouple", { end end end + advtrains.split_train_at_wagon(self.wagon)--found in trainlogic.lua + self.object:remove() + else + minetest.chat_send_player(own, "You need to own at least one neighboring wagon to destroy this couple.") end - advtrains.split_train_at_wagon(self.wagon)--found in trainlogic.lua end, on_step=function(self, dtime) local t=os.clock() |