diff --git a/worldeditadditions_core/core/pos_marker_manage.lua b/worldeditadditions_core/core/pos_marker_manage.lua index 61f6589..baf59a4 100644 --- a/worldeditadditions_core/core/pos_marker_manage.lua +++ b/worldeditadditions_core/core/pos_marker_manage.lua @@ -51,4 +51,14 @@ wea_c.pos:addEventListener("set", function(event) end do_create(event) -- This works because the event obj for push and set is identical +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) \ No newline at end of file