X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcommon.qh;h=13cbfe49e127ece70856a11fcd58f670c5750fa6;hb=8f4e38f34794f44d2ea707ca4b836d88b0a39c3d;hp=b79a570209ff46f7c0f2a10f73634443034cc0d3;hpb=109c5785a22fb4336ac5e91d5f1fa91678582164;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/common.qh b/qcsrc/server/command/common.qh index b79a57020..13cbfe49e 100644 --- a/qcsrc/server/command/common.qh +++ b/qcsrc/server/command/common.qh @@ -1,6 +1,6 @@ #pragma once -#include +#include REGISTRY(COMMON_COMMANDS, BITS(7)) #define COMMON_COMMANDS_from(i) _COMMON_COMMANDS_from(i, NULL) REGISTER_REGISTRY(COMMON_COMMANDS) @@ -15,14 +15,13 @@ REGISTRY_SORT(COMMON_COMMANDS) METHOD(commoncommand_##id, m_invokecmd, void(commoncommand_##id this, int request, entity caller, int arguments, string command)) STATIC_INIT(COMMON_COMMANDS_aliases) { - FOREACH(COMMON_COMMANDS, true, LAMBDA(localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svcmd")))); + FOREACH(COMMON_COMMANDS, true, { localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svcmd")); }); } #include "vote.qh" -#include +#include -#include -#include +#include // ============================================================ // Shared declarations for server commands, written by Samual @@ -55,7 +54,7 @@ float timeout_status; // (values: 0, 1, 2) contains whether a timeout is not .vector lastV_angle; // used when pausing the game in order to force the player to keep his old view angle fixed // allow functions to be used in other code like g_world.qc and teamplay.qc -void timeout_handler_think(); +void timeout_handler_think(entity this); // used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file void CommonCommand_macro_write_aliases(float fh); @@ -98,9 +97,9 @@ void print_to(entity to, string input); // ========================================== // used by CommonCommand_timeout() and CommonCommand_timein() to handle game pausing and messaging and such. -void timeout_handler_reset(); +void timeout_handler_reset(entity this); -void timeout_handler_think(); +void timeout_handler_think(entity this); // =================================================== // Common commands used in both sv_cmd.qc and cmd.qc @@ -158,30 +157,30 @@ COMMON_COMMAND(who, "Display detailed client information about all players") { C void CommonCommand_macro_help(entity caller) { - FOREACH(COMMON_COMMANDS, true, LAMBDA(print_to(caller, sprintf(" ^2%s^7: %s\n", it.m_name, it.m_description)))); + FOREACH(COMMON_COMMANDS, true, { print_to(caller, sprintf(" ^2%s^7: %s", it.m_name, it.m_description)); }); } float CommonCommand_macro_command(float argc, entity caller, string command) { string c = strtolower(argv(0)); - FOREACH(COMMON_COMMANDS, it.m_name == c, LAMBDA( + FOREACH(COMMON_COMMANDS, it.m_name == c, { it.m_invokecmd(it, CMD_REQUEST_COMMAND, caller, argc, command); return true; - )); + }); return false; } float CommonCommand_macro_usage(float argc, entity caller) { string c = strtolower(argv(1)); - FOREACH(COMMON_COMMANDS, it.m_name == c, LAMBDA( + FOREACH(COMMON_COMMANDS, it.m_name == c, { it.m_invokecmd(it, CMD_REQUEST_USAGE, caller, argc, ""); return true; - )); + }); return false; } void CommonCommand_macro_write_aliases(float fh) { - FOREACH(COMMON_COMMANDS, true, LAMBDA(CMD_Write_Alias("qc_cmd_svcmd", it.m_name, it.m_description))); + FOREACH(COMMON_COMMANDS, true, { CMD_Write_Alias("qc_cmd_svcmd", it.m_name, it.m_description); }); }