]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/scripting.qc
Merge branch 'master' into Mario/race_target_waypoint
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / scripting.qc
index 252708a1189f0401c7af68b0ff4ff047759e1950..7f6e17f5e4c53ea85eea0fa9eb259fe8af3919f5 100644 (file)
@@ -311,6 +311,11 @@ float bot_decodecommand(string cmdstring)
                                bot_cmd.bot_cmd_parm_string = strzone(parm);
                                break;
                        case BOT_CMD_PARAMETER_VECTOR:
+                               if(substring(parm, 0, 1) != "\'")
+                               {
+                                       LOG_INFOF("ERROR: expected vector type \'x y z\', got %s\n", parm);
+                                       return 0;
+                               }
                                bot_cmd.bot_cmd_parm_vector = stov(parm);
                                break;
                        default:
@@ -377,7 +382,7 @@ void bot_cmdhelp(string scmd)
                                LOG_INFO("Look to the right or left N degrees. For turning to the left use positive numbers.");
                                break;
                        case BOT_CMD_MOVETO:
-                               LOG_INFO("Walk to an specific coordinate on the map. Usage: moveto \"x y z\"");
+                               LOG_INFO("Walk to an specific coordinate on the map. Usage: moveto \'x y z\'");
                                break;
                        case BOT_CMD_MOVETOTARGET:
                                LOG_INFO("Walk to the specific target on the map");
@@ -486,6 +491,7 @@ float bot_cmd_impulse(entity this)
 
 float bot_cmd_continue(entity this)
 {
+       bot_relinkplayerlist();
        this.bot_exec_status &= ~BOT_EXEC_STATUS_PAUSED;
        return CMD_STATUS_FINISHED;
 }
@@ -883,7 +889,7 @@ float bot_cmd_keypress_handler(entity this, string key, float enabled)
        {
                case "all":
                        if(enabled)
-                               this.bot_cmd_keys = power2of(20) - 1; // >:)
+                               this.bot_cmd_keys = (2 ** 20) - 1; // >:)
                        else
                                this.bot_cmd_keys = BOT_CMD_KEY_NONE;
                case "forward":
@@ -1005,6 +1011,7 @@ float bot_cmd_pause(entity this)
        this.movement = '0 0 0';
        this.bot_cmd_keys = BOT_CMD_KEY_NONE;
 
+       bot_clear(this);
        this.bot_exec_status |= BOT_EXEC_STATUS_PAUSED;
        return CMD_STATUS_FINISHED;
 }