ai_build.c
changeset 145 6e5468217504
parent 110 a22a6b07904b
child 193 0a7025304867
equal deleted inserted replaced
144:6b42494d405e 145:6e5468217504
   175 	     		// There is already some road, and it is a bridge.. don't build!!!
   175 	     		// There is already some road, and it is a bridge.. don't build!!!
   176 	     		if (!IS_TILETYPE(route[part], MP_TUNNELBRIDGE)) {
   176 	     		if (!IS_TILETYPE(route[part], MP_TUNNELBRIDGE)) {
   177 	     			// Build the tile
   177 	     			// Build the tile
   178 	     			res = DoCommandByTile(route[part], dir, 0, flag | DC_NO_WATER, CMD_BUILD_ROAD);
   178 	     			res = DoCommandByTile(route[part], dir, 0, flag | DC_NO_WATER, CMD_BUILD_ROAD);
   179 	     			// Currently, we ignore CMD_ERRORs!
   179 	     			// Currently, we ignore CMD_ERRORs!
   180 	     			if (res == CMD_ERROR && !IS_TILETYPE(route[part], MP_STREET) && (flag == DC_EXEC && !EnsureNoVehicle(route[part]))) {
   180 	     			if (res == CMD_ERROR && flag == DC_EXEC && !IS_TILETYPE(route[part], MP_STREET) && !EnsureNoVehicle(route[part])) {
   181      					// Problem.. let's just abort it all!
   181      					// Problem.. let's just abort it all!
   182      					DEBUG(ai,0)("Darn, the route could not be builded.. aborting!");
   182      					DEBUG(ai,0)("Darn, the route could not be builded.. aborting!");
   183     	     			p->ainew.state = AI_STATE_NOTHING;
   183     	     			p->ainew.state = AI_STATE_NOTHING;
   184     	     			return 0;
   184     	     			return 0;
   185     	     		} else {
   185     	     		} else {