1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-02-01 08:34:34 +01:00

Codefix: too many or too few documented parameters

This commit is contained in:
Rubidium
2026-01-29 22:33:16 +01:00
committed by rubidium42
parent 79588cbfe3
commit a42ba2493e
3 changed files with 13 additions and 4 deletions

View File

@@ -250,7 +250,13 @@ void CommandHelperBase::InternalPostResult(CommandCost &res, TileIndex tile, boo
}
}
/** Helper to make a desync log for a command. */
/**
* Helper to make a desync log for a command.
* @param cmd The executed command.
* @param err_message The error messages of the command.
* @param args The encoded arguments of the command.
* @param failed Whether the command failed.
*/
void CommandHelperBase::LogCommandExecution(Commands cmd, StringID err_message, const CommandDataBuffer &args, bool failed)
{
Debug(desync, 1, "{}: {:08x}; {:02x}; {:02x}; {:08x}; {:08x}; {} ({})", failed ? "cmdf" : "cmd", (uint32_t)TimerGameEconomy::date.base(), TimerGameEconomy::date_fract, _current_company, cmd, err_message, FormatArrayAsHex(args), GetCommandName(cmd));
@@ -326,7 +332,7 @@ std::tuple<bool, bool, bool> CommandHelperBase::InternalExecuteValidateTestAndPr
* @param cmd Command that was executed.
* @param cmd_flags Command flags.
* @param res_test Command result of test run.
* @param tes_exec Command result of real run.
* @param res_exec Command result of real run.
* @param extra_cash Additional cash required for successful command execution.
* @param tile Tile of command execution.
* @param[in,out] cur_company Backup of current company at start of command execution.

View File

@@ -216,7 +216,6 @@ public:
/**
* Prepare a command to be send over the network
* @param cmd The command to execute (a CMD_* value)
* @param err_message Message prefix to show on error
* @param company The company that wants to send the command
* @param args Parameters for the command
@@ -459,6 +458,7 @@ struct CommandHelper<Tcmd, Tret(*)(DoCommandFlags, Targs...), false> : CommandHe
* commands that don't take a TileIndex by themselves.
* @param err_message Message prefix to show on error
* @param callback A callback function to call after the command is finished
* @param location Tile location for user feedback.
* @param args Parameters for the command
* @return \c true if the command succeeded, else \c false.
*/

View File

@@ -38,6 +38,8 @@ public:
/**
* Creates a command return value with one, or optionally two, error message strings.
* @param msg The error message.
* @param extra_msg Optional secondary error message.
*/
explicit CommandCost(StringID msg, StringID extra_msg = INVALID_STRING_ID) : cost(0), message(msg), expense_type(INVALID_EXPENSES), success(false), extra_message(extra_msg) {}
@@ -57,6 +59,7 @@ public:
/**
* Set the 'owner' (the originator) of this error message. This is used to show a company owner's face if you
* attempt an action on something owned by other company.
* @param owner The owner.
*/
inline void SetErrorOwner(Owner owner)
{
@@ -85,6 +88,7 @@ public:
/**
* Get the originator owner for this error.
* @return The owner.
*/
inline CompanyID GetErrorOwner() const
{
@@ -499,7 +503,6 @@ typedef void CommandCallback(Commands cmd, const CommandCost &result, TileIndex
*
* @param cmd The command that was executed
* @param result The result of the executed command
* @param tile The tile of the command action
* @param data Additional data of the command
* @param result_data Additional returned data from the command
*/