X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fdefault%2Fscripting.qc;h=5a13330652f576268b6ce42a2939716d4517a66f;hb=bee54f50a9b23fa73a00c4cf4945bff53ce9176c;hp=bad63baa8afe82209567330ae34c31a451fcdde1;hpb=67610c5b92e218cc245c040209c1a79ab6b02758;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/default/scripting.qc b/qcsrc/server/bot/default/scripting.qc index bad63baa8..5a1333065 100644 --- a/qcsrc/server/bot/default/scripting.qc +++ b/qcsrc/server/bot/default/scripting.qc @@ -1,17 +1,15 @@ #include "scripting.qh" -#include -#include -#include -#include -#include "cvars.qh" - -#include #include #include +#include +#include +#include #include - -#include "bot.qh" +#include +#include +#include +#include .int state; @@ -348,7 +346,7 @@ void bot_cmdhelp(string scmd) switch(ntype) { case BOT_CMD_PARAMETER_FLOAT: - stype = "float number"; + stype = "float"; break; case BOT_CMD_PARAMETER_STRING: stype = "string"; @@ -451,17 +449,14 @@ void bot_list_commands() if(!bot_cmds_initialized) bot_commands_init(); - LOG_INFO( - "List of all available commands:\n" - " Command - Parameter Type\n" - ); + LOG_HELP("Bot commands:"); for(i=1;i"); + if (ptype != "none") + LOG_HELP(" ^2", bot_cmd_string[i]," ^7<", ptype, ">"); + else + LOG_HELP(" ^2", bot_cmd_string[i]); } + LOG_HELP("For help about a specific command, type bot_cmd help "); } // Commands code @@ -494,8 +493,8 @@ float bot_cmd_impulse(entity this) float bot_cmd_continue(entity this) { - bot_relinkplayerlist(); this.bot_exec_status &= ~BOT_EXEC_STATUS_PAUSED; + bot_relinkplayerlist(); return CMD_STATUS_FINISHED; } @@ -1001,6 +1000,11 @@ float bot_cmd_releasekey(entity this) return bot_cmd_keypress_handler(this, key,false); } +bool bot_ispaused(entity this) +{ + return(this.bot_exec_status & BOT_EXEC_STATUS_PAUSED); +} + float bot_cmd_pause(entity this) { PHYS_INPUT_BUTTON_DRAG(this) = false; @@ -1015,8 +1019,8 @@ float bot_cmd_pause(entity this) CS(this).movement = '0 0 0'; this.bot_cmd_keys = BOT_CMD_KEY_NONE; - bot_clear(this); this.bot_exec_status |= BOT_EXEC_STATUS_PAUSED; + bot_relinkplayerlist(); return CMD_STATUS_FINISHED; }