-- Star Wars Empire at War: Secrets of a Fallen Empire
-- Lua Script: //Scripts/GameObject/ObjectScript_DespawnHealer.lua
-- Author: Galyana
-- Updated: 6 February, 2026

-- Used to despawn the repair satellite self repair object that is spawned via Objectscript_SpawnHealer.lua
-- The object is classed as an asteroid for easy finding

require("PGStateMachine")
require("PGSpawnUnits")

function Definitions()
	Define_State("State_Init", State_Init)
end

function State_Init(message)
	if message == OnEnter then
--		Find_Nearest_Space_Field(Object_Type, "Asteroid"/"Nebula"/"Ion_Storm")
		healer = Find_Nearest_Space_Field(Object, "Asteroid")
		healer.Despawn()
	end
end