mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-02 12:00:02 +00:00
Remove an unused private field.
Issue found by Clang 3.2. Also renamed the 'height' member to the width is really is.
This commit is contained in:
parent
264e822bab
commit
8d465edf34
@ -128,12 +128,12 @@ public:
|
||||
};
|
||||
|
||||
class indexer {
|
||||
size_t h_, w_;
|
||||
size_t w_;
|
||||
|
||||
public:
|
||||
indexer(size_t a, size_t b) : h_(a), w_(b) { }
|
||||
indexer(size_t w) : w_(w) { }
|
||||
size_t operator()(const map_location& loc) {
|
||||
return loc.y * h_ + loc.x;
|
||||
return loc.y * w_ + loc.x;
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -167,7 +167,7 @@ pathfind::plain_route pathfind::a_star_search(const map_location& src, const map
|
||||
static std::vector<node> nodes;
|
||||
nodes.resize(width * height); // this create uninitalized nodes
|
||||
|
||||
indexer index(width, height);
|
||||
indexer index(width);
|
||||
comp node_comp(nodes);
|
||||
|
||||
nodes[index(dst)].g = stop_at + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user