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

diff --combined qcsrc/server/client.qc
index 482dcf3763d422db51d40d4cc764fb99dde9e08c,9d5be4c80f3cb432d32fd3939aedd59327bbb6e8..d85576b2cce988cab71277a579d38238a37967de
@@@ -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
      }
@@@ -1233,6 -1231,8 +1233,8 @@@ void ClientConnect(entity this
                sv_notice_join(this);
  
        // update physics stats (players can spawn before physics runs)
+       STAT(MOVEVARS_HIGHSPEED, this) = autocvar_g_movement_highspeed;
+       MUTATOR_CALLHOOK(PlayerPhysics_UpdateStats, this); // do it BEFORE the function so we can modify highspeed!
        Physics_UpdateStats(this, PHYS_HIGHSPEED(this));
  
        IL_EACH(g_initforplayer, it.init_for_player, {
index 45380e37b62200cdcfeb14c4efae79683b7a1383,89fec0178c7f01c7d00c22d54f0474a38039d449..f6d9a56b4705e0c30919e06dd690e602834ff44d
@@@ -532,10 -532,7 +532,7 @@@ MUTATOR_HOOKABLE(SetWeaponreplace, EV_S
  
  /** called when an item is about to respawn */
  #define EV_Item_RespawnCountdown(i, o) \
-     /** item name */   i(string, MUTATOR_ARGV_0_string) \
-     /**/               o(string, MUTATOR_ARGV_0_string) \
-     /** item colour */ i(vector, MUTATOR_ARGV_1_vector) \
-     /**/               o(vector, MUTATOR_ARGV_1_vector) \
+     /** item */   i(entity, MUTATOR_ARGV_0_entity) \
      /**/
  MUTATOR_HOOKABLE(Item_RespawnCountdown, EV_Item_RespawnCountdown);
  
@@@ -880,9 -877,7 +877,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) \
@@@ -960,3 -945,22 +957,22 @@@ enum 
      /** player */ i(entity, MUTATOR_ARGV_0_entity) \
      /**/
  MUTATOR_HOOKABLE(HideTeamNagger, EV_HideTeamNagger);
+ /** return true to show a waypoint while the item is spawning */
+ #define EV_Item_ScheduleRespawn(i, o) \
+     /** item */             i(entity, MUTATOR_ARGV_0_entity) \
+     /** respawn time */     i(float, MUTATOR_ARGV_1_float) \
+     /**/
+ MUTATOR_HOOKABLE(Item_ScheduleRespawn, EV_Item_ScheduleRespawn);
+ /** called before physics stats are set on a player, allows limited early customization */
+ #define EV_PlayerPhysics_UpdateStats(i, o) \
+     /** player */             i(entity, MUTATOR_ARGV_0_entity) \
+     /**/
+ MUTATOR_HOOKABLE(PlayerPhysics_UpdateStats, EV_PlayerPhysics_UpdateStats);
+ /** return true to use your own aim target (or none at all) */
+ #define EV_HavocBot_Aim(i, o) \
+     /** bot */ i(entity, MUTATOR_ARGV_0_entity) \
+     /**/
+ MUTATOR_HOOKABLE(HavocBot_Aim, EV_HavocBot_Aim);