]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/speed_var
authorMario <mario.mario@y7mail.com>
Fri, 17 Jul 2020 07:33:02 +0000 (17:33 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 17 Jul 2020 07:33:02 +0000 (17:33 +1000)
1  2 
qcsrc/common/stats.qh
qcsrc/ecs/systems/cl_physics.qc

diff --combined qcsrc/common/stats.qh
index 16204679879de62729bc9cc9a04a2e82ff04508c,9ecac9f7c0bdd0bf2ee59dad460c6beea9905fc0..153ff98d2203ba3051b357c6174ca50b2695071b
@@@ -16,18 -16,16 +16,16 @@@ const int MAX_CL_STATS = 256
  // const int STAT_NAILS = 7;
  // const int STAT_ROCKETS = 8;
  // const int STAT_CELLS = 9;
- // const int STAT_ACTIVEWEAPON = 10;
  // const int STAT_ITEMS = 15; // .items | .items2 << 23 | serverflags << 28
  // const int STAT_VIEWHEIGHT = 16;
  
  #if defined(CSQC)
      #define g_stat_HEALTH getstati(STAT_HEALTH)
-     #define g_stat_ARMOR getstat_int(STAT_ARMOR)
-     #define g_stat_SHELLS getstat_int(STAT_SHELLS)
-     #define g_stat_NAILS getstat_int(STAT_NAILS)
-     #define g_stat_ROCKETS getstat_int(STAT_ROCKETS)
-     #define g_stat_CELLS getstat_int(STAT_CELLS)
-     #define g_stat_ACTIVEWEAPON getstat_int(STAT_ACTIVEWEAPON)
+     #define g_stat_ARMOR getstati(STAT_ARMOR)
+     #define g_stat_SHELLS getstati(STAT_SHELLS)
+     #define g_stat_NAILS getstati(STAT_NAILS)
+     #define g_stat_ROCKETS getstati(STAT_ROCKETS)
+     #define g_stat_CELLS getstati(STAT_CELLS)
      #define g_stat_ITEMS getstat_int(STAT_ITEMS)
      #define g_stat_VIEWHEIGHT getstati(STAT_VIEWHEIGHT)
  #elif defined(SVQC)
      #define stat_NAILS ammo_nails
      #define stat_ROCKETS ammo_rockets
      #define stat_CELLS ammo_cells
-     #define stat_ACTIVEWEAPON weapon
      #define stat_ITEMS items
      #define stat_VIEWHEIGHT view_ofs_z
  #endif
  
  #ifdef SVQC
+ /// all the weapons actually spawned in the map, does not include filtered items
  vector weaponsInMap;
+ /// all the weapons placed by the mapper (weaponreplace applied), ignores most filters
+ vector weaponsInMapAll;
  #endif
  REGISTER_STAT(WEAPONS, vectori)
  REGISTER_STAT(WEAPONSINMAP, vectori, weaponsInMap)
  
@@@ -81,6 -82,7 +82,7 @@@ REGISTER_STAT(NB_METERSTART, float
  /** compressShotOrigin */
  REGISTER_STAT(SHOTORG, int)
  REGISTER_STAT(LEADLIMIT, float, autocvar_leadlimit)
+ REGISTER_STAT(LEADLIMIT_AND_FRAGLIMIT, float, autocvar_leadlimit_and_fraglimit)
  
  REGISTER_STAT(LAST_PICKUP, float)
  REGISTER_STAT(HUD, int)
@@@ -88,6 -90,7 +90,7 @@@ REGISTER_STAT(HIT_TIME, float
  REGISTER_STAT(DAMAGE_DEALT_TOTAL, int)
  REGISTER_STAT(TYPEHIT_TIME, float)
  REGISTER_STAT(SUPERWEAPONS_FINISHED, float)
+ REGISTER_STAT(AIR_FINISHED, float)
  REGISTER_STAT(VEHICLESTAT_HEALTH, int)
  REGISTER_STAT(VEHICLESTAT_SHIELD, int)
  REGISTER_STAT(VEHICLESTAT_ENERGY, int)
@@@ -139,11 -142,13 +142,13 @@@ float autocvar_g_multijump_add
  float autocvar_g_multijump_speed;
  float autocvar_g_multijump_maxspeed;
  float autocvar_g_multijump_dodging = 1;
+ bool autocvar_g_multijump_client = true;
  #endif
  REGISTER_STAT(MULTIJUMP_DODGING, int, autocvar_g_multijump_dodging)
  REGISTER_STAT(MULTIJUMP_MAXSPEED, float, autocvar_g_multijump_maxspeed)
  REGISTER_STAT(MULTIJUMP_ADD, int, autocvar_g_multijump_add)
  REGISTER_STAT(MULTIJUMP_SPEED, float, autocvar_g_multijump_speed)
+ REGISTER_STAT(MULTIJUMP_CLIENT, bool, autocvar_g_multijump_client)
  .int multijump_count;
  REGISTER_STAT(MULTIJUMP_COUNT, int, this.multijump_count)
  REGISTER_STAT(MULTIJUMP, int, autocvar_g_multijump)
@@@ -183,20 -188,30 +188,30 @@@ REGISTER_STAT(BUGRIGS_SPEED_REF, float
  REGISTER_STAT(BUGRIGS_STEER, float, g_bugrigs_steer)
  
  #ifdef SVQC
- int autocvar_sv_gameplayfix_downtracesupportsongroundflag;
- int autocvar_sv_gameplayfix_easierwaterjump;
- int autocvar_sv_gameplayfix_stepdown;
- int autocvar_sv_gameplayfix_stepmultipletimes;
- int autocvar_sv_gameplayfix_unstickplayers;
- int autocvar_sv_gameplayfix_fixedcheckwatertransition;
+ int autocvar_sv_gameplayfix_downtracesupportsongroundflag = 1;
+ int autocvar_sv_gameplayfix_easierwaterjump = 1;
+ int autocvar_sv_gameplayfix_stepdown = 2;
+ float autocvar_sv_gameplayfix_stepdown_maxspeed = 0;
+ int autocvar_sv_gameplayfix_stepmultipletimes = 1;
+ int autocvar_sv_gameplayfix_unstickplayers = 2;
+ int autocvar_sv_gameplayfix_fixedcheckwatertransition = 1;
+ int autocvar_sv_gameplayfix_slidemoveprojectiles = 1;
+ int autocvar_sv_gameplayfix_grenadebouncedownslopes = 1;
+ int autocvar_sv_gameplayfix_noairborncorpse = 1;
+ int autocvar_sv_gameplayfix_noairborncorpse_allowsuspendeditems = 1;
  #endif
  REGISTER_STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, int, autocvar_sv_gameplayfix_downtracesupportsongroundflag)
  REGISTER_STAT(GAMEPLAYFIX_EASIERWATERJUMP, int, autocvar_sv_gameplayfix_easierwaterjump)
  REGISTER_STAT(GAMEPLAYFIX_STEPDOWN, int, autocvar_sv_gameplayfix_stepdown)
+ REGISTER_STAT(GAMEPLAYFIX_STEPDOWN_MAXSPEED, float, autocvar_sv_gameplayfix_stepdown_maxspeed)
  REGISTER_STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, int, autocvar_sv_gameplayfix_stepmultipletimes)
  REGISTER_STAT(GAMEPLAYFIX_UNSTICKPLAYERS, int, autocvar_sv_gameplayfix_unstickplayers)
  REGISTER_STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND, int, autocvar_sv_gameplayfix_upwardvelocityclearsongroundflag)
  REGISTER_STAT(GAMEPLAYFIX_WATERTRANSITION, int, autocvar_sv_gameplayfix_fixedcheckwatertransition)
+ REGISTER_STAT(GAMEPLAYFIX_SLIDEMOVEPROJECTILES, int, autocvar_sv_gameplayfix_slidemoveprojectiles)
+ REGISTER_STAT(GAMEPLAYFIX_GRENADEBOUNCESLOPES, int, autocvar_sv_gameplayfix_grenadebouncedownslopes)
+ REGISTER_STAT(GAMEPLAYFIX_NOAIRBORNCORPSE, int, autocvar_sv_gameplayfix_noairborncorpse)
+ REGISTER_STAT(NOAIRBORNCORPSE_ALLOWSUSPENDED, int, autocvar_sv_gameplayfix_noairborncorpse_allowsuspendeditems)
  
  REGISTER_STAT(MOVEVARS_JUMPSTEP, int, cvar("sv_jumpstep"))
  REGISTER_STAT(NOSTEP, int, cvar("sv_nostep"))
@@@ -228,6 -243,7 +243,7 @@@ bool autocvar_sv_dodging_wall_dodging
  bool autocvar_sv_dodging_air_dodging;
  float autocvar_sv_dodging_maxspeed;
  float autocvar_sv_dodging_air_maxspeed;
+ bool autocvar_sv_dodging_clientselect;
  #endif
  
  #if 0
@@@ -247,6 -263,7 +263,7 @@@ REGISTER_STAT(DODGING_WALL, bool, autoc
  REGISTER_STAT(DODGING_AIR, bool, autocvar_sv_dodging_air_dodging)
  REGISTER_STAT(DODGING_MAXSPEED, float, autocvar_sv_dodging_maxspeed)
  REGISTER_STAT(DODGING_AIR_MAXSPEED, float, autocvar_sv_dodging_air_maxspeed)
+ REGISTER_STAT(DODGING_CLIENTSELECT, bool, autocvar_sv_dodging_clientselect)
  #endif
  /** cvar loopback */
  REGISTER_STAT(DODGING_FROZEN, int, autocvar_sv_dodging_frozen)
@@@ -276,6 -293,11 +293,11 @@@ REGISTER_STAT(WALLJUMP_DELAY, float, au
  REGISTER_STAT(WALLJUMP_FORCE, float, autocvar_g_walljump_force)
  REGISTER_STAT(LASTWJ, float)
  
+ #ifdef SVQC
+ float autocvar_g_bloodloss;
+ #endif
+ REGISTER_STAT(BLOODLOSS, float, autocvar_g_bloodloss)
  // freeze tag, clan arena
  REGISTER_STAT(REDALIVE, int)
  REGISTER_STAT(BLUEALIVE, int)
@@@ -302,9 -324,9 +324,9 @@@ bool autocvar_sv_slick_applygravity
  REGISTER_STAT(SLICK_APPLYGRAVITY, bool, autocvar_sv_slick_applygravity)
  
  #ifdef SVQC
- bool autocvar_sv_vq3compat;
+ bool autocvar_sv_q3defragcompat;
  #endif
- REGISTER_STAT(VQ3COMPAT, bool, autocvar_sv_vq3compat)
+ REGISTER_STAT(Q3DEFRAGCOMPAT, bool, autocvar_sv_q3defragcompat)
  
  #ifdef SVQC
  #include "physics/movetypes/movetypes.qh"
@@@ -318,8 -340,6 +340,8 @@@ bool autocvar_g_shootfromeye
  REGISTER_STAT(SHOOTFROMEYE, bool, autocvar_g_shootfromeye)
  REGISTER_STAT(SHOOTFROMCENTER, bool, autocvar_g_shootfromcenter)
  
 +REGISTER_STAT(MOVEVARS_SPEED, float)
 +
  REGISTER_STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, float)
  REGISTER_STAT(MOVEVARS_AIRCONTROL_PENALTY, float)
  REGISTER_STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, float)
@@@ -327,7 -347,7 +349,7 @@@ REGISTER_STAT(MOVEVARS_AIRSTRAFEACCEL_Q
  REGISTER_STAT(MOVEVARS_AIRCONTROL_POWER, float)
  REGISTER_STAT(MOVEVARS_AIRCONTROL_BACKWARDS, bool)
  REGISTER_STAT(MOVEVARS_AIRCONTROL_SIDEWARDS, bool)
- noref bool autocvar_sv_gameplayfix_nogravityonground;
+ noref bool autocvar_sv_gameplayfix_nogravityonground = true;
  REGISTER_STAT(MOVEFLAGS, int, MOVEFLAG_VALID
                                | (autocvar_sv_gameplayfix_q2airaccelerate ? MOVEFLAG_Q2AIRACCELERATE : 0)
                                | (autocvar_sv_gameplayfix_nogravityonground ? MOVEFLAG_NOGRAVITYONGROUND : 0)
@@@ -372,14 -392,6 +394,6 @@@ int autocvar_sv_wallclip
  #endif
  REGISTER_STAT(MOVEVARS_WALLCLIP, int, autocvar_sv_wallclip)
  
- #ifdef CSQC
- noref int autocvar_cl_gunalign;
- #endif
- #ifdef SVQC
- .int cvar_cl_gunalign;
- REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
- #endif
  REGISTER_STAT(GUNALIGN, int)
  #ifdef SVQC
  SPECTATE_COPYFIELD(_STAT(GUNALIGN))
index 848000db3a6b142da8a8e29ae7c09a1e3b21ab8a,624e0a9126e8a497272cf0ad2a9c98ec6b26b2eb..4d38c574d9cdac5345bdf9782989aed40b694f7d
@@@ -3,7 -3,6 +3,6 @@@
  void sys_phys_fix(entity this, float dt)
  {
        this.team = myteam + 1; // is this correct?
-       PHYS_WATERJUMP_TIME(this) -= dt;
        this.movement = PHYS_INPUT_MOVEVALUES(this);
        this.items = STAT(ITEMS, this);
        if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
@@@ -25,15 -24,4 +24,15 @@@ void sys_phys_pregame_hold(entity this
  
  void sys_phys_spectator_control(entity this) {}
  
 -void sys_phys_fixspeed(entity this, float maxspeed_mod) {}
 +void sys_phys_fixspeed(entity this, float maxspeed_mod)
 +{
 +      float spd = STAT(MOVEVARS_SPEED, this);
 +      if (this.speed != spd) {
 +              this.speed = spd;
 +              string temps = ftos(spd);
 +              cvar_set("cl_forwardspeed", temps);
 +              cvar_set("cl_backspeed", temps);
 +              cvar_set("cl_sidespeed", temps);
 +              cvar_set("cl_upspeed", temps);
 +      }
 +}