fixed bug with unit speed not getting added to DBs if spawned

added mist.getRandomPointInZone
This commit is contained in:
mrSkortch
2015-03-13 17:19:16 -06:00
parent 822dea7ae7
commit e18778bc7d
6 changed files with 5813 additions and 8 deletions

View File

@@ -7,8 +7,8 @@ mist = {}
-- don't change these
mist.majorVersion = 3
mist.minorVersion = 5
mist.build = 41
mist.minorVersion = 6
mist.build = 42
@@ -160,7 +160,8 @@ do
newTable.units[unitId].point.x = newTable.units[unitId].x
newTable.units[unitId].point.y = newTable.units[unitId].y
newTable.units[unitId].alt = mist.utils.round(unitData:getPosition().p.y)
newTable.units[unitId].speed = mist.vec.mag(unitData:getVelocity())
newTable.units[unitId].heading = mist.getHeading(unitData, true)
newTable.units[unitId].type = unitData:getTypeName()
@@ -3126,7 +3127,7 @@ stopFlag
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
if Group.getByName(groupName) and Group.getByName(groupName):isExist() then
if Group.getByName(groupName) and Group.getByName(groupName):isExist() == true then
if trigger.misc.getUserFlag(flag) == 0 then
trigger.action.setUserFlag(flag, true)
end
@@ -3163,7 +3164,7 @@ mist.flagFunc.group_dead = function(vars)
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
if not Group.getByName(groupName) or Group.getByName(groupName):isExist() == false then
if Group.getByName(groupName) and Group.getByName(groupName):isExist() == false or not Group.getByName(groupName) then
if trigger.misc.getUserFlag(flag) == 0 then
trigger.action.setUserFlag(flag, true)
end
@@ -3201,7 +3202,7 @@ mist.flagFunc.group_alive_less_than = function(vars)
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
if Group.getByName(groupName) and Group.getByName(groupName):isExist() then
if Group.getByName(groupName) and Group.getByName(groupName):isExist() == true then
if Group.getByName(groupName):getSize()/Group.getByName(groupName):getInitialSize() < percent/100 then
if trigger.misc.getUserFlag(flag) == 0 then
trigger.action.setUserFlag(flag, true)
@@ -3245,7 +3246,7 @@ mist.flagFunc.group_alive_more_than = function(vars)
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
if Group.getByName(groupName) and Group.getByName(groupName):isExist() then
if Group.getByName(groupName) and Group.getByName(groupName):isExist() == true then
if Group.getByName(groupName):getSize()/Group.getByName(groupName):getInitialSize() > percent/100 then
if trigger.misc.getUserFlag(flag) == 0 then
trigger.action.setUserFlag(flag, true)
@@ -3720,6 +3721,13 @@ function mist.getRandPointInCircle(point, radius, innerRadius)
return rndCoord
end
mist.getRandomPointInZone = function(zoneName, innerRadius)
if type(zoneName) == 'string' and type(trigger.misc.getZone(zoneName)) == 'table' then
return mist.getRandPointInCircle(trigger.misc.getZone(zoneName).point, trigger.misc.getZone(zoneName).radius, innerRadius)
end
return false
end
mist.groupToRandomPoint = function(vars)
local group = vars.group --Required
local point = vars.point --required
@@ -5217,7 +5225,7 @@ mist.teleportToPoint = function(vars) -- main teleport function that all of tele
return mist.dynAddStatic(newGroupData)
end
--mist.debug.writeData(mist.utils.serialize,{'targets', newGroupData}, 'newGroupData.lua')
return mist.dynAdd(newGroupData)
end