From 87069a86d87ca563d706b6fcd33d79eebb9eb4f1 Mon Sep 17 00:00:00 2001 From: Sryder Date: Wed, 8 Jul 2020 21:36:28 +0100 Subject: [PATCH] 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. --- src/k_bheap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/k_bheap.c b/src/k_bheap.c index 40c652b5e..495c8ba0f 100644 --- a/src/k_bheap.c +++ b/src/k_bheap.c @@ -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;