forked from mirror/OpenTTD
(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
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user