mirror of
https://gitlab.com/hoggit/developers/hoggit.git
synced 2025-11-10 15:43:28 +00:00
adds group.lua. getLatLongString to utils.
This commit is contained in:
parent
a983d1b2d8
commit
cfe5f10823
@ -3,3 +3,4 @@ dofile(HOGGIT.script_base..[[\HOGGIT\lib\logging.lua]])
|
||||
dofile(HOGGIT.script_base..[[\HOGGIT\lib\utils.lua]])
|
||||
dofile(HOGGIT.script_base..[[\HOGGIT\lib\spawner.lua]])
|
||||
dofile(HOGGIT.script_base..[[\HOGGIT\lib\communication.lua]])
|
||||
dofile(HOGGIT.script_base..[[\HOGGIT\lib\group.lua]])
|
||||
|
||||
8
lib/group.lua
Normal file
8
lib/group.lua
Normal file
@ -0,0 +1,8 @@
|
||||
-- Returns the location of the first unit in a given group.
|
||||
-- If the group is nil, this function returns nil.
|
||||
HOGGIT.groupCoords = function(grp)
|
||||
if grp ~= nil then
|
||||
return grp:getUnits()[1]:getPosition().p
|
||||
end
|
||||
return nil
|
||||
end
|
||||
@ -20,3 +20,9 @@ HOGGIT.listContains = function(list, elem)
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
HOGGIT.getLatLongString = function(pos, decimal)
|
||||
local lat, long = coord.LOtoLL(pos)
|
||||
if decimal == nil then decimal = false end
|
||||
return mist.tostringLL(lat, long, 3, decimal)
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user