]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make bots automatically pass you the flag if you send them a request (so if you ...
authorSamual <samual@xonotic.org>
Sun, 1 Apr 2012 00:33:32 +0000 (20:33 -0400)
committerSamual <samual@xonotic.org>
Sun, 1 Apr 2012 00:33:32 +0000 (20:33 -0400)
qcsrc/server/mutators/gamemode_ctf.qc

index 6b731955bf2b10a31fba3a0432ea1600bb429cb5..7345766f97b23c9db1dabddd2053d8827ae2f720 100644 (file)
@@ -977,8 +977,16 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
                                {
                                        if(autocvar_g_ctf_pass_request && !player.flagcarried && head.flagcarried) 
                                        { 
-                                               centerprint(head, strcat(player.netname, " requests you to pass the ", head.flagcarried.netname)); 
-                                               centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname)); 
+                                               if(clienttype(head) == CLIENTTYPE_BOT)
+                                               {
+                                                       centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname)); 
+                                                       ctf_Handle_Throw(head, player, DROPTYPE_PASS);
+                                               }
+                                               else
+                                               {
+                                                       centerprint(head, strcat(player.netname, " requests you to pass the ", head.flagcarried.netname)); 
+                                                       centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname)); 
+                                               }
                                                player.throw_antispam = time + autocvar_g_ctf_pass_wait; 
                                                return 0; 
                                        }