|
@@ -1853,13 +1853,13 @@ extern int GetAmountOwnedBy(const Compan
|
|
|
/** Acquire shares in an opposing company.
|
|
|
* @param tile unused
|
|
|
* @param flags type of operation
|
|
|
* @param p1 company to buy the shares from
|
|
|
* @param p2 unused
|
|
|
*/
|
|
|
CommandCost CmdBuyShareInCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
|
|
|
CommandCost CmdBuyShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
|
|
{
|
|
|
CommandCost cost(EXPENSES_OTHER);
|
|
|
|
|
|
/* Check if buying shares is allowed (protection against modified clients) */
|
|
|
/* Cannot buy own shares */
|
|
|
if (!IsValidCompanyID((CompanyID)p1) || !_settings_game.economy.allow_shares || _current_company == (CompanyID)p1) return CMD_ERROR;
|
|
@@ -1898,13 +1898,13 @@ CommandCost CmdBuyShareInCompany(TileInd
|
|
|
/** Sell shares in an opposing company.
|
|
|
* @param tile unused
|
|
|
* @param flags type of operation
|
|
|
* @param p1 company to sell the shares from
|
|
|
* @param p2 unused
|
|
|
*/
|
|
|
CommandCost CmdSellShareInCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
|
|
|
CommandCost CmdSellShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
|
|
{
|
|
|
/* Check if selling shares is allowed (protection against modified clients) */
|
|
|
/* Cannot sell own shares */
|
|
|
if (!IsValidCompanyID((CompanyID)p1) || !_settings_game.economy.allow_shares || _current_company == (CompanyID)p1) return CMD_ERROR;
|
|
|
|
|
|
Company *c = GetCompany((CompanyID)p1);
|
|
@@ -1931,13 +1931,13 @@ CommandCost CmdSellShareInCompany(TileIn
|
|
|
* @todo currently this only works for AI companies
|
|
|
* @param tile unused
|
|
|
* @param flags type of operation
|
|
|
* @param p1 company to buy up
|
|
|
* @param p2 unused
|
|
|
*/
|
|
|
CommandCost CmdBuyCompany(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
|
|
|
CommandCost CmdBuyCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
|
|
{
|
|
|
CompanyID cid = (CompanyID)p1;
|
|
|
|
|
|
/* Disable takeovers in multiplayer games */
|
|
|
if (!IsValidCompanyID(cid) || _networking) return CMD_ERROR;
|
|
|
|