diff options
author | smatz <smatz@openttd.org> | 2009-08-08 16:42:55 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-08-08 16:42:55 +0000 |
commit | 2a430d981f680485b9d4f9e5fab8bc642952b9bf (patch) | |
tree | e37f617ae610677d7c92aad77b5f184545599102 /src/unmovable_cmd.cpp | |
parent | eff8cb839072c3aa80d1e54b189810061160669a (diff) | |
download | openttd-2a430d981f680485b9d4f9e5fab8bc642952b9bf.tar.xz |
(svn r17113) -Change [FS#265][FS#2094][FS#2589]: apply the subsidy when subsidy's destination is in station's catchment area and cargo packets originate from subsidy's source
-Change [FS#1134]: subsidies aren't bound to stations after awarding anymore, they still apply to town or industry, no matter what station is used for loading and unloading. Awarded subsidies from older savegames are lost
-Change [NoAI]: due to these changes, AISubsidy::GetSource and AISubsidy::GetDestination now return STATION_INVALID for awarded subsidies
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r-- | src/unmovable_cmd.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp index 832318dd5..0aec67b6a 100644 --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -23,6 +23,7 @@ #include "cheat_type.h" #include "landscape_type.h" #include "unmovable.h" +#include "cargopacket.h" #include "table/strings.h" #include "table/sprites.h" @@ -62,6 +63,8 @@ static CommandCost DestroyCompanyHQ(CompanyID cid, DoCommandFlag flags) DoClearSquare(t + TileDiffXY(1, 1)); c->location_of_HQ = INVALID_TILE; // reset HQ position InvalidateWindow(WC_COMPANY, cid); + + CargoPacket::InvalidateAllFrom(ST_HEADQUARTERS, cid); } /* cost of relocating company is 1% of company value */ @@ -335,7 +338,7 @@ static void TileLoop_Unmovable(TileIndex tile) if (GB(r, 0, 8) < (256 / 4 / (6 - level))) { uint amt = GB(r, 0, 8) / 8 / 4 + 1; if (_economy.fluct <= 0) amt = (amt + 1) >> 1; - MoveGoodsToStation(tile, 2, 2, CT_PASSENGERS, amt); + MoveGoodsToStation(tile, 2, 2, CT_PASSENGERS, amt, ST_HEADQUARTERS, GetTileOwner(tile)); } /* Top town building generates 90, HQ can make up to 196. The @@ -344,7 +347,7 @@ static void TileLoop_Unmovable(TileIndex tile) if (GB(r, 8, 8) < (196 / 4 / (6 - level))) { uint amt = GB(r, 8, 8) / 8 / 4 + 1; if (_economy.fluct <= 0) amt = (amt + 1) >> 1; - MoveGoodsToStation(tile, 2, 2, CT_MAIL, amt); + MoveGoodsToStation(tile, 2, 2, CT_MAIL, amt, ST_HEADQUARTERS, GetTileOwner(tile)); } } |