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); }
private void End() { this.Cell = null; }