Skip to content

Commit

Permalink
Merge pull request #28 from mrSkortch/development
Browse files Browse the repository at this point in the history
4.3 Hotfix-1
  • Loading branch information
mrSkortch committed Jun 1, 2016
2 parents de420ca + 4ff3d57 commit b5c7b16
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 16 deletions.
30 changes: 22 additions & 8 deletions mist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mist = {}
-- don't change these
mist.majorVersion = 4
mist.minorVersion = 3
mist.build = 71
mist.build = 72

-- forward declaration of log shorthand
local log
Expand Down Expand Up @@ -2128,6 +2128,7 @@ do
-- @treturn table @{UnitNameTable}
function mist.makeUnitTable(tbl)
--Assumption: will be passed a table of strings, sequential
log:info(tbl)
local units_by_name = {}

local l_munits = mist.DBs.units --local reference for faster execution
Expand Down Expand Up @@ -4522,7 +4523,9 @@ unitTableDef = table or nil
end

if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
units = mist.makeUnitTable(unitTableDef)
if unitTableDef then
units = mist.makeUnitTable(unitTableDef)
end
end

if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == 0) then
Expand Down Expand Up @@ -4592,9 +4595,11 @@ unitTableDef = table or nil
if not units.processed then
unitTableDef = mist.utils.deepCopy(units)
end

if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
units = mist.makeUnitTable(unitTableDef)
if unitTableDef then
units = mist.makeUnitTable(unitTableDef)
end
end

if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == false) then
Expand Down Expand Up @@ -4666,11 +4671,16 @@ unitTableDef = table or nil
end

if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
units = mist.makeUnitTable(unitTableDef)
if unitTableDef then
units = mist.makeUnitTable(unitTableDef)
end
end

if (zone_units.processed and zone_units.processed < mist.getLastDBUpdateTime()) or not zone_units.processed then -- run unit table short cuts
zone_units = mist.makeUnitTable(zUnitTableDef)
if zUnitTableDef then
zone_units = mist.makeUnitTable(zUnitTableDef)
end

end

if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == false) then
Expand Down Expand Up @@ -4745,11 +4755,15 @@ toggle = boolean or nil
end

if (unitset1.processed and unitset1.processed < mist.getLastDBUpdateTime()) or not unitset1.processed then -- run unit table short cuts
unitset1 = mist.makeUnitTable(unitTableDef1)
if unitTableDef1 then
unitset1 = mist.makeUnitTable(unitTableDef1)
end
end

if (unitset2.processed and unitset2.processed < mist.getLastDBUpdateTime()) or not unitset2.processed then -- run unit table short cuts
unitset2 = mist.makeUnitTable(unitTableDef2)
if unitTableDef2 then
unitset2 = mist.makeUnitTable(unitTableDef2)
end
end


Expand Down
30 changes: 22 additions & 8 deletions mist_4_3_71.lua → mist_4_3_72.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mist = {}
-- don't change these
mist.majorVersion = 4
mist.minorVersion = 3
mist.build = 71
mist.build = 72

-- forward declaration of log shorthand
local log
Expand Down Expand Up @@ -2128,6 +2128,7 @@ do
-- @treturn table @{UnitNameTable}
function mist.makeUnitTable(tbl)
--Assumption: will be passed a table of strings, sequential
log:info(tbl)
local units_by_name = {}

local l_munits = mist.DBs.units --local reference for faster execution
Expand Down Expand Up @@ -4522,7 +4523,9 @@ unitTableDef = table or nil
end

if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
units = mist.makeUnitTable(unitTableDef)
if unitTableDef then
units = mist.makeUnitTable(unitTableDef)
end
end

if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == 0) then
Expand Down Expand Up @@ -4592,9 +4595,11 @@ unitTableDef = table or nil
if not units.processed then
unitTableDef = mist.utils.deepCopy(units)
end

if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
units = mist.makeUnitTable(unitTableDef)
if unitTableDef then
units = mist.makeUnitTable(unitTableDef)
end
end

if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == false) then
Expand Down Expand Up @@ -4666,11 +4671,16 @@ unitTableDef = table or nil
end

if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
units = mist.makeUnitTable(unitTableDef)
if unitTableDef then
units = mist.makeUnitTable(unitTableDef)
end
end

if (zone_units.processed and zone_units.processed < mist.getLastDBUpdateTime()) or not zone_units.processed then -- run unit table short cuts
zone_units = mist.makeUnitTable(zUnitTableDef)
if zUnitTableDef then
zone_units = mist.makeUnitTable(zUnitTableDef)
end

end

if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == false) then
Expand Down Expand Up @@ -4745,11 +4755,15 @@ toggle = boolean or nil
end

if (unitset1.processed and unitset1.processed < mist.getLastDBUpdateTime()) or not unitset1.processed then -- run unit table short cuts
unitset1 = mist.makeUnitTable(unitTableDef1)
if unitTableDef1 then
unitset1 = mist.makeUnitTable(unitTableDef1)
end
end

if (unitset2.processed and unitset2.processed < mist.getLastDBUpdateTime()) or not unitset2.processed then -- run unit table short cuts
unitset2 = mist.makeUnitTable(unitTableDef2)
if unitTableDef2 then
unitset2 = mist.makeUnitTable(unitTableDef2)
end
end


Expand Down
25 changes: 25 additions & 0 deletions rev changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
v72
fixed bug with flagFuncs to correctly check and assign unitTableDef entries.

v71
added shapename DB entry
dynAddStatic will now add a shapename if the object type matches a shapename DB entry

v70
Added assorted error checking on a few functions
v69
- Updated mission used to create DBs. There should no longer be any unit
names that are the same as group names.

Dynamically generated names will now be indexed accordingly to their
category. Used to be just a single counter shared between all.

Several changes and fixes to dynAddStatic
-Fixed function wasn't working when given certain params.
-fixed country checker to better account for country names with spaces.
This fix was applied to dynAdd but not dynAddStatic, I corrected this.
-Optimized it slightly. Trimmed the fat of some of the code.

v68
-DB refactor-start

v66
-Added default setting for logger if no value present
-Added documentation for logger
Expand Down

0 comments on commit b5c7b16

Please sign in to comment.