From 3422d532e3600423fb2eb300605dc1ef42a3d33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordan=20Bri=C3=A8re?= Date: Sun, 16 Oct 2022 00:34:09 -0400 Subject: [PATCH] Exported GetCommandIndex as commands.get_command_index. --- .../packages/source-python/commands/__init__.py | 2 ++ src/core/modules/commands/commands_wrap.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/addons/source-python/packages/source-python/commands/__init__.py b/addons/source-python/packages/source-python/commands/__init__.py index 1327b790b..c0f901a4d 100644 --- a/addons/source-python/packages/source-python/commands/__init__.py +++ b/addons/source-python/packages/source-python/commands/__init__.py @@ -19,6 +19,7 @@ from _commands import CommandReturn from _commands import ConCommand from _commands import ConCommandBase +from _commands import get_command_index # ============================================================================= @@ -28,6 +29,7 @@ 'CommandReturn', 'ConCommand', 'ConCommandBase', + 'get_command_index', ) diff --git a/src/core/modules/commands/commands_wrap.cpp b/src/core/modules/commands/commands_wrap.cpp index e07045fbd..582cd3187 100644 --- a/src/core/modules/commands/commands_wrap.cpp +++ b/src/core/modules/commands/commands_wrap.cpp @@ -45,6 +45,7 @@ extern void ClearAllServerCommands(); extern void RegisterSayCommands(); extern void UnregisterSayCommands(); +extern int GetCommandIndex(); //----------------------------------------------------------------------------- // Initializes the Server and Say command modules. @@ -92,6 +93,11 @@ DECLARE_SP_MODULE(_commands) export_command_return(_commands); export_concommandbase(_commands); export_concommand(_commands); + + def("get_command_index", + &GetCommandIndex, + "Returns the index of the player that issued the current command." + ); }