Example #1
0
        private bool Begin()
        {
            IntPtr cellPtr;

            Memory.InvokeCdecl(GidFileGenerationTask.addr_EnterLock);
            try
            {
                cellPtr = Memory.InvokeCdecl(GidFileGenerationTask.addr_WSLoadCellByCoordinates, this.Parent.WorldSpace.Cast <NetScriptFramework.SkyrimSE.TESWorldSpace>(), this.X, this.Y);
            }
            catch
            {
                GidFileGenerationTask.KillProcess();
                return(false);
            }
            finally
            {
                Memory.InvokeCdecl(GidFileGenerationTask.addr_ExitLock);
            }

            if (cellPtr == IntPtr.Zero)
            {
                return(false);
            }

            this.Cell = MemoryObject.FromAddress <NetScriptFramework.SkyrimSE.TESObjectCELL>(cellPtr);
            if (this.Cell == null)
            {
                throw new NullReferenceException("this.Cell");
            }

            return(true);
        }
Example #2
0
 private void End()
 {
     this.Cell = null;
 }