players with travelnet_attach can create networks for others

This commit is contained in:
Sokomine 2016-08-30 02:14:19 +02:00
parent 7e0a810c6a
commit a317132f3b
2 changed files with 6 additions and 5 deletions

@ -48,7 +48,7 @@ minetest.register_node("travelnet:elevator", {
meta:set_string("station_name", "");
meta:set_string("station_network","");
meta:set_string("owner", placer:get_player_name() );
-- request initinal data
-- request initial data
meta:set_string("formspec",
"size[12,10]"..
"field[0.3,5.6;6,0.7;station_name;Name of this station:;]"..

@ -22,6 +22,8 @@
Please configure this mod in config.lua
Changelog:
30.08.16 - Attaching a travelnet box to a non-existant network of another player is possible (requested by OldCoder).
Still requires the travelnet_attach-priv.
05.10.14 - Added an optional abm so that the travelnet network can heal itshelf in case of loss of the savefile.
If you want to use this, set
travelnet.enable_abm = true
@ -325,16 +327,15 @@ travelnet.add_target = function( station_name, network_name, pos, player_name, m
elseif( is_elevator ) then -- elevator networks
owner_name = player_name;
elseif( not( travelnet.targets[ owner_name ] )
or not( travelnet.targets[ owner_name ][ network_name ] )) then
elseif( not( minetest.check_player_privs(player_name, {interact=true}))) then
minetest.chat_send_player(player_name, "There is no network named "..tostring( network_name ).." owned by "..tostring( owner_name )..". Aborting.");
minetest.chat_send_player(player_name, "There is no player with interact privilege named '"..tostring( player_name ).."'. Aborting.");
return;
elseif( not( minetest.check_player_privs(player_name, {travelnet_attach=true}))
and not( travelnet.allow_attach( player_name, owner_name, network_name ))) then
minetest.chat_send_player(player_name, "You do not have the travelnet_attach priv which is required to attach your box to the network of someone else. Aborting.");
minetest.chat_send_player(player_name, "You do not have the travelnet_attach priv which is required to attach your box to the network of someone else. Aborting.");
return;
end