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){
list<string> closestFootCop = shortestPath(street->first, cop_foot, FindPlayer(_players, cop_foot, 6), true);
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();
- if (closestCarCop.size() < closestFootCop.size() && closestCarCop.size() > 0){
+ list<string> closestCarCop = shortestPath(street->first, cop_car, FindPlayer(_players, cop_car, closestCop - 1 > 0 ? closestCop : 5), true);
+ //cerr << "Cop in car " << closestCarCop.size() << " intersections away." << endl;
+
+ if (closestCarCop.size() > 0){
- if (closestCop > 0 && closestCop < 3){
- cerr << "Cop " << closestCop << " intersections away." << endl;
+ //cerr << "Cop " << closestCop << " intersections away." << endl;
+ if (closestCop > 0 && closestCop < 3)
priority_queue<double> banks;
for(hash_map<string,int>::const_iterator bank = _banks.begin();
priority_queue<double> banks;
for(hash_map<string,int>::const_iterator bank = _banks.begin();
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){