Fixed OOS bugs in some random events.

There were a few events which involved sorting lists that had memory
dependant values in them. eg. list of (distance, city_pointer) pairs.
This meant that in some situations memory addresses were compared, which
sometimes resulted in OOS (because the memory address won't be the same
on all computers, thus the lists might have different orders).

I've changed it so that only the first member of the tuple is used to
sort the list. The memory address will be ignored, and so that should
solve the problem.
Fixed espionage cost information when in an alliance.

The cost of espionage mission scales with the number of players on a
team. This scaling was previously ignored when generating the
information in espionage popup boxes, and so the cost values were
incorrect in teams with more than 1 player.
Fixed minor mistake in noBonus evaluation of buildings.

Buildings which remove bonus now evaluate using the base bonus value
rather than the cost of losing 1 instance of the bonus.
Tweaked evaluation and usage of corporation executives.

Increased the threshold value for automated cities to build execs.

The bonus value of spreading a new corporation to a foreign civ is now
only counted if there are no existing execs.

Strengthen the conditions for deciding to replace an existing corp with
a new one.
Tweaked the handling of happiness and growth in AI_yieldValue.

There is a complex interplay between the approximate food-per-turn given
by iAdjustedFoodPerTurn and the approximate future happiness given by
iFutureHappy. The growth value adjustments from iFutureHappy were sometimes resulting
in some dubious plot choices (because high food plots can end up giving
lower growth value than low food plots).

Estimated future happiness now depends on a slower estimate of
food-per-turn, so that the 'future happiness' is more likely to be an
underestimate rather than an overestimate.

I've also increased the devalue rate. (i.e. decreased the value of
having very high food-per-turn.
Some style adjustments in AI_assignWorkingPlots.

Changed loops to use the SpecialistTypes enum as the loop variable
rather than int, to remove the need for casting inside the loops.
Forced specialist count can no longer exceed total population.

If a forced specialist is removed due to insufficient population, the
force count is now reduced.

Before this change, the force count could be set so high that clicking
the "remove specialist" button in the city screen would have no effect
(because there was still more forced specialists than available
specialists when removing.) This change just makes the add / remove
specialist buttons behave a bit more intuitively.
Changed handling of forced specialists in AI_addBestCitizen.

The new version is simpler, and consistent with AI_juggleCitizens.

(AI_juggleCitizens gets the final say on where citizens are placed
anyway, so this change will have no effect on gameplay. It's just a bit
cleaner and faster.)
AI_juggleCitizens will now deliberately remove unforced specialists.

When a city has forced specialist types that are still available, any
unforced types will now be removed.

(Previously unforced types were not allowed to be assigned, but were
allowed to remain if they were already assigned. Now they will be
explicitly removed unless all the forced positions are already full.)
Fixed invalid assert, and slightly improved efficiency in updateCombat

updateCombat will no longer calculate the best defender until combat is
ready to start. (Previously, if the attacker would work out the best
defender over and over while other combat was taking place.)

Also, removed an invalid assert from my previous changes.
Added mission information to the launch-spaceship popup in multiplayer.

The launch-spaceship popup which appears in multiplayer games after
completing a component now shows the probability of success and the
number of turns until arrival.

Previously, the popup only game the estimated date of arrival.
Tweaked evaluation of rivers and continent bonuses in AI_foundValue.

River plots are now worth slightly more.

The area-based resources modifier for starting positions is now capped
to avoid overflows.
Weakened conditions on an assert (which still isn't always true).
Fixed a minor coding mistake. (No actual effect.)

Removed superfluous assignment within an assignment.
Added new functions for evaluating citizen jobs.

CvCityAI::AI_jobChangeValue will supersede AI_plotValue and
AI_specialistValue. It can directly evaluate a swap from one job to
another, as well as adding and removing jobs.

AI_finalImprovementYieldDifference and AI_specialPlotImprovementValue
are helper functions for AI_jobChangeValue.

The evaluation in AI_jobChangeValue is essentially the same as the
existing evaluation in AI_plotValue and AI_specialistValue. Those older
functions will soon be changed to refer directly to AI_jobChnageValue to
avoid code duplication.

Also, AI_yieldValue is now able to accept a NULL yields vector.

NOTE: currently, AI_jobChangeValue uses AI_getGreatPersonWeight when
evaluating specialists for both human and AI players; but those weights
are not updated for human players. This may cause undesired behaviour of
someone turns autoplay on and then off again.
Updated AI_plotValue to reduce code duplication.

AI_plotValue now uses AI_finalImprovementYieldDifference and
AI_specialPlotImprovementValue in its evaluation. This makes the code
quite short, and similar to AI_jobChangeValue.

However, AI_specialistValue is still long and heavily duplicated in
AI_jobChangeValue. I intend to change both AI_specialistValue and
AI_plotValue to simply call AI_jobChangeValue directly. (I'm just
updating these things in parts in case I want to roll back the changes
in parts.)
AI_plotValue and AI_specialistValue now just call AI_jobChangeValue.

The previous code for those function has been deleted.

I've also made minor adjustments to AI_yieldValue and
AI_getGreatPersonWeight to correct potential problems in
AI_jobChangeValue.
AI_juggleCitizens now directly compares jobs before switching.

if AI_jobChangeValue(new_job, old_job, ...) is negative, the job switch
does not go ahead. This is what AI_jobChangeValue was made for!
Adjustments to food devalue rate in AI_yieldValue.

I'm more comfortable in tuning these values now that AI_juggleCitizens
is more robust.
Fixed a bug in the evaluation of food difference in AI_yieldValue.

When AI_yieldValue was used only for plots, I chose to not count growth
value for plots which did not offer any yield than citizens would
consume (eg. a grassland plot with no river and no improvements).

AI_yieldValue is now used for direct comparisons between plots, and so
we can no longer assume that a yield of only 2 food is useless - because
it might be a _difference_ of two food.

Note: the best way to restore the behaviour of ignore growth value on
bad plots would be to alter iGrowthValue in AI_plotValue.