diff options
author | orwell96 <orwell@bleipb.de> | 2021-04-25 21:53:41 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2021-04-25 21:54:51 +0200 |
commit | 112e3ff2555f1380a5125a9b09ef0a7fc81b053a (patch) | |
tree | 40a757346fa5ac19dc10e3ccf27cfc9b6da131dd /advtrains/tracks.lua | |
parent | e04c21be78f6c915537f7dc8fdbf8110d7eadcd0 (diff) | |
download | advtrains-112e3ff2555f1380a5125a9b09ef0a7fc81b053a.tar.gz advtrains-112e3ff2555f1380a5125a9b09ef0a7fc81b053a.tar.bz2 advtrains-112e3ff2555f1380a5125a9b09ef0a7fc81b053a.zip |
Fix undeclared globals warnings (#176)
Reported by Vanessa Dannenberg
Diffstat (limited to 'advtrains/tracks.lua')
-rw-r--r-- | advtrains/tracks.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua index 33a7999..261818e 100644 --- a/advtrains/tracks.lua +++ b/advtrains/tracks.lua @@ -524,7 +524,7 @@ function advtrains.register_tracks(tracktype, def, preset) end ndef.on_rightclick = function(pos, node, player) if advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then - advtrains.setstate(pos, newstate, node) + advtrains.setstate(pos, nil, node) advtrains.log("Switch", player:get_player_name(), pos) end end @@ -667,7 +667,7 @@ function sl.create_slopeplacer_on_place(def, preset) local yaw=player.get_look_horizontal and player:get_look_horizontal() or (player:get_look_yaw() - math.pi/2) --rounding unit vectors is a nice way for selecting 1 of 8 directions since sin(30°) is 0.5. - dirvec={x=math.floor(math.sin(-yaw)+0.5), y=0, z=math.floor(math.cos(-yaw)+0.5)} + local dirvec={x=math.floor(math.sin(-yaw)+0.5), y=0, z=math.floor(math.cos(-yaw)+0.5)} --translate to direction to look up inside the preset table local param2, rot45=({ [-1]={ |