MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 2 | #include <commands.h> |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 3 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 4 | mixed * command_stack(void) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 5 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 6 | DESCRIPTION |
| 7 | Return an array describing the current command stack. The array has |
| 8 | command_stack_depth() entries, the first describing the top-level |
| 9 | command, and the last describing the current one. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 10 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 11 | Each entry is an array itself with these entries: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 12 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 13 | string [CMD_VERB]: the verb of this command |
| 14 | string [CMD_TEXT]: the full command text |
| 15 | object [CMD_ORIGIN]: the original command giver |
| 16 | object [CMD_PLAYER]: the current command giver |
| 17 | mixed [CMD_FAIL]: the notify_fail setting (or 0). |
| 18 | mixed [CMD_FAILOBJ]: the object which set the notify_fail setting. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 19 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 20 | CMD_ORIGIN and CMD_PLAYER are usually the same; there is a difference |
| 21 | only if the modify_command hook changes the command giver with |
| 22 | set_this_player(). |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 23 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 24 | Note that any of the entries may be returned as 0. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 25 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 26 | HISTORY |
| 27 | Introduced in LDMud 3.2.7. |
| 28 | LDMud 3.2.8 added the CMD_FAILOBJ result. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 29 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 30 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 31 | command(E), command_stack_depth(E), notify_fail(E) |