Fix the cause of the waypoint debug message spam in Canyon Rush.

Not calling the indexchanged callback here meant that if K_BHeapSortDown didn't make any changes, the item at index 0 would never call the callback despite changing position.
This commit is contained in:
Sryder 2020-07-08 21:36:28 +01:00
parent c7a00d4800
commit 87069a86d8

View file

@ -469,6 +469,10 @@ boolean K_BHeapPop(bheap_t *const heap, bheapitem_t *const returnitemstorage)
heap->array[0] = heap->array[heap->count];
heap->array[0].heapindex = 0U;
memset(&heap->array[heap->count], 0x00, sizeof(bheapitem_t));
if (heap->array[0].indexchanged != NULL)
{
heap->array[0].indexchanged(heap->array[0].data, heap->array[0].heapindex);
}
K_BHeapSortDown(heap, &heap->array[0]);
popsuccess = true;