1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 18:20:36 +01:00

Updated markers' mod

- Fixed crash whith clients' button
This commit is contained in:
LeMagnesium 2015-03-13 18:33:26 +01:00
parent 2d719aa3ba
commit 1dfc09ee86
2 changed files with 9 additions and 3 deletions

View File

@ -335,6 +335,9 @@ markers.get_marker_formspec = function(player, pos, error_msg)
for i=1,3 do for i=1,3 do
if(not( ((n-i) == opposite ) if(not( ((n-i) == opposite )
or not(markers.positions[ name ][ n-i ] )
or not( coords ) or not( coords[1]) or not( coords[2])
or not(markers.positions[ name ] )
or not(markers.positions[ name ][ n-i ] ) or not(markers.positions[ name ][ n-i ] )
or ( markers.positions[ name ][ n-i ].x == coords[ 1 ].x or ( markers.positions[ name ][ n-i ].x == coords[ 1 ].x
and markers.positions[ name ][ n-i ].z == coords[ 2 ].z ) and markers.positions[ name ][ n-i ].z == coords[ 2 ].z )
@ -349,6 +352,9 @@ markers.get_marker_formspec = function(player, pos, error_msg)
-- save data -- save data
meta:set_string( 'coords', minetest.serialize( coords ) ); meta:set_string( 'coords', minetest.serialize( coords ) );
end end
if( not( coords ) or #coords < 2 or not( coords[1] ) or not( coords[2] )) then
return formspec_info.."Error: The last 4 markers\nyou placed do not form\na rectangle.]";
end
-- the coordinates are set; we may present an input form now -- the coordinates are set; we may present an input form now
@ -571,7 +577,7 @@ minetest.register_node("markers:mark", {
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=2,choppy=2,dig_immediate=3}, groups = {snappy=2,choppy=2,oddly_breakable_by_hand=1}, --fixed on both buttons dig client crash
light_source = 1, light_source = 1,
node_box = { node_box = {
type = "fixed", type = "fixed",

View File

@ -29,7 +29,7 @@ minetest.register_tool( "markers:land_title_register",
local name = placer:get_player_name(); local name = placer:get_player_name();
-- the position is what we're actually looking for -- the position is what we're actually looking for
local pos = minetest.get_pointed_thing_position( pointed_thing, 0 ); --under ); local pos = minetest.get_pointed_thing_position( pointed_thing, false ); -- not above
if( not( pos ) or not( pos.x )) then if( not( pos ) or not( pos.x )) then
minetest.chat_send_player( name, "Position not found."); minetest.chat_send_player( name, "Position not found.");
@ -50,7 +50,7 @@ minetest.register_tool( "markers:land_title_register",
end end
local name = placer:get_player_name(); local name = placer:get_player_name();
local pos = minetest.get_pointed_thing_position( pointed_thing, under ); local pos = minetest.get_pointed_thing_position( pointed_thing, false ); -- not above
if( not( pos ) or not( pos.x )) then if( not( pos ) or not( pos.x )) then
minetest.chat_send_player( name, "Position not found."); minetest.chat_send_player( name, "Position not found.");