]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'Mario/playerdemo_removal'
authorMario <mario@smbclan.net>
Tue, 19 Jun 2018 01:34:10 +0000 (11:34 +1000)
committerMario <mario@smbclan.net>
Tue, 19 Jun 2018 01:34:10 +0000 (11:34 +1000)
1  2 
commands.cfg
qcsrc/server/_mod.inc
qcsrc/server/_mod.qh
qcsrc/server/client.qc
qcsrc/server/command/sv_cmd.qc

diff --combined commands.cfg
index 0e765b8a136cd83be6d5d0743421ac6b382f5fbf,e36e41e227850696970cec56ba62121f43a2c09b..b2edf84788332b7da31d681a318c19d6fd2e807d
@@@ -212,7 -212,6 +212,6 @@@ alias lockteams            "qc_cmd_s
  alias make_mapinfo         "qc_cmd_sv     make_mapinfo         ${* ?}" // Automatically rebuild mapinfo files
  alias moveplayer           "qc_cmd_sv     moveplayer           ${* ?}" // Change the team/status of a player
  alias nospectators         "qc_cmd_sv     nospectators         ${* ?}" // Automatically remove spectators from a match
- alias playerdemo           "qc_cmd_sv     playerdemo           ${* ?}" // Control the ability to save demos of players
  alias printstats           "qc_cmd_sv     printstats           ${* ?}" // Dump eventlog player stats and other score information
  alias radarmap             "qc_cmd_sv     radarmap             ${* ?}" // Generate a radar image of the map
  alias reducematchtime      "qc_cmd_sv     reducematchtime      ${* ?}" // Decrease the timelimit value incrementally
@@@ -322,7 -321,7 +321,7 @@@ set sv_vote_master_password "" "when se
  set sv_vote_master_playerlimit 2 "Minimum number of players needed for a player to be allowed to vote for master"
  set sv_vote_no_stops_vote 1 "Allow the vote caller to stop his own vote simply by voting no"
  set sv_vote_singlecount 0     "set to 1 to count votes once after timeout or to 0 to count with every vote"
 -set sv_vote_timeout 30        "a vote will timeout after this many seconds"
 +set sv_vote_timeout 24        "a vote will timeout after this many seconds"
  set sv_vote_wait 120  "a player can not call a vote again for this many seconds when his vote was not accepted"
  set sv_vote_stop 15   "a player can not call a vote again for this many seconds when he stopped this vote (e.g. to correct it)"
  set sv_vote_majority_factor 0.5       "What percentage of the PLAYERS constitute a majority? (Must be at least 0.5, recommended: 0.5)"
diff --combined qcsrc/server/_mod.inc
index 0e6ec096df5eff5bc988368e3f53340e86529afb,9f6a2a76b4c8ebc4ce482315d95a77fec8870290..a4cb8bd5e1c5779b2274a01448ceeb39a689c867
@@@ -6,6 -6,7 +6,6 @@@
  #include <server/client.qc>
  #include <server/g_damage.qc>
  #include <server/g_hook.qc>
 -#include <server/g_subs.qc>
  #include <server/g_world.qc>
  #include <server/handicap.qc>
  #include <server/impulse.qc>
@@@ -16,7 -17,6 +16,6 @@@
  #include <server/matrix.qc>
  #include <server/miscfunctions.qc>
  #include <server/player.qc>
- #include <server/playerdemo.qc>
  #include <server/portals.qc>
  #include <server/race.qc>
  #include <server/resources.qc>
diff --combined qcsrc/server/_mod.qh
index a897b456a6d97ad44a47c7c9be6cce4142d2088d,527ec0dfbe4fd1c32d7779df82fb844a79dd63ac..0a00d680786fa51c84701339d0b9f82fe01000aa
@@@ -6,6 -6,7 +6,6 @@@
  #include <server/client.qh>
  #include <server/g_damage.qh>
  #include <server/g_hook.qh>
 -#include <server/g_subs.qh>
  #include <server/g_world.qh>
  #include <server/handicap.qh>
  #include <server/impulse.qh>
@@@ -16,7 -17,6 +16,6 @@@
  #include <server/matrix.qh>
  #include <server/miscfunctions.qh>
  #include <server/player.qh>
