Conflict with Replaced Core Files and TableSaverLoader

bane_

Howardianism High-Priest
Joined
Nov 27, 2013
Messages
1,559
Is there any known conflict in using include() to... er, include... a Lua file in a custom UnitPanel and tables used by TableSaverLoader?


This is the content of file a.lua
gT = gT or {}
gT.WBCTable = gT.WBCTable or {}
WBCTable = gT.WBCTable
tableRoot = WBCTable
tableName = "WBCUtilTables"

This is what I included in UnitPanel:
--WBCiV
gUnitMana = WBCTable.gUnitMana
gUnitMaxMana = WBCTable.gUnitMaxMana
for i = 0, GameDefines.MAX_MAJOR_CIVS -1, 1 do
gUnitMana = {}
gUnitMaxMana = {}
end
--END


If I leave each to it's own corner, it won't find the bolded table (obviously).
So, I wonder, is it possible/good idea to include the a.lua into UnitPanel.lua or, again, is there any known conflict in doing this?
 
You need to use the MapModData method of table-defining in order to share the data across contexts. But I've never used TableSaverLoader that way (nor have I used the MapModData trick for sharing data between contexts when not using TableSaverLoader) so I've no expertise on any quirks etc you may need to look out for.
 
Back
Top Bottom