EC: Stop the Organizer from running forever if none of its items are found

The EC has a bug where the Organizer will run forever if none of the items in the currently selected Organizer are found in the container being organized.  This can cause the backpack to not update later. The following code addition below will fix that.

To the function ContainerWindow.UpdatePickupTimer in the file source\ContainerWindow.lua add the following code
--start of added code
else
ContainerWindow.Organize = false
if Organizer.Organizers_CloseCont[Organizer.ActiveOrganizer] then
if DoesWindowNameExist( "ContainerWindow_" .. ContainerWindow.OrganizeParent ) then
DestroyWindow("ContainerWindow_" .. ContainerWindow.OrganizeParent)
end
end
--end of added code
end
end


if ContainerWindow.Restock and ContainerWindow.CanPickUp then

Comments

  • Good change.  Have you looked at the infinite loop on "That container cannot hold more weight." ?  I'll check that out later if you haven't.
  • TimStTimSt Posts: 1,874
    Found an issue with my fix above when the server is slow.  The new code will be

    --start of added code
    elseif (moveObjects and #moveObjects == 0) then
    ContainerWindow.Organize = false
    if Organizer.Organizers_CloseCont[Organizer.ActiveOrganizer] then
    if DoesWindowNameExist( "ContainerWindow_" .. ContainerWindow.OrganizeParent ) then
    DestroyWindow("ContainerWindow_" .. ContainerWindow.OrganizeParent)
    end
    end
    --end of added code

    All that changed was the else became an elseif.

    The reason is above my code is the line "if moveObjects and #moveObjects > 0 and ContainerWindow.CanPickUp then".  If any of those was false my previous fix would be triggered.  When the server is slow ContainerWindow.CanPickUp is set to false which caused my fix to cancel the organizer prematurely.

Sign In or Register to comment.