- #include <server/playerdemo.qh>
  #include <server/portals.qh>
  #include <server/race.qh>
  #include <server/resources.qh>
diff --combined qcsrc/server/client.qc
index 7125b949c45e4fea053bde94cc3a3b4db9094b98,8443efb90497b0f98c8036f721256cc1b38209f6..cf114e5f058860e6a55ef47febf11f0e17a31f63
  #include "miscfunctions.qh"
  #include "portals.qh"
  #include "teamplay.qh"
- #include "playerdemo.qh"
  #include "spawnpoints.qh"
  #include "resources.qh"
  #include "g_damage.qh"
  #include "handicap.qh"
  #include "g_hook.qh"
  #include "command/common.qh"
 +#include "command/vote.qh"
  #include "cheats.qh"
  #include "g_world.qh"
  #include "race.qh"
  #include "../common/net_linked.qh"
  #include "../common/physics/player.qh"
  
 +#include <common/vehicles/sv_vehicles.qh>
 +
  #include "../common/items/_mod.qh"
  
  #include "../common/mutators/mutator/waypoints/all.qh"
  #include "../common/mutators/mutator/instagib/sv_instagib.qh"
 +#include <common/gamemodes/_mod.qh>
  
  #include "../common/mapobjects/subs.qh"
  #include "../common/mapobjects/triggers.qh"
