The fibonacci heap have a bug. If you insert an element with a priority >= 268435455, and you then pop elements until this element is the only one left and tries to pop it, you will trigger a crash.
This is the cause of the bug in CluelessPlus that have puzzled me for probably more than a year. (It doesn't explain why CluelessPlus have insert a such high value, but it is the cause of the crash)
The attached patch fixes this problem with the fibonacci heap version 2. It is possible that some of you might be able to optimize this fix and make it faster. An alternative is to use the fibonacci heap implementation that Morloth has written for NoCAB, which doesn't have this problem. He claims that his implementation also is faster, but I don't know if it is true or not.
_________________My OpenTTD contributions
(AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)Junctioneer
(a traffic intersection simulator)