]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into terencehill/MOTD_bugfix
authorSamual Lenks <samual@xonotic.org>
Mon, 22 Apr 2013 20:25:55 +0000 (16:25 -0400)
committerSamual Lenks <samual@xonotic.org>
Mon, 22 Apr 2013 20:25:55 +0000 (16:25 -0400)
1  2 
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh

index 0ef81002416112d5ec02049983080c9a0af0a427,04cb61cb4cfadcac3623033aa3b24e1fbe9ee1b8..b61fbfa913bb7e6612fc4f60f91d1081601aae95
@@@ -6,22 -6,6 +6,6 @@@ void send_CSQC_teamnagger() 
        WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
  }
  
- void Announce(string snd) {
-       WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
-       WriteByte(MSG_BROADCAST, TE_CSQC_ANNOUNCE);
-       WriteString(MSG_BROADCAST, snd);
- }
- void AnnounceTo(entity e, string snd) {
-       if (clienttype(e) == CLIENTTYPE_REAL)
-       {
-               msg_entity = e;
-               WriteByte(MSG_ONE, SVC_TEMPENTITY);
-               WriteByte(MSG_ONE, TE_CSQC_ANNOUNCE);
-               WriteString(MSG_ONE, snd);
-       }
- }
  float ClientData_Send(entity to, float sf)
  {
        if(to != self.owner)
@@@ -401,7 -385,6 +385,6 @@@ void PutObserverInServer (void
                WriteEntity(MSG_ONE, self);
        }
  
-       DropAllRunes(self);
        MUTATOR_CALLHOOK(MakePlayerObserver);
  
        minstagib_stop_countdown(self);
        self.think = func_null;
        self.nextthink = 0;
        self.hook_time = 0;
-       self.runes = 0;
        self.deadflag = DEAD_NO;
        self.angles = spot.angles;
        self.angles_z = 0;
@@@ -807,8 -789,6 +789,6 @@@ void PutClientInServer (void
  
                self.metertime = 0;
  
-               self.runes = 0;
                self.deadflag = DEAD_NO;
  
                self.angles = spot.angles;
@@@ -1151,7 -1131,7 +1131,7 @@@ void KillIndicator_Think(
                if(clienttype(self.owner) == CLIENTTYPE_REAL)
                {
                        if(self.cnt <= 10)
-                               AnnounceTo(self.owner, strcat(ftos(self.cnt), ""));
+                               { Send_Notification(NOTIF_ONE, self.owner, MSG_ANNCE, Announcer_PickNumber(self.cnt)); }
                }
                self.nextthink = time + 1;
                self.cnt -= 1;
@@@ -1529,12 -1509,6 +1509,12 @@@ void ClientConnect (void
  
        if(clienttype(self) == CLIENTTYPE_REAL)
        {
 +              if(!autocvar_g_campaign)
 +              {
 +                      self.motd_actived_time = -1;
 +                      Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
 +              }
 +
                if(autocvar_g_bugrigs || WEPSET_EQ_AW(g_weaponarena_weapons, WEP_TUBA))
                        stuffcmd(self, "cl_cmd settemp chase_active 1\n");
        }
  
        CheatInitClient();
  
 -      if(!autocvar_g_campaign)
 -              Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
 -
        CSQCMODEL_AUTOINIT();
  
        self.model_randomizer = random();
@@@ -1640,7 -1617,6 +1620,6 @@@ void ClientDisconnect (void
                
        Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_DISCONNECT, self.netname);
  
-       DropAllRunes(self);
        MUTATOR_CALLHOOK(ClientDisconnect);
  
        Portal_ClearAll(self);
@@@ -2014,32 -1990,6 +1993,6 @@@ void player_regen (void
  
        max_mod = regen_mod = rot_mod = limit_mod = 1;
  
-       if (self.runes & RUNE_REGEN)
-       {
-               if (self.runes & CURSE_VENOM) // do we have both rune/curse?
-               {
-                       regen_mod = autocvar_g_balance_rune_regen_combo_regenrate;
-                       max_mod = autocvar_g_balance_rune_regen_combo_hpmod;
-                       limit_mod = autocvar_g_balance_rune_regen_combo_limitmod;
-               }
-               else
-               {
-                       regen_mod = autocvar_g_balance_rune_regen_regenrate;
-                       max_mod = autocvar_g_balance_rune_regen_hpmod;
-                       limit_mod = autocvar_g_balance_rune_regen_limitmod;
-               }
-       }
-       else if (self.runes & CURSE_VENOM)
-       {
-               max_mod = autocvar_g_balance_curse_venom_hpmod;
-               if (self.runes & RUNE_REGEN) // do we have both rune/curse?
-                       rot_mod = autocvar_g_balance_rune_regen_combo_rotrate;
-               else
-                       rot_mod = autocvar_g_balance_curse_venom_rotrate;
-               limit_mod = autocvar_g_balance_curse_venom_limitmod;
-               //if (!self.runes & RUNE_REGEN)
-               //      rot_mod = autocvar_g_balance_curse_venom_rotrate;
-       }
        maxh = maxh * max_mod;
        //maxa = maxa * max_mod;
        //maxf = maxf * max_mod;
@@@ -2319,7 -2269,7 +2272,7 @@@ void ShowRespawnCountdown(
                {
                        self.respawn_countdown = number - 1;
                        if(ceil(self.respawn_time - (time + 0.5)) == number) // only say it if it is the same number even in 0.5s; to prevent overlapping sounds
-                               AnnounceTo(self, strcat(ftos(number), ""));
+                               Send_Notification(NOTIF_ONE, self, MSG_ANNCE, Announcer_PickNumber(number)); 
                }
        }
  }
@@@ -2337,9 -2287,11 +2290,9 @@@ void LeaveSpectatorMode(
  
                        if(autocvar_g_campaign)
                                { campaign_bots_may_start = 1; }
 -                      else
 -                              { Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_MOTD); }
  
                        Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_PREVENT_JOIN);
 -                      
 +
                        PutClientInServer();
  
                        if(IS_PLAYER(self)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_JOIN_PLAY, self.netname); }
        else
        {
                // Player may not join because g_maxplayers is set
 -              Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_PREVENT_JOIN);
 +              Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_PREVENT);
        }
  }
  
