]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clean up: add Send_CSQC_Centerprint_Generic_Expire
authorterencehill <piuntn@gmail.com>
Sun, 19 Jun 2011 14:08:59 +0000 (16:08 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 19 Jun 2011 14:08:59 +0000 (16:08 +0200)
qcsrc/server/cl_client.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/w_minstanex.qc

index 0f22be6d85c053bdb590b6170697b1e178eb4439..49a050f643647caf3b33efca859aae70d994e7f4 100644 (file)
@@ -2452,7 +2452,7 @@ void LeaveSpectatorMode()
                                bprint ("^4", self.netname, "^4 is playing now\n");
 
                        if(!autocvar_g_campaign)
-                               Send_CSQC_Centerprint_Generic(self, CPID_MOTD, "", 1, 0); // clear MOTD
+                               Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD); // clear MOTD
 
                        return;
                } else {
@@ -2703,7 +2703,7 @@ void PlayerPreThink (void)
                                        self.motd_actived_time = time;
                                else if (time - self.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
                                        self.motd_actived_time = 0;
-                                       Send_CSQC_Centerprint_Generic(self, CPID_MOTD, "", 1, 0);
+                                       Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD);
                                }
                        }
                } else {
@@ -2712,7 +2712,7 @@ void PlayerPreThink (void)
                                        self.motd_actived_time = time;
                                else if (time - self.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
                                        self.motd_actived_time = 0;
-                                       Send_CSQC_Centerprint_Generic(self, CPID_MOTD, "", 1, 0);
+                                       Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD);
                                }
                        }
                }
index 8ffe1b7c47229a455e2c0259ba0924c300eb7d7d..6bf881935e6315f26d678281259759d61376d8b1 100644 (file)
@@ -158,7 +158,7 @@ void timeoutHandler_Think() {
                        //get rid of the countdown message
                        FOR_EACH_REALCLIENT(plr) {
                                if(plr.classname == "player") {
-                                       Send_CSQC_Centerprint_Generic(plr, CPID_TIMEOUT_COUNTDOWN, "", 1, 0);
+                                       Send_CSQC_Centerprint_Generic_Expire(plr, CPID_TIMEOUT_COUNTDOWN);
                                }
                        }
                        remove(self);
@@ -169,7 +169,7 @@ void timeoutHandler_Think() {
        else if (timeoutStatus == 0) { //if a player called the resumegame command (which set timeoutStatus to 0 already)
                FOR_EACH_REALCLIENT(plr) {
                        if(plr.classname == "player") {
-                               Send_CSQC_Centerprint_Generic(plr, CPID_TIMEOUT_COUNTDOWN, "", 1, 0);
+                               Send_CSQC_Centerprint_Generic_Expire(plr, CPID_TIMEOUT_COUNTDOWN);
                        }
                }
                remove(self);
index 46b6952b9a3d1cd0c7f0f4e1285646522ed9e3ae..859b367830e44efc8efd3aee3b8f5fe2de35ea8e 100644 (file)
@@ -1674,6 +1674,10 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s1, float duration
                });
        }
 }
+void Send_CSQC_Centerprint_Generic_Expire(entity e, float id)
+{
+       Send_CSQC_Centerprint_Generic(e, id, "", 1, 0);
+}
 // WARNING: this kills the trace globals
 #define EXACTTRIGGER_TOUCH if(WarpZoneLib_ExactTrigger_Touch()) return
 #define EXACTTRIGGER_INIT  WarpZoneLib_ExactTrigger_Init()
index bd4b3d5d718f4cdf5de7811e6126dc39460066f0..540530dd9869f8461789b225fc8b1350bc305815 100644 (file)
@@ -882,7 +882,7 @@ void kh_EnableTrackingDevice()  // runs after each round
 
        FOR_EACH_PLAYER(player)
                if(clienttype(player) == CLIENTTYPE_REAL)
-                       Send_CSQC_Centerprint_Generic(player, CPID_KH_MSG, "", 1, 0);
+                       Send_CSQC_Centerprint_Generic_Expire(player, CPID_KH_MSG);
 
        kh_tracking_enabled = TRUE;
 }
@@ -908,7 +908,7 @@ void kh_StartRound()  // runs at the start of each round
 
        FOR_EACH_PLAYER(player)
                if(clienttype(player) == CLIENTTYPE_REAL)
-                       Send_CSQC_Centerprint_Generic(player, CPID_KH_MSG, "", 1, 0);
+                       Send_CSQC_Centerprint_Generic_Expire(player, CPID_KH_MSG);
 
        for(i = 0; i < kh_teams; ++i)
        {
index 2b7f7aa053dd249583562b9003ce5d5aab6926e5..403c7acd510acb51bdae894be8b979e6667faea7 100644 (file)
@@ -94,7 +94,7 @@ void minstagib_stop_countdown(void)
        if (self.minstagib_needammo)
        {
                self.health = 100;
-               Send_CSQC_Centerprint_Generic(self, CPID_MINSTA_FINDAMMO, "", 1, 0);
+               Send_CSQC_Centerprint_Generic_Expire(self, CPID_MINSTA_FINDAMMO);
        }
        self.minstagib_needammo = FALSE;
 }