@@ -153,6 +153,8 @@ private static List<long> DeterminePointer(int index)
153153
154154 /// <summary>
155155 /// Reads the IsActive flag for a raid at the specified index.
156+ /// IsActive (IsEnabled) is at offset 0x00 within the raid structure.
157+ /// DeterminePointer returns a pointer to the Seed (offset 0x10), so we subtract 0x10.
156158 /// </summary>
157159 /// <param name="index">The global raid index</param>
158160 /// <param name="token">Cancellation token</param>
@@ -162,9 +164,11 @@ public async Task<bool> ReadIsActiveFlag(int index, CancellationToken token)
162164 try
163165 {
164166 var ptr = DeterminePointer ( index ) ;
165- ptr [ 3 ] += 0x18 ;
166- byte [ ] data = await _connection . PointerPeek ( 1 , ptr , token ) . ConfigureAwait ( false ) ;
167- return data [ 0 ] != 0 ;
167+ // IsActive is at offset 0x00, Seed is at offset 0x10, so IsActive = Seed - 0x10
168+ ptr [ 3 ] -= 0x10 ;
169+ // IsActive is a uint32 (4 bytes), value of 1 = active
170+ byte [ ] data = await _connection . PointerPeek ( 4 , ptr , token ) . ConfigureAwait ( false ) ;
171+ return BitConverter . ToUInt32 ( data , 0 ) == 1 ;
168172 }
169173 catch
170174 {
@@ -174,6 +178,8 @@ public async Task<bool> ReadIsActiveFlag(int index, CancellationToken token)
174178
175179 /// <summary>
176180 /// Sets the IsActive flag for a raid at the specified index.
181+ /// IsActive (IsEnabled) is at offset 0x00 within the raid structure.
182+ /// DeterminePointer returns a pointer to the Seed (offset 0x10), so we subtract 0x10.
177183 /// </summary>
178184 /// <param name="index">The global raid index</param>
179185 /// <param name="isActive">True to mark as active, false to mark as inactive</param>
@@ -184,12 +190,14 @@ public async Task<bool> SetIsActiveFlag(int index, bool isActive, CancellationTo
184190 try
185191 {
186192 var ptr = DeterminePointer ( index ) ;
187- ptr [ 3 ] += 0x18 ;
188- byte [ ] flagByte = [ ( byte ) ( isActive ? 1 : 0 ) ] ;
189- await _connection . PointerPoke ( flagByte , ptr , token ) . ConfigureAwait ( false ) ;
193+ // IsActive is at offset 0x00, Seed is at offset 0x10, so IsActive = Seed - 0x10
194+ ptr [ 3 ] -= 0x10 ;
195+ // IsActive is a uint32 (4 bytes), value of 1 = active, 0 = inactive
196+ byte [ ] flagBytes = BitConverter . GetBytes ( isActive ? 1u : 0u ) ;
197+ await _connection . PointerPoke ( flagBytes , ptr , token ) . ConfigureAwait ( false ) ;
190198
191- byte [ ] verification = await _connection . PointerPeek ( 1 , ptr , token ) . ConfigureAwait ( false ) ;
192- return verification [ 0 ] == flagByte [ 0 ] ;
199+ byte [ ] verification = await _connection . PointerPeek ( 4 , ptr , token ) . ConfigureAwait ( false ) ;
200+ return BitConverter . ToUInt32 ( verification , 0 ) == ( isActive ? 1u : 0u ) ;
193201 }
194202 catch
195203 {
0 commit comments