Ejemplo n.º 1
0
        public bool RemoveCharacter(string instancename)
        {
            GroundMap map = ZoneManager.Instance.CurrentGround;

            if (map == null)
            {
                DiagManager.Instance.LogInfo(String.Format("ScriptGround.RemoveObject({0}) : No ground map loaded!", instancename));
                return(false);
            }

            //Removal by instance name, since lua can't do via .NET pointer reliably, and pointers to .NET aren't practical in lua
            GroundChar charToRemove = map.GetMapChar(instancename);

            if (charToRemove != null)
            {
                map.RemoveMapChar(charToRemove);
                return(true);
            }
            charToRemove = map.GetTempChar(instancename);
            if (charToRemove != null)
            {
                map.RemoveTempChar(charToRemove);
                return(true);
            }

            return(false);
        }