From 8dc51dbc83308680ddf2a0f3f93630ea1135b835 Mon Sep 17 00:00:00 2001 From: mrSkortch Date: Fri, 20 Mar 2015 17:12:01 -0600 Subject: [PATCH] v43 Minor fixes to getPayload, dynAdd, and dynAddStatic --- mist.lua | 10 +++++----- mistv3_6_42.lua => mistv3_6_43.lua | 10 +++++----- rev changelog.txt | 6 ++++++ 3 files changed, 16 insertions(+), 10 deletions(-) rename mistv3_6_42.lua => mistv3_6_43.lua (99%) diff --git a/mist.lua b/mist.lua index 0489814..8ff35b4 100644 --- a/mist.lua +++ b/mist.lua @@ -8,7 +8,7 @@ mist = {} -- don't change these mist.majorVersion = 3 mist.minorVersion = 6 -mist.build = 42 +mist.build = 43 @@ -530,7 +530,7 @@ do if newObj.x and newObj.y and newObj.type and type(newObj.x) == 'number' and type(newObj.y) == 'number' and type(newObj.type) == 'string' then coalition.addStaticObject(country.id[newCountry], newObj) - return newObj.name + return newObj end return false end @@ -696,7 +696,7 @@ do coalition.addGroup(country.id[newCountry], Unit.Category[newCat], newGroup) - return newGroup.name + return newGroup end @@ -5035,7 +5035,7 @@ mist.getPayload = function(unitIdent) -- refactor to search by groupId and allow groupId and groupName as inputs local unitId = unitIdent if type(unitIdent) == 'string' and not tonumber(unitIdent) then - unitId = mist.DBs.MEunitsById[unitIdent].unitId + unitId = mist.DBs.MEunitsByName[unitIdent].unitId end local gpId = mist.DBs.MEunitsById[unitId].groupId @@ -5048,7 +5048,7 @@ mist.getPayload = function(unitIdent) if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" then -- only these types have points if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group! for group_num, group_data in pairs(obj_type_data.group) do - if group_data and group_data.groupId == groupId then + if group_data and group_data.groupId == gpId then for unitIndex, unitData in pairs(group_data.units) do --group index if unitData.unitId == unitId then return unitData.payload diff --git a/mistv3_6_42.lua b/mistv3_6_43.lua similarity index 99% rename from mistv3_6_42.lua rename to mistv3_6_43.lua index 0489814..8ff35b4 100644 --- a/mistv3_6_42.lua +++ b/mistv3_6_43.lua @@ -8,7 +8,7 @@ mist = {} -- don't change these mist.majorVersion = 3 mist.minorVersion = 6 -mist.build = 42 +mist.build = 43 @@ -530,7 +530,7 @@ do if newObj.x and newObj.y and newObj.type and type(newObj.x) == 'number' and type(newObj.y) == 'number' and type(newObj.type) == 'string' then coalition.addStaticObject(country.id[newCountry], newObj) - return newObj.name + return newObj end return false end @@ -696,7 +696,7 @@ do coalition.addGroup(country.id[newCountry], Unit.Category[newCat], newGroup) - return newGroup.name + return newGroup end @@ -5035,7 +5035,7 @@ mist.getPayload = function(unitIdent) -- refactor to search by groupId and allow groupId and groupName as inputs local unitId = unitIdent if type(unitIdent) == 'string' and not tonumber(unitIdent) then - unitId = mist.DBs.MEunitsById[unitIdent].unitId + unitId = mist.DBs.MEunitsByName[unitIdent].unitId end local gpId = mist.DBs.MEunitsById[unitId].groupId @@ -5048,7 +5048,7 @@ mist.getPayload = function(unitIdent) if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" then -- only these types have points if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group! for group_num, group_data in pairs(obj_type_data.group) do - if group_data and group_data.groupId == groupId then + if group_data and group_data.groupId == gpId then for unitIndex, unitData in pairs(group_data.units) do --group index if unitData.unitId == unitId then return unitData.payload diff --git a/rev changelog.txt b/rev changelog.txt index ebfa7bd..8a6c3a4 100644 --- a/rev changelog.txt +++ b/rev changelog.txt @@ -1,4 +1,8 @@ -- changelog +v43 +-fixed issue with getPayload +-dynAdd and dynAddStatic now return the full new table and not just its name. The name value is still accessible via returned table.name + v42 v3.6 release -added mist.getRandomPointInZone. Function uses mist.getRandomPointInCircle. -fixed bug with altitude switching to radio if baro was specified @@ -12,6 +16,8 @@ getGroupPayload getGroupPoints getGroupRoute +--re added the mist named file + v38 - fixed bug with optional variables for coordinate messages not actually being optional