mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-25 16:43:05 +00:00
pos_marker_manage: listen on clear event
This commit is contained in:
parent
9910bfad44
commit
e2e235ce6d
1 changed files with 10 additions and 0 deletions
|
@ -52,3 +52,13 @@ wea_c.pos:addEventListener("set", function(event)
|
||||||
|
|
||||||
do_create(event) -- This works because the event obj for push and set is identical
|
do_create(event) -- This works because the event obj for push and set is identical
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
wea_c.pos:addEventListener("clear", function(event)
|
||||||
|
ensure_player(event.player_name)
|
||||||
|
if #position_entities[event.player_name] > 0 then
|
||||||
|
for _, entity in pairs(position_entities[event.player_name]) do
|
||||||
|
wea_c.entities.pos_marker.delete(entity)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
position_entities[event.player_name] = nil
|
||||||
|
end)
|
Loading…
Reference in a new issue