|
12 | 12 | #pragma semicolon 1 |
13 | 13 |
|
14 | 14 | #define UTL_RBTREE_TAG "[UtlRBTree]" |
15 | | -#define UTL_RBTREE_VERSION "1.3.3" |
| 15 | +#define UTL_RBTREE_VERSION "1.3.4" |
16 | 16 |
|
17 | 17 | /** |
18 | 18 | * Author: blueblur |
19 | 19 | * Date: 2025-11-11 |
20 | 20 | * url: https://github.com/blueblur0730/modified-plugins |
21 | | - * Version: 1.3.3 |
| 21 | + * Version: 1.3.4 |
22 | 22 | */ |
23 | 23 |
|
24 | 24 | /* |
@@ -391,15 +391,15 @@ methodmap UtlRBTree < AddressBase { |
391 | 391 | } |
392 | 392 |
|
393 | 393 | public int LeftChild(int i, int size = 4) { |
394 | | - return i != UtlRBTree.InvalidIndex() ? view_as<UtlRBTreeNode_t>(view_as<any>(this.m_pMemory) + i * size).m_Left : UtlRBTree.InvalidIndex(); |
| 394 | + return i != UtlRBTree.InvalidIndex() ? view_as<UtlRBTreeNode_t>(view_as<any>(this.m_pMemory) + i * (8 + size)).m_Left : UtlRBTree.InvalidIndex(); |
395 | 395 | } |
396 | 396 |
|
397 | 397 | public int RightChild(int i, int size = 4) { |
398 | | - return i != UtlRBTree.InvalidIndex() ? view_as<UtlRBTreeNode_t>(view_as<any>(this.m_pMemory) + i * size).m_Right : UtlRBTree.InvalidIndex(); |
| 398 | + return i != UtlRBTree.InvalidIndex() ? view_as<UtlRBTreeNode_t>(view_as<any>(this.m_pMemory) + i * (8 + size)).m_Right : UtlRBTree.InvalidIndex(); |
399 | 399 | } |
400 | 400 |
|
401 | 401 | public int Parent(int i, int size = 4) { |
402 | | - return i != UtlRBTree.InvalidIndex() ? view_as<UtlRBTreeNode_t>(view_as<any>(this.m_pMemory) + i * size).m_Parent : UtlRBTree.InvalidIndex(); |
| 402 | + return i != UtlRBTree.InvalidIndex() ? view_as<UtlRBTreeNode_t>(view_as<any>(this.m_pMemory) + i * (8 + size)).m_Parent : UtlRBTree.InvalidIndex(); |
403 | 403 | } |
404 | 404 |
|
405 | 405 | public bool IsLeftChild(int i, int size = 4) { |
@@ -450,7 +450,7 @@ methodmap UtlRBTree < AddressBase { |
450 | 450 |
|
451 | 451 | public UtlRBTreeLinks_t Links(int i, int size = 4) { |
452 | 452 | Assert(i != UtlRBTree.InvalidIndex(), UTL_RBTREE_TAG, "Param index (%d) out of bounds", i); |
453 | | - return view_as<UtlRBTreeLinks_t>(view_as<any>(this.m_pMemory) + i * size); |
| 453 | + return view_as<UtlRBTreeLinks_t>(view_as<any>(this.m_pMemory) + i * (8 + size)); |
454 | 454 | } |
455 | 455 |
|
456 | 456 | public bool IsRed(int i, int size = 4) { |
@@ -1224,7 +1224,7 @@ methodmap UtlRBTree < AddressBase { |
1224 | 1224 | int it = this.IsIdxValid(this.m_LastAlloc) ? (this.IsIdxValid(this.m_LastAlloc + 1) ? this.m_LastAlloc + 1 : UtlRBTree.InvalidIndex()) : (this.IsIdxValid(0) ? 0 : UtlRBTree.InvalidIndex()); |
1225 | 1225 |
|
1226 | 1226 | if (!this.IsIdxValid(it)) { |
1227 | | - this.Grow(_, size); |
| 1227 | + this.Grow(_, (8 + size)); |
1228 | 1228 |
|
1229 | 1229 | it = this.IsIdxValid(this.m_LastAlloc) ? (this.IsIdxValid(this.m_LastAlloc + 1) ? this.m_LastAlloc + 1 : UtlRBTree.InvalidIndex()) : (this.IsIdxValid(0) ? 0 : UtlRBTree.InvalidIndex()); |
1230 | 1230 | Assert(this.IsIdxValid(it), UTL_RBTREE_TAG, "CUtlRBTree overflow!"); |
|
0 commit comments