Skip to content

Commit

Permalink
Fix for routes not being automated in some cases
Browse files Browse the repository at this point in the history
Fixes #13
  • Loading branch information
astog committed Feb 26, 2017
1 parent 2fd0072 commit d05dc27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions UI/TradeSupport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ local function TradeSupportTracker_OnUnitOperationsCleared(ownerID:number, unitI
if pUnit ~= nil then
local unitInfo:table = GameInfo.Units[pUnit:GetUnitType()];
if unitInfo ~= nil and unitInfo.MakeTradeRoute then
LoadTraderAutomatedInfo();

-- Remove entry from local players running routes
for i, route in ipairs(m_LocalPlayerRunningRoutes) do
if route.TraderUnitID == unitID then
Expand Down Expand Up @@ -264,6 +266,8 @@ end
-- ===========================================================================

function AutomateTrader(traderID:number, isAutomated:boolean, sortSettings:table)
LoadTraderAutomatedInfo();

if m_TradersAutomatedSettings[traderID] == nil then
m_TradersAutomatedSettings[traderID] = {}
end
Expand Down

0 comments on commit d05dc27

Please sign in to comment.