(svn r122) Change: exclusive transport rights are now stored per town instead of per station

Exclusive rights from old savegames will be reset.
This commit is contained in:
dominik
2004-08-23 21:04:39 +00:00
parent 1d1d14ebd3
commit 770f86bbbe
6 changed files with 43 additions and 23 deletions

View File

@@ -863,6 +863,8 @@ static void DoCreateTown(Town *t, TileIndex tile)
t->ratings[i] = 500;
t->have_ratings = 0;
t->exclusivity = (byte)-1;
t->exclusive_counter = 0;
t->statues = 0;
CreateTownName(t);
@@ -1471,13 +1473,8 @@ static void TownActionFundBuildings(Town *t, int action)
static void TownActionBuyRights(Town *t, int action)
{
Station *st;
FOR_ALL_STATIONS(st) {
if (st->xy && st->town == t && st->owner < 8 &&
st->owner != _current_player)
st->blocked_months = 12;
}
t->exclusive_counter = 12;
t->exclusivity = _current_player;
ModifyStationRatingAround(t->xy, _current_player, 130, 17);
}
@@ -1739,6 +1736,10 @@ void TownsMonthlyLoop()
if (t->road_build_months != 0)
t->road_build_months--;
if (t->exclusive_counter != 0)
if(--t->exclusive_counter==0)
t->exclusivity = (byte)-1;
UpdateTownGrowRate(t);
UpdateTownAmounts(t);
UpdateTownUnwanted(t);
@@ -1827,8 +1828,10 @@ static const byte _town_desc[] = {
SLE_VAR(Town,fund_buildings_months, SLE_UINT8),
SLE_VAR(Town,road_build_months, SLE_UINT8),
// reserve extra space in savegame here. (currently 32 bytes)
SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 4, 2, 255),
SLE_VAR(Town,exclusivity, SLE_UINT8),
SLE_VAR(Town,exclusive_counter, SLE_UINT8),
// reserve extra space in savegame here. (currently 30 bytes)
SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 30, 2, 255),
SLE_END()
};