File tree 2 files changed +14
-14
lines changed
Generals/Code/GameEngine/Source/GameLogic/System
GeneralsMD/Code/GameEngine/Source/GameLogic/System
2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -2504,9 +2504,9 @@ Int GameLogic::rebalanceChildSleepyUpdate(Int i)
2504
2504
UpdateModulePtr* pI = &m_sleepyUpdates[i];
2505
2505
2506
2506
// our children are i*2 and i*2+1
2507
- Int child = ((i+ 1 )<<1 )- 1 ;
2508
- UpdateModulePtr* pChild = &m_sleepyUpdates[child] ;
2509
- UpdateModulePtr* pSZ = &m_sleepyUpdates[m_sleepyUpdates.size ()] ; // yes, this is off the end.
2507
+ Int child = ((i)<<1 )+ 1 ;
2508
+ UpdateModulePtr* pChild = &m_sleepyUpdates[0 ] + child ;
2509
+ UpdateModulePtr* pSZ = &m_sleepyUpdates[0 ] + m_sleepyUpdates.size (); // yes, this is off the end.
2510
2510
2511
2511
while (pChild < pSZ)
2512
2512
{
@@ -2536,13 +2536,13 @@ Int GameLogic::rebalanceChildSleepyUpdate(Int i)
2536
2536
i = child;
2537
2537
pI = pChild;
2538
2538
2539
- child = ((i+ 1 )<<1 )- 1 ;
2540
- pChild = &m_sleepyUpdates[child] ;
2539
+ child = ((i)<<1 )+ 1 ;
2540
+ pChild = &m_sleepyUpdates[0 ] + child ;
2541
2541
}
2542
2542
#else
2543
2543
// our children are i*2 and i*2+1
2544
2544
Int sz = m_sleepyUpdates.size();
2545
- Int child = ((i+1 )<<1)- 1;
2545
+ Int child = ((i)<<1)+ 1;
2546
2546
while (child < sz)
2547
2547
{
2548
2548
// choose the higher-priority of the two children; we must be higher-pri than that.
@@ -2565,7 +2565,7 @@ Int GameLogic::rebalanceChildSleepyUpdate(Int i)
2565
2565
a->friend_setIndexInLogic(i);
2566
2566
b->friend_setIndexInLogic(child);
2567
2567
i = child;
2568
- child = ((i+1 )<<1)- 1;
2568
+ child = ((i)<<1)+ 1;
2569
2569
}
2570
2570
#endif
2571
2571
return i;
Original file line number Diff line number Diff line change @@ -2834,9 +2834,9 @@ Int GameLogic::rebalanceChildSleepyUpdate(Int i)
2834
2834
UpdateModulePtr* pI = &m_sleepyUpdates[i];
2835
2835
2836
2836
// our children are i*2 and i*2+1
2837
- Int child = ((i+ 1 )<<1 )- 1 ;
2838
- UpdateModulePtr* pChild = &m_sleepyUpdates[child] ;
2839
- UpdateModulePtr* pSZ = &m_sleepyUpdates[m_sleepyUpdates.size ()] ; // yes, this is off the end.
2837
+ Int child = ((i)<<1 )+ 1 ;
2838
+ UpdateModulePtr* pChild = &m_sleepyUpdates[0 ] + child ;
2839
+ UpdateModulePtr* pSZ = &m_sleepyUpdates[0 ] + m_sleepyUpdates.size (); // yes, this is off the end.
2840
2840
2841
2841
while (pChild < pSZ)
2842
2842
{
@@ -2866,13 +2866,13 @@ Int GameLogic::rebalanceChildSleepyUpdate(Int i)
2866
2866
i = child;
2867
2867
pI = pChild;
2868
2868
2869
- child = ((i+ 1 )<<1 )- 1 ;
2870
- pChild = &m_sleepyUpdates[child] ;
2869
+ child = ((i)<<1 )+ 1 ;
2870
+ pChild = &m_sleepyUpdates[0 ] + child ;
2871
2871
}
2872
2872
#else
2873
2873
// our children are i*2 and i*2+1
2874
2874
Int sz = m_sleepyUpdates.size();
2875
- Int child = ((i+1 )<<1)- 1;
2875
+ Int child = ((i)<<1)+ 1;
2876
2876
while (child < sz)
2877
2877
{
2878
2878
// choose the higher-priority of the two children; we must be higher-pri than that.
@@ -2895,7 +2895,7 @@ Int GameLogic::rebalanceChildSleepyUpdate(Int i)
2895
2895
a->friend_setIndexInLogic(i);
2896
2896
b->friend_setIndexInLogic(child);
2897
2897
i = child;
2898
- child = ((i+1 )<<1)- 1;
2898
+ child = ((i)<<1)+ 1;
2899
2899
}
2900
2900
#endif
2901
2901
return i;
You can’t perform that action at this time.
0 commit comments