hash_map<string,double> streets;
Intersection& inter = _intersections[_location];
for (hash_map<string,StreetType>::const_iterator street = inter.connections.begin();
street != inter.connections.end(); ++street){
if (street->second == car){
hash_map<string,double> streets;
Intersection& inter = _intersections[_location];
for (hash_map<string,StreetType>::const_iterator street = inter.connections.begin();
street != inter.connections.end(); ++street){
if (street->second == car){
continue;
}
double goodness = 0;
Intersection& conInter = _intersections[street->first];
list<string> closestFootCop = shortestPath(street->first, cop_foot, FindPlayer(_players, cop_foot, 6), true);
continue;
}
double goodness = 0;
Intersection& conInter = _intersections[street->first];
list<string> closestFootCop = shortestPath(street->first, cop_foot, FindPlayer(_players, cop_foot, 6), true);
- list<string> closestCarCop = shortestPath(street->first, cop_car, FindPlayer(_players, cop_car, 5), true);
-
- unsigned int closestCop = 0;
+ unsigned int closestCop = closestFootCop.size();
+ //cerr << "Cop on fot " << closestCop << " intersections away." << endl;
+ list<string> closestCarCop = shortestPath(street->first, cop_car, FindPlayer(_players, cop_car, closestCop > 0 ? closestCop : 5), true);
+ //cerr << "Cop in car " << closestCarCop.size() << " intersections away." << endl;
string destination = _location;
double goodness = 0;
for (hash_map<string,double>::const_iterator dest = streets.begin();
dest != streets.end(); ++dest){
string destination = _location;
double goodness = 0;
for (hash_map<string,double>::const_iterator dest = streets.begin();
dest != streets.end(); ++dest){