mirror of
https://github.com/Sokomine/travelnet.git
synced 2024-11-30 19:23:44 +01:00
yaw is no longer set if the server is not newest dev; fancy beam effect disabled by default
This commit is contained in:
parent
97bf5cd2cd
commit
29b6a02fca
17
init.lua
17
init.lua
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
22.03.13 - added automatic detection if yaw can be set
|
||||||
|
- beam effect is disabled by default
|
||||||
20.03.13 - added inventory image provided by VanessaE
|
20.03.13 - added inventory image provided by VanessaE
|
||||||
- fixed bug that made it impossible to remove stations from the net
|
- fixed bug that made it impossible to remove stations from the net
|
||||||
- if the station a player beamed to no longer exists, the station will be removed automaticly
|
- if the station a player beamed to no longer exists, the station will be removed automaticly
|
||||||
@ -35,6 +37,9 @@ travelnet = {};
|
|||||||
|
|
||||||
travelnet.targets = {};
|
travelnet.targets = {};
|
||||||
|
|
||||||
|
-- set this to true if you want a simulated beam effect
|
||||||
|
travelnet_effect_enabled = false;
|
||||||
|
travelnet_sound_enabled = false;
|
||||||
|
|
||||||
-- TODO: save and restore ought to be library functions and not implemented in each individual mod!
|
-- TODO: save and restore ought to be library functions and not implemented in each individual mod!
|
||||||
-- called whenever a station is added or removed
|
-- called whenever a station is added or removed
|
||||||
@ -331,15 +336,23 @@ travelnet.on_receive_fields = function(pos, formname, fields, player)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if( travelnet_sound_enabled ) then
|
||||||
minetest.sound_play("128590_7037-lq.mp3", {pos = pos, gain = 1.0, max_hear_distance = 10,})
|
minetest.sound_play("128590_7037-lq.mp3", {pos = pos, gain = 1.0, max_hear_distance = 10,})
|
||||||
|
end
|
||||||
|
if( travelnet_effect_enabled ) then
|
||||||
minetest.env:add_entity( {x=pos.x,y=pos.y+0.5,z=pos.z}, "travelnet:effect"); -- it self-destructs after 20 turns
|
minetest.env:add_entity( {x=pos.x,y=pos.y+0.5,z=pos.z}, "travelnet:effect"); -- it self-destructs after 20 turns
|
||||||
|
end
|
||||||
|
|
||||||
-- transport the player to the target location
|
-- transport the player to the target location
|
||||||
local target_pos = travelnet.targets[ owner_name ][ station_network ][ fields.target ].pos;
|
local target_pos = travelnet.targets[ owner_name ][ station_network ][ fields.target ].pos;
|
||||||
player:moveto( target_pos, false);
|
player:moveto( target_pos, false);
|
||||||
|
|
||||||
|
if( travelnet_sound_enabled ) then
|
||||||
minetest.sound_play("travelnet_travel.wav", {pos = target_pos, gain = 1.0, max_hear_distance = 10,})
|
minetest.sound_play("travelnet_travel.wav", {pos = target_pos, gain = 1.0, max_hear_distance = 10,})
|
||||||
|
end
|
||||||
|
if( travelnet_effect_enabled ) then
|
||||||
minetest.env:add_entity( {x=target_pos.x,y=target_pos.y+0.5,z=target_pos.z}, "travelnet:effect"); -- it self-destructs after 20 turns
|
minetest.env:add_entity( {x=target_pos.x,y=target_pos.y+0.5,z=target_pos.z}, "travelnet:effect"); -- it self-destructs after 20 turns
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- check if the box has at the other end has been removed
|
-- check if the box has at the other end has been removed
|
||||||
@ -352,7 +365,9 @@ travelnet.on_receive_fields = function(pos, formname, fields, player)
|
|||||||
station_network = station_network }};
|
station_network = station_network }};
|
||||||
|
|
||||||
travelnet.remove_box( target_pos, nil, oldmetadata, player );
|
travelnet.remove_box( target_pos, nil, oldmetadata, player );
|
||||||
else
|
|
||||||
|
-- do this only on servers where the function exists
|
||||||
|
elseif( player.set_look_yaw ) then
|
||||||
|
|
||||||
-- rotate the player so that he/she can walk straight out of the box
|
-- rotate the player so that he/she can walk straight out of the box
|
||||||
local yaw = 0;
|
local yaw = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user