Module:Sandbox/Skills/Cartography: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 291: Line 291:
function p.hex(frame)
function p.hex(frame)
-- Default behavior, when no coords supplied
-- Default behavior, when no coords supplied
if frame.args == nil then
if (frame == nil or frame.args == nil) then
return 'Hex'
return 'Hex'
end
end
local X = tonumber(frame.args['x'])
local X = tonumber(frame.args['x'])
local Y = tonumber(frame.args['y'])
local Y = tonumber(frame.args['y'])
if X == nil or Y == nil then
return '<invalid XY format>'
end
local hex = p.getPointOfInterestByXY(X, Y)
local hex = p.getPointOfInterestByXY(X, Y)
-- nil means coord is invalid
-- nil means coord is invalid
432

edits