OpenTTD Source  20241121-master-g67a0fccfad
subsidy_cmd.h File Reference

Command definitions related to subsidies. More...

#include "command_type.h"
#include "cargo_type.h"

Go to the source code of this file.

Functions

CommandCost CmdCreateSubsidy (DoCommandFlag flags, CargoID cid, SourceType src_type, SourceID src, SourceType dst_type, SourceID dst)
 Create a new subsidy. More...
 

Detailed Description

Command definitions related to subsidies.

Definition in file subsidy_cmd.h.

Function Documentation

◆ CmdCreateSubsidy()

CommandCost CmdCreateSubsidy ( DoCommandFlag  flags,
CargoID  cid,
SourceType  src_type,
SourceID  src,
SourceType  dst_type,
SourceID  dst 
)

Create a new subsidy.

Parameters
flagstype of operation
cidCargoID of subsidy.
src_typeSourceType of source.
srcSourceID of source.
dst_typeSourceType of destination.
dstSourceID of destination.
Returns
the cost of this operation or an error

Definition at line 244 of file subsidy.cpp.

References _current_company, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_subsidy_pool >::CanAllocateItem(), CMD_ERROR, CreateSubsidy(), DC_EXEC, CargoSpec::Get(), Industry, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_town_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::IsValidID(), NUM_CARGO, OWNER_DEITY, and Town.