Keep feature commands at the end of the command table
interpret_command picks the first entry whose name starts with the typed command. mt_features sat near the top, so /m ran mt_features instead of mob and /mt instead of mto. The four mt_* entries now sit after the original commands; test_cmd_prefix.py checks that no original abbreviation changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
06b96c62d1
commit
3590a06946
@@ -287,10 +287,6 @@ struct command_info cmd_info[] =
|
||||
{
|
||||
{ "!RESERVED!", NULL, 0, POS_DEAD, GM_IMPLEMENTOR }, /* 반드시 이 것이 처음이어야 한다. */
|
||||
{ "autohunt_pull", do_autohunt_pull, 0, POS_STANDING, GM_PLAYER },
|
||||
{ "mt_features", do_port_features, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "mt_switchbot", do_port_switchbot, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "mt_pickup", do_port_pickup, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "mt_chest", do_port_chest, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "bio", do_port_biolog, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "biolog", do_port_biolog, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "server_bonuses", do_server_bonuses, 0, POS_DEAD, GM_PLAYER },
|
||||
@@ -603,6 +599,12 @@ struct command_info cmd_info[] =
|
||||
{ "ds_list", do_ds_list, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "do_clear_affect", do_clear_affect, 0, POS_DEAD, GM_LOW_WIZARD},
|
||||
|
||||
// PORT: feature commands stay at the end: commands are prefix matched in table order, so an entry placed
|
||||
// earlier would take over abbreviations of original commands (/m -> mob, /mt -> mto).
|
||||
{ "mt_features", do_port_features, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "mt_switchbot", do_port_switchbot, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "mt_pickup", do_port_pickup, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "mt_chest", do_port_chest, 0, POS_DEAD, GM_PLAYER },
|
||||
{ "\n", NULL, 0, POS_DEAD, GM_IMPLEMENTOR } /* 반드시 이 것이 마지막이어야 한다. */
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user