From 90474b858070eb91e5da668503a74abdea1e96a0 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 24 Oct 2024 17:44:46 +0200 Subject: [PATCH] Fix #2922 "Player corpse not resized when suiciding with a weapon" Fixed by moving code that resizes player bbox from PlayerPostThink to EndFrame, which is executed later. Also update hash --- .gitlab-ci.yml | 2 +- qcsrc/server/client.qc | 8 -------- qcsrc/server/client.qh | 2 +- qcsrc/server/player.qh | 2 -- qcsrc/server/world.qc | 8 ++++++++ 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04c31a34c..c0eb10405 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 $? diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 4a6453703..211d23da7 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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); diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 3c040d15d..cd3c162ba 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -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; diff --git a/qcsrc/server/player.qh b/qcsrc/server/player.qh index 34c8fdbdf..be5e0b91c 100644 --- a/qcsrc/server/player.qh +++ b/qcsrc/server/player.qh @@ -22,8 +22,6 @@ float autocvar_sv_gibhealth; .float pushltime; .bool istypefrag; -.float death_time; - .float score_frame_dmg; .float score_frame_dmgtaken; diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 175f8d683..28a94d776 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -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, { -- 2.39.2