]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/scripting.qc
fix a duplicate variable name
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / scripting.qc
index e540a438d55f07e88cccb96126ed3830290d46bd..665b23c85a00c758e58c2103355b918e39161be1 100644 (file)
@@ -21,6 +21,28 @@ void bot_queuecommand(entity bot, string cmdstring)
        }
 
        bufstr_set(bot.bot_cmdqueuebuf, bot.bot_cmdqueuebuf_end, cmdstring);
+
+       // if the command was a "sound" command, precache the sound NOW
+       // this prevents lagging!
+       {
+               float sp;
+               string parm;
+               string cmdstr;
+
+               sp = strstrofs(cmdstr, " ", 0);
+               if(sp < 0)
+               {
+                       parm = "";
+               }
+               else
+               {
+                       parm = substring(cmdstr, sp + 1, -1);
+                       cmdstr = substring(cmdstr, 0, sp);
+               }
+               if(cmdstr == "sound")
+                       precache_sound(cmdstr);
+       }
+
        bot.bot_cmdqueuebuf_end += 1;
 }