@@@ -78,6 -73,8 +77,6 @@@ STATIC_METHOD(Client, Add, void(Client 
      PutClientInServer(this);
  }
  
 -void PutObserverInServer(entity this);
 -
  STATIC_METHOD(Client, Remove, void(Client this))
  {
      TRANSMUTE(Observer, this);
@@@ -168,6 -165,9 +167,6 @@@ void ClientData_Touch(entity e
        });
  }
  
 -void SetSpectatee(entity this, entity spectatee);
 -void SetSpectatee_status(entity this, int spectatee_num);
 -
  
  /*
  =============
@@@ -221,6 -221,7 +220,6 @@@ void setplayermodel(entity e, string mo
                UpdatePlayerSounds(e);
  }
  
 -void FixPlayermodel(entity player);
  /** putting a client as observer in the server */
  void PutObserverInServer(entity this)
  {
  
        if (IS_PLAYER(this))
        {
 -              if(this.health >= 1)
 +              if(GetResourceAmount(this, RESOURCE_HEALTH) >= 1)
                {
                        // despawn effect
                        Send_Effect(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1);
        if(this.damagedbycontents)
                IL_REMOVE(g_damagedbycontents, this);
        this.damagedbycontents = false;
 -      this.health = FRAGS_SPECTATOR;
 +      SetResourceAmountExplicit(this, RESOURCE_HEALTH, FRAGS_SPECTATOR);
        SetSpectatee_status(this, etof(this));
        this.takedamage = DAMAGE_NO;
        this.solid = SOLID_NOT;
        set_movetype(this, MOVETYPE_FLY_WORLDONLY); // user preference is controlled by playerprethink
        this.flags = FL_CLIENT | FL_NOTARGET;
 -      this.armorvalue = 666;
        this.effects = 0;
 -      this.armorvalue = autocvar_g_balance_armor_start;
 +      SetResourceAmountExplicit(this, RESOURCE_ARMOR, autocvar_g_balance_armor_start); // was 666?!
        this.pauserotarmor_finished = 0;
        this.pauserothealth_finished = 0;
        this.pauseregen_finished = 0;
        this.oldvelocity = this.velocity;
        this.fire_endtime = -1;
        this.event_damage = func_null;
 +      this.event_heal = func_null;
  
        for(int slot = 0; slot < MAX_AXH; ++slot)
        {
@@@ -554,24 -555,24 +553,24 @@@ void PutPlayerInServer(entity this
        this.effects = EF_TELEPORT_BIT | EF_RESTARTANIM_BIT;
  
        if (warmup_stage) {
 -              this.ammo_shells = warmup_start_ammo_shells;
 -              this.ammo_nails = warmup_start_ammo_nails;
 -              this.ammo_rockets = warmup_start_ammo_rockets;
 -              this.ammo_cells = warmup_start_ammo_cells;
 -              this.ammo_plasma = warmup_start_ammo_plasma;
 -              this.ammo_fuel = warmup_start_ammo_fuel;
 -              this.health = warmup_start_health;
 -              this.armorvalue = warmup_start_armorvalue;
 +              SetResourceAmount(this, RESOURCE_SHELLS, warmup_start_ammo_shells);
 +              SetResourceAmount(this, RESOURCE_BULLETS, warmup_start_ammo_nails);
 +              SetResourceAmount(this, RESOURCE_ROCKETS, warmup_start_ammo_rockets);
 +              SetResourceAmount(this, RESOURCE_CELLS, warmup_start_ammo_cells);
 +              SetResourceAmount(this, RESOURCE_PLASMA, warmup_start_ammo_plasma);
 +              SetResourceAmount(this, RESOURCE_FUEL, warmup_start_ammo_fuel);
 +              SetResourceAmount(this, RESOURCE_HEALTH, warmup_start_health);
 +              SetResourceAmount(this, RESOURCE_ARMOR, warmup_start_armorvalue);
                STAT(WEAPONS, this) = WARMUP_START_WEAPONS;
        } else {
 -              this.ammo_shells = start_ammo_shells;
 -              this.ammo_nails = start_ammo_nails;
 -              this.ammo_rockets = start_ammo_rockets;
 -              this.ammo_cells = start_ammo_cells;
 -              this.ammo_plasma = start_ammo_plasma;
 -              this.ammo_fuel = start_ammo_fuel;
 -              this.health = start_health;
 -              this.armorvalue = start_armorvalue;
 +              SetResourceAmount(this, RESOURCE_SHELLS, start_ammo_shells);
 +              SetResourceAmount(this, RESOURCE_BULLETS, start_ammo_nails);
 +              SetResourceAmount(this, RESOURCE_ROCKETS, start_ammo_rockets);
 +              SetResourceAmount(this, RESOURCE_CELLS, start_ammo_cells);
 +              SetResourceAmount(this, RESOURCE_PLASMA, start_ammo_plasma);
 +              SetResourceAmount(this, RESOURCE_FUEL, start_ammo_fuel);
 +              SetResourceAmount(this, RESOURCE_HEALTH, start_health);
 +              SetResourceAmount(this, RESOURCE_ARMOR, start_armorvalue);
                STAT(WEAPONS, this) = start_weapons;
                if (MUTATOR_CALLHOOK(ForbidRandomStartWeapons, this) == false)
                {
        STAT(HUD, this) = HUD_NORMAL;
  
        this.event_damage = PlayerDamage;
 +      this.event_heal = PlayerHeal;
  
        if(!this.bot_attack)
                IL_PUSH(g_bot_targets, this);
                this.(weaponentity).weaponname = "";
                this.(weaponentity).m_switchingweapon = WEP_Null;
                this.(weaponentity).cnt = -1;
 +
 +              W_WeaponFrame(this, weaponentity);
        }
  
        MUTATOR_CALLHOOK(PlayerWeaponSelect, this);
@@@ -791,6 -789,8 +790,6 @@@ void PutClientInServer(entity this
        }
  }
  
 -void ClientInit_misc(entity this);
 -
  // TODO do we need all these fields, or should we stop autodetecting runtime
  // changes and just have a console command to update this?
  bool ClientInit_SendEntity(entity this, entity to, int sf)
@@@ -971,7 -971,7 +970,7 @@@ void KillIndicator_Think(entity this
                ClientKill_Now(this.owner);
                return;
        }
 -    else if(this.health == 1) // health == 1 means that it's silent
 +    else if(this.count == 1) // count == 1 means that it's silent
      {
          this.nextthink = time + 1;
          this.cnt -= 1;
@@@ -1086,8 -1086,6 +1085,8 @@@ void ClientKill_TeamChange (entity this
  
  void ClientKill (entity this)
  {
 +      // TODO: once .health is removed, will need to check it here for the "already dead" message!
 +
        if(game_stopped) return;
        if(this.player_blocked) return;
        if(STAT(FROZEN, this)) return;
@@@ -1228,7 -1226,16 +1227,7 @@@ void ClientConnect(entity this
        JoinBestTeam(this, false); // if the team number is valid, keep it
        this.playerid = playerid_save;
  
 -      if (autocvar_sv_spectate || autocvar_g_campaign || this.team_forced < 0) {
 -              TRANSMUTE(Observer, this);
 -      } else {
 -              if (!teamplay || autocvar_g_balance_teams) {
 -                      TRANSMUTE(Player, this);
 -                      campaign_bots_may_start = true;
 -              } else {
 -                      TRANSMUTE(Observer, this); // do it anyway
 -              }
 -      }
 +      TRANSMUTE(Observer, this);
  
        PlayerStats_GameReport_AddEvent(sprintf("kills-%d", this.playerid));
  
@@@ -1332,6 -1339,7 +1331,6 @@@ Called when a client disconnects from t
  =============
  */
  .entity chatbubbleentity;
 -void ReadyCount();
  void ClientDisconnect(entity this)
  {
        assert(IS_CLIENT(this), return);
@@@ -1468,54 -1476,6 +1467,54 @@@ void respawn(entity this
        PutClientInServer(this);
  }
  
 +void PrintToChat(entity client, string text)
 +{
 +      text = strcat("\{1}^7", text, "\n");
 +      sprint(client, text);
 +}
 +
 +void DebugPrintToChat(entity client, string text)
 +{
 +      if (autocvar_developer)
 +      {
 +              PrintToChat(client, text);
 +      }
 +}
 +
 +void PrintToChatAll(string text)
 +{
 +      text = strcat("\{1}^7", text, "\n");
 +      bprint(text);
 +}
 +
 +void DebugPrintToChatAll(string text)
 +{
 +      if (autocvar_developer)
 +      {
 +              PrintToChatAll(text);
 +      }
 +}
 +
 +void PrintToChatTeam(int team_num, string text)
 +{
 +      text = strcat("\{1}^7", text, "\n");
 +      FOREACH_CLIENT(IS_REAL_CLIENT(it),
 +      {
 +              if (it.team == team_num)
 +              {
 +                      sprint(it, text);
 +              }
 +      });
 +}
 +
 +void DebugPrintToChatTeam(int team_num, string text)
 +{
 +      if (autocvar_developer)
 +      {
 +              PrintToChatTeam(team_num, text);
 +      }
 +}
 +
  void play_countdown(entity this, float finished, Sound samp)
  {
      TC(Sound, samp);
@@@ -1729,17 -1689,13 +1728,17 @@@ void player_regen(entity this
                limith = limith * limit_mod;
                limita = limita * limit_mod;
  
 -              this.armorvalue = CalcRotRegen(this.armorvalue, mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, regen_mod * frametime * (time > this.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear, rot_mod * frametime * (time > this.pauserotarmor_finished), limita);
 -              this.health = CalcRotRegen(this.health, regen_health_stable, regen_health, regen_health_linear, regen_mod * frametime * (time > this.pauseregen_finished), regen_health_rotstable, regen_health_rot, regen_health_rotlinear, rot_mod * frametime * (time > this.pauserothealth_finished), limith);
 +              SetResourceAmount(this, RESOURCE_ARMOR, CalcRotRegen(GetResourceAmount(this, RESOURCE_ARMOR), mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, 
 +                                                                      regen_mod * frametime * (time > this.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear,
 +                                                                      rot_mod * frametime * (time > this.pauserotarmor_finished), limita));
 +              SetResourceAmount(this, RESOURCE_HEALTH, CalcRotRegen(GetResourceAmount(this, RESOURCE_HEALTH), regen_health_stable, regen_health, regen_health_linear,
 +                                                                      regen_mod * frametime * (time > this.pauseregen_finished), regen_health_rotstable, regen_health_rot, regen_health_rotlinear,
 +                                                                      rot_mod * frametime * (time > this.pauserothealth_finished), limith));
        }
  
        // if player rotted to death...  die!
        // check this outside above checks, as player may still be able to rot to death
 -      if(this.health < 1)
 +      if(GetResourceAmount(this, RESOURCE_HEALTH) < 1)
        {
                if(this.vehicle)
                        vehicles_exit(this.vehicle, VHEF_RELEASE);
                minf = autocvar_g_balance_fuel_regenstable;
                limitf = GetResourceLimit(this, RESOURCE_FUEL);
  
 -              this.ammo_fuel = CalcRotRegen(this.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf);
 -      }
 -      // Ugly hack to make sure the health and armor don't go beyond hard limit.
 -      // TODO: Remove this hack when all code uses GivePlayerHealth and
 -      // GivePlayerArmor.
 -      if (this.health > RESOURCE_AMOUNT_HARD_LIMIT)
 -      {
 -              this.health = RESOURCE_AMOUNT_HARD_LIMIT;
 -      }
 -      if (this.armorvalue > RESOURCE_AMOUNT_HARD_LIMIT)
 -      {
 -              this.armorvalue = RESOURCE_AMOUNT_HARD_LIMIT;
 +              SetResourceAmount(this, RESOURCE_FUEL, CalcRotRegen(GetResourceAmount(this, RESOURCE_FUEL), minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, 
 +                                                                              frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0),
 +                                                                              maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf));
        }
 -      // End hack.
  }
  
  bool zoomstate_set;
@@@ -1803,15 -1769,15 +1802,15 @@@ void SpectateCopy(entity this, entity s
        MUTATOR_CALLHOOK(SpectateCopy, spectatee, this);
        PS(this) = PS(spectatee);
        this.armortype = spectatee.armortype;
 -      this.armorvalue = spectatee.armorvalue;
 -      this.ammo_cells = spectatee.ammo_cells;
 -      this.ammo_plasma = spectatee.ammo_plasma;
 -      this.ammo_shells = spectatee.ammo_shells;
 -      this.ammo_nails = spectatee.ammo_nails;
 -      this.ammo_rockets = spectatee.ammo_rockets;
 -      this.ammo_fuel = spectatee.ammo_fuel;
 +      SetResourceAmountExplicit(this, RESOURCE_ARMOR, GetResourceAmount(spectatee, RESOURCE_ARMOR));
 +      SetResourceAmountExplicit(this, RESOURCE_CELLS, GetResourceAmount(spectatee, RESOURCE_CELLS));
 +      SetResourceAmountExplicit(this, RESOURCE_PLASMA, GetResourceAmount(spectatee, RESOURCE_PLASMA));
 +      SetResourceAmountExplicit(this, RESOURCE_SHELLS, GetResourceAmount(spectatee, RESOURCE_SHELLS));
 +      SetResourceAmountExplicit(this, RESOURCE_BULLETS, GetResourceAmount(spectatee, RESOURCE_BULLETS));
 +      SetResourceAmountExplicit(this, RESOURCE_ROCKETS, GetResourceAmount(spectatee, RESOURCE_ROCKETS));
 +      SetResourceAmountExplicit(this, RESOURCE_FUEL, GetResourceAmount(spectatee, RESOURCE_FUEL));
        this.effects = spectatee.effects & EFMASK_CHEAP; // eat performance
 -      this.health = spectatee.health;
 +      SetResourceAmountExplicit(this, RESOURCE_HEALTH, GetResourceAmount(spectatee, RESOURCE_HEALTH));
        CS(this).impulse = 0;
        this.items = spectatee.items;
        STAT(LAST_PICKUP, this) = STAT(LAST_PICKUP, spectatee);
@@@ -2180,11 -2146,9 +2179,11 @@@ void PrintWelcomeMessage(entity this
        }
  }
  
 +const int MIN_SPEC_TIME = 1;
  bool joinAllowed(entity this)
  {
        if (CS(this).version_mismatch) return false;
 +      if (time < CS(this).jointime + MIN_SPEC_TIME) return false;
        if (!nJoinAllowed(this, this)) return false;
        if (teamplay && lockteams) return false;
        if (MUTATOR_CALLHOOK(ForbidSpawn, this)) return false;
@@@ -2308,7 -2272,7 +2307,7 @@@ bool PlayerThink(entity this
                }
  
                this.items_added = 0;
 -              if ((this.items & ITEM_Jetpack.m_itemid) && ((this.items & ITEM_JetpackRegen.m_itemid) || this.ammo_fuel >= 0.01))
 +              if ((this.items & ITEM_Jetpack.m_itemid) && ((this.items & ITEM_JetpackRegen.m_itemid) || GetResourceAmount(this, RESOURCE_FUEL) >= 0.01))
              this.items_added |= IT_FUEL;
  
                this.items |= this.items_added;
@@@ -2442,6 -2406,7 +2441,6 @@@ void SpectatorThink(entity this
        this.flags |= FL_CLIENT | FL_NOTARGET;
  }
  
 -void vehicles_enter (entity pl, entity veh);
  void PlayerUseKey(entity this)
  {
        if (!IS_PLAYER(this))
@@@ -2564,7 -2529,7 +2563,7 @@@ void PlayerPreThink (entity this
                if (STAT(FROZEN, this) == 2)
                {
                        STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) + frametime * this.revive_speed, 1);
 -                      this.health = max(1, STAT(REVIVE_PROGRESS, this) * start_health);
 +                      SetResourceAmountExplicit(this, RESOURCE_HEALTH, max(1, STAT(REVIVE_PROGRESS, this) * start_health));
                        this.iceblock.alpha = bound(0.2, 1 - STAT(REVIVE_PROGRESS, this), 1);
  
                        if (STAT(REVIVE_PROGRESS, this) >= 1)
                else if (STAT(FROZEN, this) == 3)
                {
                        STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) - frametime * this.revive_speed, 1);
 -                      this.health = max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * STAT(REVIVE_PROGRESS, this) );
 +                      SetResourceAmountExplicit(this, RESOURCE_HEALTH, max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * STAT(REVIVE_PROGRESS, this)));
  
 -                      if (this.health < 1)
 +                      if (GetResourceAmount(this, RESOURCE_HEALTH) < 1)
                        {
                                if (this.vehicle)
                                        vehicles_exit(this.vehicle, VHEF_RELEASE);
                PrintWelcomeMessage(this);
  
        if (IS_PLAYER(this)) {
 +              if (IS_REAL_CLIENT(this) && time < CS(this).jointime + MIN_SPEC_TIME)
 +                      error("Client can't be spawned as player on connection!");
                if(!PlayerThink(this))
                        return;
        }
                        IntermissionThink(this);
                return;
        }
 +      else if (IS_REAL_CLIENT(this) && !CS(this).autojoin_checked && time >= CS(this).jointime + MIN_SPEC_TIME)
 +      {
 +              CS(this).autojoin_checked = true;
 +              // don't do this in ClientConnect
 +              // many things can go wrong if a client is spawned as player on connection
 +              if (MUTATOR_CALLHOOK(AutoJoinOnConnection, this)
 +                      || (!(autocvar_sv_spectate || autocvar_g_campaign || this.team_forced < 0)
 +                              && (!teamplay || autocvar_g_balance_teams)))
 +              {
 +                      campaign_bots_may_start = true;
 +                      Join(this);
 +                      return;
 +              }
 +      }
        else if (IS_OBSERVER(this)) {
                ObserverThink(this);
        }
@@@ -2817,12 -2766,10 +2816,10 @@@ void PlayerPostThink (entity this
        }
  
        if (this.waypointsprite_attachedforcarrier) {
 -          vector v = healtharmor_maxdamage(this.health, this.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id);
 +          vector v = healtharmor_maxdamage(GetResourceAmount(this, RESOURCE_HEALTH), GetResourceAmount(this, RESOURCE_ARMOR), autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id);
                WaypointSprite_UpdateHealth(this.waypointsprite_attachedforcarrier, '1 0 0' * v);
      }
  
-       playerdemo_write(this);
        CSQCMODEL_AUTOUPDATE(this);
  }
  
index 2903f553543cf582c23eed087951ca29498010e5,97af2d49460986ce79b2e30ae761da78c75b8e9e..1076225d82acaf1e89a00432927c4c95b8593c34
  #include "../player.qh"
  #include "../g_world.qh"
  #include "../ipban.qh"
- #include "../playerdemo.qh"
  #include "../teamplay.qh"
  
  #include "../bot/api.qh"
  
 -#include "../mutators/_mod.qh"
 +#include <server/mutators/_mod.qh>
 +#include <common/gamemodes/_mod.qh>
  
  #include <common/constants.qh>
  #include <common/net_linked.qh>
  
  #include <common/monsters/sv_monsters.qh>
  
 -
 -void PutObserverInServer(entity this);
 -
 -// =====================================================
 -//  Server side game commands code, reworked by Samual
 -// =====================================================
 -
  //  used by GameCommand_make_mapinfo()
  void make_mapinfo_Think(entity this)
  {
@@@ -1166,86 -1171,6 +1165,6 @@@ void GameCommand_nospectators(float req
        }
  }
  
- void GameCommand_playerdemo(float request, float argc)
- {
-       switch (request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       if (argv(2) && argv(3))
-                       {
-                               entity client;
-                               float i, n, accepted;
-                               switch (argv(1))
-                               {
-                                       case "read":
-                                       {
-                                               client = GetIndexedEntity(argc, 2);
-                                               accepted = VerifyClientEntity(client, false, true);
-                                               if (accepted <= 0)
-                                               {
-                                                       LOG_INFO("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".");
-                                                       return;
-                                               }
-                                               playerdemo_open_read(client, argv(next_token));
-                                               return;
-                                       }
-                                       case "write":
-                                       {
-                                               client = GetIndexedEntity(argc, 2);
-                                               accepted = VerifyClientEntity(client, false, false);
-                                               if (accepted <= 0)
-                                               {
-                                                       LOG_INFO("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".");
-                                                       return;
-                                               }
-                                               playerdemo_open_write(client, argv(next_token));
-                                               return;
-                                       }
-                                       case "auto_read_and_write":
-                                       {
-                                               n = GetFilteredNumber(argv(3));
-                                               cvar_set("bot_number", ftos(n));
-                                               localcmd("wait; wait; wait\n");
-                                               for (i = 0; i < n; ++i)
-                                                       localcmd("sv_cmd playerdemo read ", ftos(i + 2), " ", argv(2), ftos(i + 1), "\n");
-                                               localcmd("sv_cmd playerdemo write 1 ", ftos(n + 1), "\n");
-                                               return;
-                                       }
-                                       case "auto_read":
-                                       {
-                                               n = GetFilteredNumber(argv(3));
-                                               cvar_set("bot_number", ftos(n));
-                                               localcmd("wait; wait; wait\n");
-                                               for (i = 0; i < n; ++i)
-                                                       localcmd("sv_cmd playerdemo read ", ftos(i + 2), " ", argv(2), ftos(i + 1), "\n");
-                                               return;
-                                       }
-                               }
-                       }
-               }
-               default:
-                       LOG_INFO("Incorrect parameters for ^2playerdemo^7");
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("Usage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)");
-                       LOG_INFO("  Full list of commands here: \"read, write, auto_read_and_write, auto_read.\"");
-                       return;
-               }
-       }
- }
  void GameCommand_printstats(float request)
  {
        switch (request)
@@@ -1571,13 -1496,10 +1490,13 @@@ void GameCommand_trace(float request, f
                                        if (argc == 4 || argc == 5)
                                        {
                                                e = nextent(NULL);
 +                                              int dphitcontentsmask_save = e.dphitcontentsmask;
 +                                              e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
                                                if (tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), stof(argv(4)), MOVE_NORMAL))
                                                        LOG_INFO("can walk");
                                                else
                                                        LOG_INFO("cannot walk");
 +                                              e.dphitcontentsmask = dphitcontentsmask_save;
                                                return;
                                        }
                                }
@@@ -1729,7 -1651,6 +1648,6 @@@ SERVER_COMMAND(lockteams, "Disable the 
  SERVER_COMMAND(make_mapinfo, "Automatically rebuild mapinfo files") { GameCommand_make_mapinfo(request); }
  SERVER_COMMAND(moveplayer, "Change the team/status of a player") { GameCommand_moveplayer(request, arguments); }
  SERVER_COMMAND(nospectators, "Automatically remove spectators from a match") { GameCommand_nospectators(request); }
- SERVER_COMMAND(playerdemo, "Control the ability to save demos of players") { GameCommand_playerdemo(request, arguments); }
  SERVER_COMMAND(printstats, "Dump eventlog player stats and other score information") { GameCommand_printstats(request); }
  SERVER_COMMAND(radarmap, "Generate a radar image of the map") { GameCommand_radarmap(request, arguments); }
  SERVER_COMMAND(reducematchtime, "Decrease the timelimit value incrementally") { GameCommand_reducematchtime(request); }