]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Lyberta/TeamplayFixes_
authorLyberta <lyberta@lyberta.net>
Sun, 2 Apr 2017 14:57:47 +0000 (17:57 +0300)
committerLyberta <lyberta@lyberta.net>
Sun, 2 Apr 2017 14:57:47 +0000 (17:57 +0300)
1  2 
qcsrc/server/client.qc
qcsrc/server/mutators/events.qh

diff --combined qcsrc/server/client.qc
index d85576b2cce988cab71277a579d38238a37967de,168ca84968c5e6fc75422b18fc777880874b3c12..db9b4a8d9b6670a6ee952b5565adfac58008b1a6
@@@ -271,9 -271,7 +271,9 @@@ void PutObserverInServer(entity this
        if (mutator_returnvalue) {
            // mutator prevents resetting teams+score
        } else {
 +              int oldteam = this.team;
                this.team = -1;  // move this as it is needed to log the player spectating in eventlog
 +              MUTATOR_CALLHOOK(Player_ChangedTeam, this, oldteam, this.team); // Lyberta: added hook
          this.frags = FRAGS_SPECTATOR;
          PlayerScore_Clear(this);  // clear scores when needed
      }
@@@ -716,7 -714,7 +716,7 @@@ void PutClientInServer(entity this
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
                        .entity weaponentity = weaponentities[slot];
-                       if(slot == 0)
+                       if(slot == 0 || autocvar_g_weaponswitch_debug == 1)
                                this.(weaponentity).m_switchweapon = w_getbestweapon(this, weaponentity);
                        else
                                this.(weaponentity).m_switchweapon = WEP_Null;
@@@ -2383,6 -2381,13 +2383,13 @@@ void PlayerPreThink (entity this
                                }
                        } else {
                                if (frametime) player_anim(this);
+                               if (this.respawn_flags & RESPAWN_DENY)
+                               {
+                                       STAT(RESPAWN_TIME, this) = 0;
+                                       return;
+                               }
                                bool button_pressed = (PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this));
  
                                switch(this.deadflag)
index f6d9a56b4705e0c30919e06dd690e602834ff44d,8624d26bfa99565a491cc5b40eb1c63e94277cf2..6f5feb87c432fea018e343edfcfa4445632c3841
@@@ -86,14 -86,6 +86,6 @@@ MUTATOR_HOOKABLE(FragCenterMessage, EV_
      /**/
  MUTATOR_HOOKABLE(PlayHitsound, EV_PlayHitsound);
  
- /** called when a weapon sound is about to be played, allows custom paths etc. */
- #define EV_WeaponSound(i, o) \
-     /** sound       */ i(string, MUTATOR_ARGV_0_string) \
-     /** output      */ i(string, MUTATOR_ARGV_1_string) \
-     /**/               o(string, MUTATOR_ARGV_1_string) \
-     /**/
- MUTATOR_HOOKABLE(WeaponSound, EV_WeaponSound);
  /** called when an item model is about to be set, allows custom paths etc. */
  #define EV_ItemModel(i, o) \
      /** model       */ i(string, MUTATOR_ARGV_0_string) \
@@@ -877,9 -869,7 +869,9 @@@ MUTATOR_HOOKABLE(PrepareExplosionByDama
      /**/
  MUTATOR_HOOKABLE(MonsterModel, EV_MonsterModel);
  
 -/**/
 +/**
 + * Called before player changes their team. Return true to block team change.
 + */
  #define EV_Player_ChangeTeam(i, o) \
      /** player */         i(entity, MUTATOR_ARGV_0_entity) \
        /** current team */   i(float, MUTATOR_ARGV_1_float) \
      /**/
  MUTATOR_HOOKABLE(Player_ChangeTeam, EV_Player_ChangeTeam);
  
 +/**
 + * Called after player has changed their team.
 + */
 +#define EV_Player_ChangedTeam(i, o) \
 +    /** player */         i(entity, MUTATOR_ARGV_0_entity) \
 +      /** old team */   i(float, MUTATOR_ARGV_1_float) \
 +      /** current team */       i(float, MUTATOR_ARGV_2_float) \
 +    /**/
 +MUTATOR_HOOKABLE(Player_ChangedTeam, EV_Player_ChangedTeam);
 +
  /**/
  #define EV_URI_GetCallback(i, o) \
        /** id */       i(float, MUTATOR_ARGV_0_float) \