Skip to content

Commit 3422d53

Browse files
committed
Exported GetCommandIndex as commands.get_command_index.
1 parent 50ae599 commit 3422d53

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: addons/source-python/packages/source-python/commands/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from _commands import CommandReturn
2020
from _commands import ConCommand
2121
from _commands import ConCommandBase
22+
from _commands import get_command_index
2223

2324

2425
# =============================================================================
@@ -28,6 +29,7 @@
2829
'CommandReturn',
2930
'ConCommand',
3031
'ConCommandBase',
32+
'get_command_index',
3133
)
3234

3335

Diff for: src/core/modules/commands/commands_wrap.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ extern void ClearAllServerCommands();
4545
extern void RegisterSayCommands();
4646
extern void UnregisterSayCommands();
4747

48+
extern int GetCommandIndex();
4849

4950
//-----------------------------------------------------------------------------
5051
// Initializes the Server and Say command modules.
@@ -92,6 +93,11 @@ DECLARE_SP_MODULE(_commands)
9293
export_command_return(_commands);
9394
export_concommandbase(_commands);
9495
export_concommand(_commands);
96+
97+
def("get_command_index",
98+
&GetCommandIndex,
99+
"Returns the index of the player that issued the current command."
100+
);
95101
}
96102

97103

0 commit comments

Comments
 (0)