Bugfixes
- Fix crash on map placement - Add temp map texture - Fix player marker on map
This commit is contained in:
parent
26e4377cf9
commit
7bb3b544e2
17
items.lua
17
items.lua
|
@ -16,9 +16,11 @@ local function map_from_meta(meta, player_x, player_y)
|
|||
return id;
|
||||
end
|
||||
|
||||
-- The map item/node
|
||||
minetest.register_node("cartographer:map", {
|
||||
description = "Map",
|
||||
inventory_image = "cartographer_map.png",
|
||||
tiles = { "cartographer_map.png" },
|
||||
drawtype = "signlike",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
|
@ -43,14 +45,19 @@ minetest.register_node("cartographer:map", {
|
|||
return stack;
|
||||
end,
|
||||
|
||||
after_place_node = function(stack, placer, pointed_thing)
|
||||
-- Called when this node is placed in the world. Copies map data from the
|
||||
-- item to the node.
|
||||
-- pos: The position of the node
|
||||
-- placer: The object that placed this node (can be nil)
|
||||
-- stack: The itemstack that was placed
|
||||
-- pointed_thing: The current pointed thing
|
||||
after_place_node = function(pos, placer, stack, pointed_thing)
|
||||
local meta = stack:get_meta():to_table();
|
||||
local s = minetest.item_place(stack, placer, pointed_thing);
|
||||
|
||||
local node_meta = minetest.get_meta(pointed_thing);
|
||||
local node_meta = minetest.get_meta(pos);
|
||||
node_meta:from_table(meta);
|
||||
|
||||
return nil;
|
||||
-- Consume the item after placing
|
||||
return false;
|
||||
end,
|
||||
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
|
|
|
@ -13,7 +13,7 @@ local map_formspec_prefix = [[
|
|||
]];
|
||||
|
||||
local tile = "image[%f,%f;%f,%f;%s]";
|
||||
local marker = "animated_image[%f,%f;%f,%f;%s:%d,%d]";
|
||||
local marker = "animated_image[%f,%f;%f,%f;;%s;%d;%d]";
|
||||
|
||||
local function generate_map(data, x, y, w, h, player_x, player_y, detail, map_scale, is_visible, get_marker, user)
|
||||
local str = "";
|
||||
|
|
BIN
textures/cartographer_map.png
Normal file
BIN
textures/cartographer_map.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
Loading…
Reference in New Issue
Block a user