-- if enemy polymorphs during scene we need to find and enable it after polymorph ends
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") or {}) do
	if EntityGetParent(enemy) == 0 and
	EntityGetFirstComponentIncludingDisabled(enemy, "ControlsComponent") ~= nil and
	ComponentGetIsEnabled(EntityGetFirstComponentIncludingDisabled(enemy, "ControlsComponent")) == false then
		dofile_once("mods/lewd_noita/files/sex_logic/controls_toggle.lua")
		enable_entity(enemy)
	end
end