@@@ -2406,24 -2358,22 +2359,24 @@@ void checkSpectatorBlock() 
        }
  }
  
 -.float motd_actived_time; // used for both motd and campaign_message
  void PrintWelcomeMessage()
  {
 -      if (self.motd_actived_time == 0) { // is there already a message showing?
 +      if(self.motd_actived_time == 0)
 +      {
                if (autocvar_g_campaign) {
                        if ((self.classname == "player" && self.BUTTON_INFO) || (self.classname != "player")) {
                                self.motd_actived_time = time;
                                Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, campaign_message);
                        }
                } else {
 -                      if ((time - self.jointime > autocvar_welcome_message_time) && self.BUTTON_INFO) {
 +                      if (self.BUTTON_INFO) {
                                self.motd_actived_time = time;
                                Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
                        }
                }
 -      } else { // showing MOTD or campaign message
 +      }
 +      else if(self.motd_actived_time > 0) // showing MOTD or campaign message
 +      {
                if (autocvar_g_campaign) {
                        if (self.BUTTON_INFO)
                                self.motd_actived_time = time;
                                Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_MOTD);
                        }
                } else {
 -                      if ((time - self.jointime) > autocvar_welcome_message_time) {
 -                              if (self.BUTTON_INFO)
 -                                      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;
 -                                      Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_MOTD);
 -                              }
 +                      if (self.BUTTON_INFO)
 +                              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;
 +                              Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_MOTD);
                        }
                }
        }
 +      else //if(self.motd_actived_time < 0) // just connected, motd is active
 +      {
 +              if(self.BUTTON_INFO) // BUTTON_INFO hides initial MOTD
 +                      self.motd_actived_time = -2; // wait until BUTTON_INFO gets released
 +              else if(self.motd_actived_time == -2 || IS_PLAYER(self) || time - self.jointime > autocvar_welcome_message_time)
 +              {
 +                      // instanctly hide MOTD
 +                      self.motd_actived_time = 0;
 +                      Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_MOTD);
 +              }
 +      }
  }
  
  void ObserverThink()
                        }
                }
        }
 -
 -      PrintWelcomeMessage();
  }
  
  void SpectatorThink()
                        PutObserverInServer();
        }
  
 -      PrintWelcomeMessage();
        self.flags |= FL_CLIENT | FL_NOTARGET;
  }
  
@@@ -2639,10 -2583,11 +2592,10 @@@ void PlayerPreThink (void
                self.usekeypressed = self.BUTTON_USE;
        }
  
 -      PrintWelcomeMessage();
 +      if(clienttype(self) == CLIENTTYPE_REAL)
 +              PrintWelcomeMessage();
  
        if(self.classname == "player") {
 -//            if(self.netname == "Wazat")
 -//                    bprint(self.classname, "\n");
  
                CheckRules_Player();
  
@@@ -2995,7 -2940,7 +2948,7 @@@ void PlayerPostThink (void
                        else if(timeleft <= 10)
                        {
                                if(timeleft != self.idlekick_lasttimeleft)
-                                       AnnounceTo(self, ftos(timeleft));
+                                       Send_Notification(NOTIF_ONE, self, MSG_ANNCE, Announcer_PickNumber(timeleft));
                                self.idlekick_lasttimeleft = timeleft;
                        }
                }
diff --combined qcsrc/server/defs.qh
index 7f7e3b4578c14192ac400d9a457b229acc64449b,d580a30d505ba4c57c7768d2113ba7aace0420e0..a7cd80136676b4ad3a9362776c6065c8c7d6dfaf
@@@ -215,9 -215,6 +215,6 @@@ float intermission_running
  float intermission_exittime;
  float alreadychangedlevel;
  
- .float runes;
  // Keys player is holding
  .float itemkeys;
  // message delay for func_door locked by keys and key locks
@@@ -242,9 -239,9 +239,9 @@@ float game_completion_ratio; // 0 at st
  .float winning;
  .float jointime; // time of joining
  .float alivetime; // time of being alive
 +.float motd_actived_time; // used for both motd and campaign_message
  
  float nJoinAllowed(entity ignore);
 -#define PREVENT_JOIN_TEXT "^1You may not join the game at this time.\n\nThe player limit reached maximum capacity."
  
  .float spawnshieldtime;
  
@@@ -284,9 -281,6 +281,6 @@@ float default_weapon_alpha
  .float cvar_cl_allow_uidtracking;
  .string stored_netname;
  
- void Announce(string snd);
- void AnnounceTo(entity e, string snd);
  .float version_nagtime;
  
  #define NUM_JUMPPADSUSED 3
@@@ -297,9 -291,6 +291,6 @@@ string gamemode_name
  
  float startitem_failed;
  
- void DropAllRunes(entity pl);
  typedef .float floatfield;
  floatfield Item_CounterField(float it);