From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Wed, 26 Jan 2022 20:47:56 +0000 (+0100) Subject: fix weapon drop and pinata not properly working in battle royale X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1d7cd1861428024a8ac4dade1c186f569707e5fd;p=xonotic%2Fxonotic-data.pk3dir.git fix weapon drop and pinata not properly working in battle royale --- diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc index 16bad1b27..90611c765 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc @@ -581,14 +581,14 @@ MUTATOR_HOOKFUNCTION(br, Damage_Calculate) } } -MUTATOR_HOOKFUNCTION(br, PlayerDies) +MUTATOR_HOOKFUNCTION(br, PlayerDies, CBC_ORDER_FIRST) { entity frag_attacker = M_ARGV(1, entity); entity frag_target = M_ARGV(2, entity); float frag_deathtype = M_ARGV(3, float); // float for some reason, breaks if changed to int if(!IS_PLAYER(frag_target)) - return false; + return true; if(STAT(DROP, frag_target) == DROP_TRANSPORT) { @@ -609,6 +609,14 @@ MUTATOR_HOOKFUNCTION(br, PlayerDies) { Kill_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CPID_BR_DOWN); STAT(BLEEDING, frag_target) = false; + + // restore weapons on death to make weapon drop work + STAT(WEAPONS, frag_target) = frag_target.br_wepset_old; + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + .entity weaponentity = weaponentities[slot]; + frag_target.(weaponentity).m_weapon = frag_target.br_weapon_prev[slot]; + } } frag_target.respawn_flags = RESPAWN_SILENT | RESPAWN_FORCE; frag_target.respawn_time = time + 2;