diff options
author | RealBadAngel <mk@realbadangel.pl> | 2013-07-17 20:28:42 +0200 |
---|---|---|
committer | RealBadAngel <mk@realbadangel.pl> | 2013-07-17 20:28:42 +0200 |
commit | 79858dca5e5c5293ffa3b3ba050ed94293cc0e27 (patch) | |
tree | ba4f6f310d9cc8e69fec9a34b36d20ff0a040cbe /stargate/gate_defs.lua | |
parent | 2ef1bb7e46a81ad759e03949c17abedec7445b2d (diff) |
- Fix teleportation: now it teleports player to side of the gate player was lookin at when placing.
- Teleportation handles now player look yaw.
- Fix to a bug in gates formspec.
Diffstat (limited to 'stargate/gate_defs.lua')
-rw-r--r-- | stargate/gate_defs.lua | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/stargate/gate_defs.lua b/stargate/gate_defs.lua index caca8ca..374a055 100644 --- a/stargate/gate_defs.lua +++ b/stargate/gate_defs.lua @@ -500,16 +500,23 @@ minetest.register_abm({ end if player_name~=owner and gate["type"]=="private" then return end local dir1=gate["destination_dir"] + local dest_angle if dir1 == 0 then - pos1.z=pos1.z+2 + pos1.z = pos1.z-2 + dest_angle = 180 elseif dir1 == 1 then - pos1.x=pos1.x+2 + pos1.x = pos1.x-2 + dest_angle = 90 elseif dir1 == 2 then - pos1.z=pos1.z-2 + pos1.z=pos1.z+2 + dest_angle = 0 elseif dir1 == 3 then - pos1.x=pos1.x-2 + pos1.x = pos1.x+2 + dest_angle = -90 end + print(dump(dir1)) object:moveto(pos1,false) + object:set_look_yaw(math.rad(dest_angle)) minetest.sound_play("enterEventHorizon", {pos = pos, gain = 1.0,loop = false, max_hear_distance = 72,}) end end |