internal static void OnAI(NPC n) { var bh = n.P_BHandler as NpcBHandler; if (bh == null || bh.PreAI()) { n.RealAI(); if (bh != null) bh.OnAI(); } }