andrewknoll / speedyrunners

Clone project of the game SpeedRunners by DoubleDutch games using Visual Studio and SFML. This is a learning project and it is in no way intended for profit.
1 stars 1 forks source link

Frontier values not being updated properly? #48

Open andrewknoll opened 2 years ago

andrewknoll commented 2 years ago

https://github.com/andrewknoll/speedyrunners/blob/19e4865388d8127b02bc29ce7ca2094913c3268c/Speedyrunners/PriorityQueue.cpp#L44

operator< as defined in: https://github.com/andrewknoll/speedyrunners/blob/19e4865388d8127b02bc29ce7ca2094913c3268c/Speedyrunners/PriorityQueue.h#L40 defines that the first element has a lower f function than the second, and therefore, is more promising. By making this comparison, the more promising node is replaced with the less promising one, causing a slower and worse behaviour.