local disabled_enemy = nil
local entity_x, entity_y = EntityGetTransform(GetUpdatedEntityID())

-- EntityGetParent check to prevent enabling enemies that are currently fucking
for _, enemy in ipairs(EntityGetInRadiusWithTag(entity_x, entity_y, 500, "enemy")) do
	if ComponentGetIsEnabled(EntityGetFirstComponentIncludingDisabled(enemy, "ControlsComponent")) == false and EntityGetParent(enemy) == 0 then
		disabled_enemy = enemy
		break
	end
end

if disabled_enemy ~= nil then
	dofile_once("mods/lewd_noita/files/sex_logic/controls_toggle.lua")
	enable_entity(disabled_enemy)
	EntityKill(GetUpdatedEntityID())
end