Skip to content

Commit

Permalink
fix a bug in the beacon logic
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Jan 18, 2024
1 parent f739b0f commit 7821ba6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/beacons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,25 @@ local function beacon_check(reciver)
local beacons = reciver.get_beacons()
if not beacons or not next(beacons) then return end

local effected_frequencies = {}
local effected_am = {}
local effected_fm = {}
for _, beacon in pairs(beacons) do
if our_beacons[beacon.name] then
local am = beacon.name:match('%d+')
local fm = beacon.name:match('%d+$')
if settings.startup['future-beacons'].value then
if effected_frequencies[am] or effected_frequencies[fm] then
if effected_am[am] or effected_fm[fm] then
disable_entity(reciver)
return
end
else
if effected_frequencies[am] and effected_frequencies[fm] then
if effected_am[am] and effected_fm[fm] then
disable_entity(reciver)
return
end
end
effected_frequencies[am] = true
effected_frequencies[fm] = true
effected_am[am] = true
effected_fm[fm] = true
end
end
enable_entity(reciver)
Expand Down

0 comments on commit 7821ba6

Please sign in to comment.