public void RegisterObjectPos(VMEntity obj)
        {
            var pos = new VMTilePos(obj.WorldUI.TileX, obj.WorldUI.TileY, obj.WorldUI.Level);

            if (!ObjectsAt.ContainsKey(pos))
            {
                ObjectsAt[pos] = new List <short>();
            }
            ObjectsAt[pos].Add(obj.ObjectID);
        }
        public bool SolidToAvatars(VMTilePos pos)
        {
            if (!ObjectsAt.ContainsKey(pos))
            {
                return(false);
            }
            var objs = ObjectsAt[pos];

            foreach (var id in objs)
            {
                var obj   = VM.GetObjectById(id);
                var flags = (VMEntityFlags)obj.GetValue(VMStackObjectVariable.Flags);
                if (((flags & VMEntityFlags.DisallowPersonIntersection) > 0) || (flags & (VMEntityFlags.AllowPersonIntersection | VMEntityFlags.HasZeroExtent)) == 0)
                {
                    return(true);                                                                                                                                                  //solid to people
                }
            }
            return(false);
        }
        public void UnregisterObjectPos(VMEntity obj)
        {
            var pos = new VMTilePos(obj.WorldUI.TileX, obj.WorldUI.TileY, obj.WorldUI.Level);

            ObjectsAt[pos].Remove(obj.ObjectID);
        }
Beispiel #4
0
 public void UnregisterObjectPos(VMEntity obj)
 {
     var pos = new VMTilePos(obj.WorldUI.TileX, obj.WorldUI.TileY, obj.WorldUI.Level);
     ObjectsAt[pos].Remove(obj.ObjectID);
 }
Beispiel #5
0
 public VMSolidResult SolidToAvatars(VMTilePos pos)
 {
     if (!ObjectsAt.ContainsKey(pos)) return new VMSolidResult();
     var objs = ObjectsAt[pos];
     foreach (var id in objs)
     {
         var obj = VM.GetObjectById(id);
         var flags = (VMEntityFlags)obj.GetValue(VMStackObjectVariable.Flags);
         if (((flags & VMEntityFlags.DisallowPersonIntersection) > 0) || (flags & (VMEntityFlags.AllowPersonIntersection | VMEntityFlags.HasZeroExtent)) == 0)
             return new VMSolidResult {
                 Solid = true,
                 Chair = (obj.EntryPoints[26].ActionFunction != 0)?obj:null
             }; //solid to people
     }
     return new VMSolidResult();;
 }
Beispiel #6
0
 public void RegisterObjectPos(VMEntity obj)
 {
     var pos = new VMTilePos(obj.WorldUI.TileX, obj.WorldUI.TileY, obj.WorldUI.Level);
     if (!ObjectsAt.ContainsKey(pos)) ObjectsAt[pos] = new List<short>();
     ObjectsAt[pos].Add(obj.ObjectID);
 }