Skip to content

Commit

Permalink
Merge pull request #143 from pyrrhicPachyderm/duplicate-markers
Browse files Browse the repository at this point in the history
Make grabSpiritMarkers() skip extant markers.
  • Loading branch information
iakona authored Oct 21, 2023
2 parents 43e3c43 + 1e3f1bc commit d41d873
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7875,10 +7875,14 @@ function applySpiritContextMenuItems(spirit)
end

function grabSpiritMarkers()
local hasMarker = {}
for _,obj in pairs(getObjectsWithTag("Spirit Marker")) do
hasMarker[obj.getName()] = true
end
for color,data in pairs(selectedColors) do
if data.zone then
for _, obj in ipairs(data.zone.getObjects()) do
if obj.hasTag("Spirit") then
if obj.hasTag("Spirit") and not hasMarker[obj.getName()] then
spawnSpiritMarker(color, obj)
break
end
Expand Down

0 comments on commit d41d873

Please sign in to comment.