ProjectEQ / projecteqquests

Quest scripts for ProjectEQ
http://projecteq.net
44 stars 78 forks source link

Duplicate Index in potimeb #1369

Closed xackery closed 1 year ago

xackery commented 1 year ago

https://github.com/ProjectEQ/projecteqquests/blob/f678149a12f6b6efbe3c44cbfe06e68c01b3fbfc/potimeb/zone_status.lua#L118

Duplicate index 999999.

Screen Shot 2023-01-21 at 9 35 31 AM
Voidless22 commented 1 year ago

It seems every lockout except for the phases is applied via the AddLockout(lockout)function which has a little bit more going on than just expedition:AddLockout. The thing I observed is that although the phases aren't using the AddLockout function, they're just usingexpedition:AddLockout(lockout, duration). The thing that has me confused though, is that in event_signal:

if (Lockouts[e.signal] ~= nil ) then -- Add Lockouts to Expedition
        AddLockout(Lockouts[e.signal]);
    end

This is being called at the very top, meaning that the manual AddLockouts for the phases aren't necessary, but seemingly a patch to not having the IDs for the phase lockouts. I think the best solution would be to simply remove those entries in the table and leave the manual lockout adds as is. This is the AddLockout function that isn't from expedition, and one of the phase lines after.


function AddLockout(lockout)
    local lockout_name = lockout[1];
    local lockout_duration = lockout[2];

    local expedition = eq.get_expedition()
    if expedition.valid then
        -- this should add the lockout to:
        -- 1) the expedition internally, so anyone that gets added after and zones in will receive it
        -- 2) all current members of the expedition, even if they're in another zone
        -- 3) all clients currently inside the dz instance in case members were removed but haven't been teleported out yet
        expedition:AddLockout(lockout_name, lockout_duration)
    end
end

expedition:AddLockout('Phase 1 Complete', 43200);

Please correct me if any of this is wrong, 99% of my lua experience comes from MQ and I'm relatively new to the community =)

fryguy503 commented 1 year ago

Correct,

This causes no issues what so ever, but when I was writing it, I used 999999 as a placeholder. But since those lockouts were being added from the same entity, rather than sending a signal to itself I just added it directly.

Overall this is just a note of auditing be doesn't affect functionality

fryguy503 commented 1 year ago

Updated the values to prevent the linter from throwing soft errors.