chingu-pathfinding 1.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/chingu_pathfinding/chingu_pathfinding.cpp +7 -6
- data/lib/chingu_pathfinding.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e40cf76e8b0907e849089d8e76da75a54e25843
|
4
|
+
data.tar.gz: 616929d9dcf559c235cc0b7c9f7efa57a3dcf015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2d9d6bb0c64c695809d717ecdb7b7a525a88da92506650379dd6102058ae39b2723beaf9d31d8c13034a8316d1bde981253e2db997bf65492a39e7a67d701e4
|
7
|
+
data.tar.gz: 96c63f137ddfb6327da4dee754dd7b04a59f1aa79e55373f2b27303cbebb70f0d7f713c48a72a7a526294a97b07cba05751bfe59d80e6c7e7d98706df6bdb20c
|
@@ -161,20 +161,21 @@ class pathfinder_t {
|
|
161
161
|
}
|
162
162
|
|
163
163
|
path_t find_path_update(long int x1, long int y1, long int x2, long int y2, std::vector<location_t> current) {
|
164
|
-
location_t
|
164
|
+
location_t start(x1,y1);
|
165
165
|
location_t goal(x2,y2);
|
166
|
-
path_t
|
166
|
+
path_t init_path;
|
167
167
|
by_estimated_cost estimator(goal);
|
168
168
|
queue_t queue(estimator);
|
169
|
+
init_path.add_loc(start, goal);
|
169
170
|
// Cut out the part of the path already visited
|
170
171
|
bool drop = true;
|
171
172
|
for (location_t l : current) {
|
172
|
-
if (dist(l,
|
173
|
+
if (dist(l, start) < block_size) {
|
173
174
|
drop = false;
|
174
175
|
}
|
175
|
-
if (!drop) {
|
176
|
-
|
177
|
-
queue.push(
|
176
|
+
if (!drop && start != l) {
|
177
|
+
init_path.add_loc(l, goal);
|
178
|
+
queue.push(init_path);
|
178
179
|
}
|
179
180
|
}
|
180
181
|
// Add every prefix of current to initial guess and converge to new location.
|
data/lib/chingu_pathfinding.rb
CHANGED