fix for crash in shutdown
fixed entity removal, ai eats mushrooms, added phase to the viewport effects