From: Mario Date: Sun, 29 Jan 2017 08:23:36 +0000 (+1000) Subject: Fix use of switchweapon in death weapon throwing code X-Git-Tag: xonotic-v0.8.2~262 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b7209450f58bef1130a4dce2dc5931cb59d09f98;p=xonotic%2Fxonotic-data.pk3dir.git Fix use of switchweapon in death weapon throwing code --- diff --git a/qcsrc/common/mutators/mutator/pinata/sv_pinata.qc b/qcsrc/common/mutators/mutator/pinata/sv_pinata.qc index ff942db31..ff44cc8bd 100644 --- a/qcsrc/common/mutators/mutator/pinata/sv_pinata.qc +++ b/qcsrc/common/mutators/mutator/pinata/sv_pinata.qc @@ -10,12 +10,12 @@ MUTATOR_HOOKFUNCTION(pinata, PlayerDies) { .entity weaponentity = weaponentities[slot]; - if(frag_target.(weaponentity).m_weapon == WEP_Null && slot != 0) + if(frag_target.(weaponentity).m_weapon == WEP_Null) continue; FOREACH(Weapons, it != WEP_Null, LAMBDA( if(frag_target.weapons & WepSet_FromWeapon(it)) - if(frag_target.(weaponentity).m_switchweapon != it) + if(frag_target.(weaponentity).m_weapon != it) if(W_IsWeaponThrowable(frag_target, it.m_id)) W_ThrowNewWeapon(frag_target, it.m_id, false, CENTER_OR_VIEWOFS(frag_target), randomvec() * 175 + '0 0 325', weaponentity); )); diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 6a20304f0..289da329f 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -594,7 +594,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { .entity went = weaponentities[slot]; - SpawnThrownWeapon(this, this.origin + (this.mins + this.maxs) * 0.5, this.(went).m_switchweapon.m_id, went); + SpawnThrownWeapon(this, this.origin + (this.mins + this.maxs) * 0.5, this.(went).m_weapon, went); } // become fully visible diff --git a/qcsrc/server/weapons/throwing.qc b/qcsrc/server/weapons/throwing.qc index ba84b14c5..6e40d16b8 100644 --- a/qcsrc/server/weapons/throwing.qc +++ b/qcsrc/server/weapons/throwing.qc @@ -194,9 +194,9 @@ void W_ThrowWeapon(entity this, .entity weaponentity, vector velo, vector delta, Send_Notification(NOTIF_ONE, this, MSG_MULTI, ITEM_WEAPON_DROP, a, w.m_id); } -void SpawnThrownWeapon(entity this, vector org, float w, .entity weaponentity) +void SpawnThrownWeapon(entity this, vector org, Weapon wep, .entity weaponentity) { - entity wep = this.(weaponentity).m_weapon; + //entity wep = this.(weaponentity).m_weapon; if(this.weapons & WepSet_FromWeapon(wep)) if(W_IsWeaponThrowable(this, wep.m_id)) diff --git a/qcsrc/server/weapons/throwing.qh b/qcsrc/server/weapons/throwing.qh index 01ab21ba6..1b62b64c8 100644 --- a/qcsrc/server/weapons/throwing.qh +++ b/qcsrc/server/weapons/throwing.qh @@ -11,4 +11,4 @@ bool W_IsWeaponThrowable(entity this, int w); // toss current weapon void W_ThrowWeapon(entity this, .entity weaponentity, vector velo, vector delta, float doreduce); -void SpawnThrownWeapon(entity this, vector org, float w, .entity weaponentity); +void SpawnThrownWeapon(entity this, vector org, Weapon wep, .entity weaponentity);