Merge branch 'terencehill/ft_bugfix' into 'master'
authorMario <zacjardine@y7mail.com>
Thu, 27 Sep 2018 01:26:44 +0000 (01:26 +0000)
committerMario <zacjardine@y7mail.com>
Thu, 27 Sep 2018 01:26:44 +0000 (01:26 +0000)
FT bugfixes

Closes #2098 and #2079

See merge request xonotic/xonotic-data.pk3dir!600

1  2 
qcsrc/server/client.qc
qcsrc/server/defs.qh
qcsrc/server/player.qc

diff --combined qcsrc/server/client.qc
index 18d3d4ea3b724d8adb9b345e50dc3add4c96a496,489f2cc764a1f5bbeb82b176e96a8acc0ea0746a..3e457df14e740a9c2b24e8f3938f8bf8e2e706ed
@@@ -274,7 -274,7 +274,7 @@@ void PutObserverInServer(entity this
  
      RemoveGrapplingHooks(this);
        Portal_ClearAll(this);
-       Unfreeze(this);
+       Unfreeze(this, false);
        SetSpectatee(this, NULL);
  
        if (this.alivetime)
        this.crouch = false;
        STAT(REVIVE_PROGRESS, this) = 0;
        this.revival_time = 0;
 +      this.draggable = drag_undraggable;
  
        this.items = 0;
        STAT(WEAPONS, this) = '0 0 0';
@@@ -678,8 -677,6 +678,8 @@@ void PutPlayerInServer(entity this
        this.event_damage = PlayerDamage;
        this.event_heal = PlayerHeal;
  
 +      this.draggable = func_null;
 +
        if(!this.bot_attack)
                IL_PUSH(g_bot_targets, this);
        this.bot_attack = true;
                //spot.target = s;
        }
  
-       Unfreeze(this);
+       Unfreeze(this, false);
  
        MUTATOR_CALLHOOK(PlayerSpawn, this, spot);
  
@@@ -1146,8 -1143,6 +1146,8 @@@ void ClientConnect(entity this
        if (IS_REAL_CLIENT(this))
                sv_notice_join(this);
  
 +      this.move_qcphysics = true;
 +
        // update physics stats (players can spawn before physics runs)
        Physics_UpdateStats(this);
  
@@@ -1201,7 -1196,7 +1201,7 @@@ void ClientDisconnect(entity this
  
        Portal_ClearAll(this);
  
-       Unfreeze(this);
+       Unfreeze(this, false);
  
        RemoveGrapplingHooks(this);
  
@@@ -1241,7 -1236,7 +1241,7 @@@ void ChatBubbleThink(entity this
  
        if ( !IS_DEAD(this.owner) && IS_PLAYER(this.owner) )
        {
 -              if ( CS(this.owner).active_minigame )
 +              if ( CS(this.owner).active_minigame && PHYS_INPUT_BUTTON_MINIGAME(this.owner) )
                        this.mdl = "models/sprites/minigame_busy.iqm";
                else if (PHYS_INPUT_BUTTON_CHAT(this.owner))
                        this.mdl = "models/misc/chatbubble.spr";
@@@ -2409,16 -2404,16 +2409,16 @@@ void PlayerPreThink (entity this
  
        if(IS_PLAYER(this))
        {
-               if (STAT(FROZEN, this) == 2)
+               if (STAT(FROZEN, this) == FROZEN_TEMP_REVIVING)
                {
                        STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) + frametime * this.revive_speed, 1);
                        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)
-                               Unfreeze(this);
+                               Unfreeze(this, false);
                }
-               else if (STAT(FROZEN, this) == 3)
+               else if (STAT(FROZEN, this) == FROZEN_TEMP_DYING)
                {
                        STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) - frametime * this.revive_speed, 1);
                        SetResourceAmountExplicit(this, RESOURCE_HEALTH, max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * STAT(REVIVE_PROGRESS, this)));
                                        this.event_damage(this, this, this.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, DMG_NOWEP, this.origin, '0 0 0');
                        }
                        else if (STAT(REVIVE_PROGRESS, this) <= 0)
-                               Unfreeze(this);
+                               Unfreeze(this, false);
                }
        }
  
@@@ -2567,7 -2562,7 +2567,7 @@@ void DrownPlayer(entity this
  
  void Player_Physics(entity this)
  {
 -      set_movetype(this, this.move_movetype);
 +      this.movetype = (this.move_qcphysics) ? MOVETYPE_QCPLAYER : this.move_movetype;
  
        if(!this.move_qcphysics)
                return;
@@@ -2679,7 -2674,7 +2679,7 @@@ void PM_UpdateButtons(entity this, enti
                store.impulse = this.impulse;
        this.impulse = 0;
  
 -      bool typing = this.buttonchat;
 +      bool typing = this.buttonchat || this.button14;
  
        store.button0 = (typing) ? 0 : this.button0;
        //button1?!
diff --combined qcsrc/server/defs.qh
index 8f4e903490b04d211835f781adad688507ad5010,e81cf7228b937c6b2c1a108c388d4bb898d995d9..90bc1fb200a4cd3a2eaca29eae32b7a2983fe4f4
@@@ -168,7 -168,6 +168,7 @@@ float default_weapon_alpha
  .float cvar_cl_jetpack_jump;
  .float cvar_cl_movement_track_canjump;
  .float cvar_cl_newusekeysupported;
 +.float cvar_cl_cts_noautoswitch;
  
  .string cvar_g_xonoticversion;
  .string cvar_cl_weaponpriority;
@@@ -341,6 -340,11 +341,11 @@@ string deathmessage
  
  .float ballistics_density; // wall piercing factor, larger = bullet can pass through more
  
+ //const int FROZEN_NOT                                = 0;
+ const int FROZEN_NORMAL                               = 1;
+ const int FROZEN_TEMP_REVIVING                = 2;
+ const int FROZEN_TEMP_DYING                   = 3;
  const int ACTIVE_NOT          = 0;
  const int ACTIVE_ACTIVE       = 1;
  const int ACTIVE_IDLE         = 2;
diff --combined qcsrc/server/player.qc
index d8cc0dce04b105ec0b8da5dc7d75e00363aaf157,a0d622c7734c79605a6c1787e1bd6777cb6c68d5..30c7171ea3c8b33d084bd08c2eba035c2969b442
@@@ -468,7 -468,7 +468,7 @@@ void PlayerDamage(entity this, entity i
  
                        if (this != attacker) {
                                float realdmg = damage - excess;
 -                              if (IS_PLAYER(attacker)) {
 +                              if (IS_PLAYER(attacker) && DIFF_TEAM(attacker, this)) {
                                        GameRules_scoring_add(attacker, DMG, realdmg);
                                }
                                if (IS_PLAYER(this)) {
  
                // when we get here, player actually dies
  
-               Unfreeze(this); // remove any icy remains
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, 0); // Unfreeze resets health, so we need to set it back
+               Unfreeze(this, false); // remove any icy remains
  
                // clear waypoints
                WaypointSprite_PlayerDead(this);