summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-11-02 21:34:39 +0100
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commit4f3ea3907e23428461c626b6c861d834b358bc9f (patch)
treef60f17d713ed155a738adb469eed7f4262ffbe3c /src/command.cpp
parentccefa76a4686581b8d1a9bd13d7d754807a9f8d1 (diff)
downloadopenttd-4f3ea3907e23428461c626b6c861d834b358bc9f.tar.xz
Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID).
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 9997a66fe..08fe7b265 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -75,15 +75,13 @@ int RecursiveCommandCounter::_counter = 0;
* the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
*/
struct CommandInfo {
- CommandProc *proc; ///< The procedure to actually executing
const char *name; ///< A human readable name for the procedure
CommandFlags flags; ///< The (command) flags to that apply to this command
CommandType type; ///< The type of command.
};
/* Helpers to generate the master command table from the command traits. */
-
template <typename T>
-inline constexpr CommandInfo CommandFromTrait() noexcept { return { T::proc, T::name, T::flags, T::type }; };
+inline constexpr CommandInfo CommandFromTrait() noexcept { return { T::name, T::flags, T::type }; };
template<typename T, T... i>
inline constexpr auto MakeCommandsFromTraits(std::integer_sequence<T, i...>) noexcept {
@@ -101,14 +99,14 @@ static constexpr auto _command_proc_table = MakeCommandsFromTraits(std::make_int
/*!
- * This function range-checks a cmd, and checks if the cmd is not nullptr
+ * This function range-checks a cmd.
*
* @param cmd The integer value of a command
* @return true if the command is valid (and got a CommandProc function)
*/
bool IsValidCommand(Commands cmd)
{
- return cmd < _command_proc_table.size() && _command_proc_table[cmd].proc != nullptr;
+ return cmd < _command_proc_table.size();
}
/*!