[Scummvm-git-logs] scummvm master -> 88fdb16d39766e863becb203c3b8f51601faff47

dreammaster dreammaster at scummvm.org
Tue Sep 7 04:40:12 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
88fdb16d39 AGS: Fix pathfinding in A Golden Wake


Commit: 88fdb16d39766e863becb203c3b8f51601faff47
    https://github.com/scummvm/scummvm/commit/88fdb16d39766e863becb203c3b8f51601faff47
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-09-06T21:39:54-07:00

Commit Message:
AGS: Fix pathfinding in A Golden Wake

Changed paths:
    engines/ags/engine/ac/route_finder_impl.cpp
    engines/ags/engine/ac/route_finder_jps.cpp
    engines/ags/lib/std/queue.h


diff --git a/engines/ags/engine/ac/route_finder_impl.cpp b/engines/ags/engine/ac/route_finder_impl.cpp
index 10293ec9f5..8b9916e8dc 100644
--- a/engines/ags/engine/ac/route_finder_impl.cpp
+++ b/engines/ags/engine/ac/route_finder_impl.cpp
@@ -87,7 +87,7 @@ void get_lastcpos(int &lastcx_, int &lastcy_) {
 static int find_route_jps(int fromx, int fromy, int destx, int desty) {
 	sync_nav_wallscreen();
 
-	static std::vector<int> path, cpath;
+	std::vector<int> path, cpath;
 	path.clear();
 	cpath.clear();
 
diff --git a/engines/ags/engine/ac/route_finder_jps.cpp b/engines/ags/engine/ac/route_finder_jps.cpp
index 005ef1f8e3..de52abf854 100644
--- a/engines/ags/engine/ac/route_finder_jps.cpp
+++ b/engines/ags/engine/ac/route_finder_jps.cpp
@@ -123,7 +123,7 @@ private:
 	std::vector<NodeInfo> mapNodes;
 	tFrameId frameId;
 
-	std::priority_queue<Entry, std::vector<Entry>, Common::Greater<Entry> > pq;
+	std::priority_queue<Entry, std::vector<Entry>, Common::Less<Entry> > pq;
 
 	// temporary buffers:
 	mutable std::vector<int> fpath;
diff --git a/engines/ags/lib/std/queue.h b/engines/ags/lib/std/queue.h
index 2dfe76ccb0..3aa858b8af 100644
--- a/engines/ags/lib/std/queue.h
+++ b/engines/ags/lib/std/queue.h
@@ -33,6 +33,11 @@ namespace std {
 template<class T>
 using queue = Common::Queue<T>;
 
+/**
+ * FIXME: The current implementation requires the reverse
+ * greater/lesser comparitor than the original does.
+ * If this is fixed, also change the router finder's use
+ */
 template<class T, class Container = vector<T>, class Comparitor = typename Common::Less<T> >
 class priority_queue {
 private:




More information about the Scummvm-git-logs mailing list