-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/Evaluators/GetDistanceToNearestSpaceField.lua#1 $ --///////////////////////////////////////////////////////////////////////////////////////////////// -- -- (C) Petroglyph Games, Inc. -- -- -- ***** ** * * -- * ** * * * -- * * * * * -- * * * * * * * * -- * * *** ****** * ** **** *** * * * ***** * *** -- * ** * * * ** * ** ** * * * * ** ** ** * -- *** ***** * * * * * * * * ** * * * * -- * * * * * * * * * * * * * * * -- * * * * * * * * * * ** * * * * -- * ** * * ** * ** * * ** * * * * -- ** **** ** * **** ***** * ** *** * * -- * * * -- * * * -- * * * -- * * * * -- **** * * -- --///////////////////////////////////////////////////////////////////////////////////////////////// -- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E --///////////////////////////////////////////////////////////////////////////////////////////////// -- -- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/Evaluators/GetDistanceToNearestSpaceField.lua $ -- -- Original Author: Steve_Copeland -- -- $Author: Brian_Hayes $ -- -- $Change: 637819 $ -- -- $DateTime: 2017/03/22 10:16:16 $ -- -- $Revision: #1 $ -- --///////////////////////////////////////////////////////////////////////////////////////////////// require("PGBaseDefinitions") function Clean_Up() -- any temporary object pointers need to be set to nil in this function. -- ie: Target = nil nearest_obj = nil end -- Receives: -- String which is a space field category mask for the space fields to consider function Evaluate(space_fields) nearest_obj = Find_Nearest_Space_Field(Target, space_fields) if TestValid(nearest_obj) then return Target.Get_Distance(nearest_obj) else return BIG_FLOAT end end