OpenTTD Source 20260206-master-g4d4e37dbf1
economy_cmd.h File Reference

Command definitions related to the economy. More...

#include "command_type.h"
#include "company_type.h"

Go to the source code of this file.

Functions

CommandCost CmdBuyCompany (DoCommandFlags flags, CompanyID target_company, bool hostile_takeover)
 Buy up another company.

Detailed Description

Command definitions related to the economy.

Definition in file economy_cmd.h.

Function Documentation

◆ CmdBuyCompany()

CommandCost CmdBuyCompany ( DoCommandFlags flags,
CompanyID target_company,
bool hostile_takeover )

Buy up another company.

When a competing company is gone bankrupt you get the chance to purchase that company.

Todo
currently this only works for AI companies
Parameters
flagstype of operation
target_companycompany to buy up
hostile_takeoverwhether to buy up the company even if it is not bankrupt
Returns
the cost of this operation or an error

Definition at line 2015 of file economy.cpp.

References _current_company, _local_company, _networking, CompanyProperties::bankrupt_asked, CalculateHostileTakeoverValue(), CheckTakeoverVehicleLimit(), CMD_ERROR, Execute, EXPENSES_OTHER, CompanyProperties::is_ai, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().