* Makes traffic starting from the road tile at \x, \y. * @param x Start x position of the attempt * @param y Start y position of the attempt * @param dest Zone type to go to. * @return \c 1 if connection found, \c 0 if not found, * \c -1 if no connection to road found. */
| 81 | * \c -1 if no connection to road found. |
| 82 | */ |
| 83 | short Micropolis::makeTrafficAt(int x, int y, ZoneType dest) |
| 84 | { |
| 85 | Position pos; |
| 86 | pos.posX = x; |
| 87 | pos.posY = y; |
| 88 | |
| 89 | if (tryDrive(pos, dest)) { /* attempt to drive somewhere */ |
| 90 | addToTrafficDensityMap(); /* if sucessful, inc trafdensity */ |
| 91 | return 1; /* traffic passed */ |
| 92 | } |
| 93 | |
| 94 | return 0; /* traffic failed */ |
| 95 | } |
| 96 | |
| 97 | |
| 98 | /** |