]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix use of switchweapon in death weapon throwing code
authorMario <mario@smbclan.net>
Sun, 29 Jan 2017 08:23:36 +0000 (18:23 +1000)
committerMario <mario@smbclan.net>
Sun, 29 Jan 2017 08:23:36 +0000 (18:23 +1000)
qcsrc/common/mutators/mutator/pinata/sv_pinata.qc
qcsrc/server/player.qc
qcsrc/server/weapons/throwing.qc
qcsrc/server/weapons/throwing.qh

index ff942db310e4fbf434c725343e091cdab24b39f9..ff44cc8bd0a89facf0ab00abd49f4c861488f498 100644 (file)
@@ -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);
                ));
index 6a20304f049ea96f4e80752d95bbfc8af33dfcb4..289da329faed4bed16473af9088c7aaf4f289636 100644 (file)
@@ -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
index ba84b14c50d11ea9ebb657e8b5465c25e5d210b2..6e40d16b80e57ca538accb5aa67b26defa8ae268 100644 (file)
@@ -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))
index 01ab21ba63323427fd8783bf8895fbee3a16fbbd..1b62b64c805b28c475c04f51b50f2448459bafe7 100644 (file)
@@ -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);