269
293
// the conversion between x/y coordinates and index is (size is map size)
270
294
// index = y*width + x <=> x = index % width; y = index / width
271
295
int length = width*height;
273
303
std::queue<Vector<int> > process;
274
304
bool flying = s->isFlying();
277
308
for (int i = 0; i < width*height; i++)
279
310
// -1 means don't know yet
280
311
// -2 means can't go there at all
281
312
// 0 or more is number of movement points needed to get there
283
316
if (isBlocked(s, i % width, i/width, dest.x, dest.y))
289
324
process.push(Vector<int>(start.x, start.y));