xponen

move jelly checking outside

Nov 28th, 2012
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. function gadget:GameFrame(f)
  2.    
  3.     for i = 1, teleID.count do
  4.         local tid = teleID.data[i]
  5.         local bid = tele[tid].link 
  6.         if bid and tele[tid].deployed then
  7.        
  8.             --Spring.Echo("activated teleporter!")
  9.             --checking for flyers
  10.             --Spring.Echo(f)
  11.             local xxx,yyy,zzz = Spring.GetUnitPosition(tid)
  12.             local maybeFlyers = Spring.GetUnitsInSphere(xxx,yyy,zzz,200,Spring.GetUnitTeam(tid))
  13.             if(maybeFlyers ~= nil) then
  14.                 for index,value in pairs(maybeFlyers) do
  15.                     local ud = Spring.GetUnitDefID(value)
  16.                     ud = ud and UnitDefs[ud]
  17.                     if ((not (ud.floater or ud.canFly or value==tid)) and isUnitAirborne(value)) then
  18.                         capUnitSpeed(value,2,1)
  19.                         --Spring.Echo("capping unit speed")
  20.                         --backup the damn queue
  21.                         backUpTheDamnQueue(value)
  22.                     end
  23.                 end
  24.             end
  25.         end
  26.     end
  27.    
  28.    
  29.     for i = 1, teleID.count do
  30.         local tid = teleID.data[i]  
  31.         local bid = tele[tid].link
Advertisement
Add Comment
Please, Sign In to add comment