]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix #2922 "Player corpse not resized when suiciding with a weapon"
authorterencehill <piuntn@gmail.com>
Thu, 24 Oct 2024 15:44:46 +0000 (17:44 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 24 Oct 2024 15:49:05 +0000 (17:49 +0200)
Fixed by moving code that resizes player bbox from PlayerPostThink to EndFrame, which is executed later.

Also update hash

.gitlab-ci.yml
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/player.qh
qcsrc/server/world.qc

index 04c31a34cc9d248999106411902a17cc0aad0452..c0eb104055db3cf56e9e93ffb6240ee7a2551fa7 100644 (file)
@@ -36,7 +36,7 @@ test_compilation_units:
 test_sv_game:
   stage: test
   script:
-    - export EXPECT=17e9738e7898923e862b0b72da30c5ad
+    - export EXPECT=5be7dd7d77ee3de502261054c1060f00
     - qcsrc/tools/sv_game-hashtest.sh
     - exit $?
 
index 4a64537039f81735a866e2cdb4b0ecd4bb556799..211d23da78478f9a5a9c90985d0fba7b7dd52b15 100644 (file)
@@ -2745,14 +2745,6 @@ void PlayerPostThink (entity this)
        Player_Physics(this);
 
        if (IS_PLAYER(this)) {
-               if(this.death_time == time && IS_DEAD(this))
-               {
-                       // player's bbox gets resized now, instead of in the damage event that killed the player,
-                       // once all the damage events of this frame have been processed with normal size
-                       float h = ceil((this.mins.z + this.maxs.z) * PL_CORPSE_SCALE * 10) / 10;
-                       this.maxs.z = max(h, this.mins.z + 1);
-                       setsize(this, this.mins, this.maxs);
-               }
                DrownPlayer(this);
                UpdateChatBubble(this);
                if (CS(this).impulse) ImpulseCommands(this);
index 3c040d15d52e443d5dc585f03bd99ccf01ce71c8..cd3c162baf9778a789f98319183f6bccbcb10494 100644 (file)
@@ -66,7 +66,7 @@ float autocvar_sv_player_scale;
 .float jointime; // time of connecting
 .float startplaytime; // time of switching from spectator to player
 .float alivetime; // time of being alive
-
+.float death_time;
 .bool wasplayer;
 
 .int spectatee_status;
index 34c8fdbdfbd6fa79bd03731780f3284678646cd1..be5e0b91c593d8c07a3e29407842ad242dc61823 100644 (file)
@@ -22,8 +22,6 @@ float autocvar_sv_gibhealth;
 .float pushltime;
 .bool istypefrag;
 
-.float death_time;
-
 .float score_frame_dmg;
 .float score_frame_dmgtaken;
 
index 175f8d6834ea20d836a64ebc3079c0822dfb6ba2..28a94d77610beb246c6fcf7d34585f81ec471b10 100644 (file)
@@ -2560,6 +2560,14 @@ void EndFrame()
                it.hitsound_damage_dealt = 0;
                it.killsound = false;
                antilag_record(it, CS(it), altime);
+               if(it.death_time == time && IS_PLAYER(it) && IS_DEAD(it))
+               {
+                       // player's bbox gets resized now, instead of in the damage event that killed the player,
+                       // once all the damage events of this frame have been processed with normal size
+                       float h = ceil((it.mins.z + it.maxs.z) * PL_CORPSE_SCALE * 10) / 10;
+                       it.maxs.z = max(h, it.mins.z + 1);
+                       setsize(it, it.mins, it.maxs);
+               }
        });
        IL_EACH(g_monsters, true,
        {