summaryrefslogtreecommitdiff
path: root/src/subsidy.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-11-23 01:05:58 +0100
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commit13528bfcd0f11d738ec23409e26052e70dd233f6 (patch)
tree7f549fb59e365e6bc9b4a9f05b692ddbd94be38e /src/subsidy.cpp
parent58cff7b081ce9ea4b5314cf8324ca60607389d15 (diff)
downloadopenttd-13528bfcd0f11d738ec23409e26052e70dd233f6.tar.xz
Codechange: Un-bitstuff all remaining commands.
Diffstat (limited to 'src/subsidy.cpp')
-rw-r--r--src/subsidy.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/subsidy.cpp b/src/subsidy.cpp
index 992c7a672..0c32dbcf1 100644
--- a/src/subsidy.cpp
+++ b/src/subsidy.cpp
@@ -232,27 +232,17 @@ void CreateSubsidy(CargoID cid, SourceType src_type, SourceID src, SourceType ds
/**
* Create a new subsidy.
* @param flags type of operation
- * @param tile unused.
- * @param p1 various bitstuffed elements
- * - p1 = (bit 0 - 7) - SourceType of source.
- * - p1 = (bit 8 - 23) - SourceID of source.
- * - p1 = (bit 24 - 31) - CargoID of subsidy.
- * @param p2 various bitstuffed elements
- * - p2 = (bit 0 - 7) - SourceType of destination.
- * - p2 = (bit 8 - 23) - SourceID of destination.
- * @param text unused.
+ * @param cid CargoID of subsidy.
+ * @param src_type SourceType of source.
+ * @param src SourceID of source.
+ * @param dst_type SourceType of destination.
+ * @param dst SourceID of destination.
* @return the cost of this operation or an error
*/
-CommandCost CmdCreateSubsidy(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
+CommandCost CmdCreateSubsidy(DoCommandFlag flags, CargoID cid, SourceType src_type, SourceID src, SourceType dst_type, SourceID dst)
{
if (!Subsidy::CanAllocateItem()) return CMD_ERROR;
- CargoID cid = GB(p1, 24, 8);
- SourceType src_type = (SourceType)GB(p1, 0, 8);
- SourceID src = GB(p1, 8, 16);
- SourceType dst_type = (SourceType)GB(p2, 0, 8);
- SourceID dst = GB(p2, 8, 16);
-
if (_current_company != OWNER_DEITY) return CMD_ERROR;
if (cid >= NUM_CARGO || !::CargoSpec::Get(cid)->IsValid()) return CMD_ERROR;